This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$de_index = 0; | |
$lastFrench = null; | |
foreach ($db->query('SELECT * from fluxcms_blogposts order by post_date desc') as $row) { | |
... | |
if ($row['post_lang'] == 'de') { | |
if ($lastFrench == null) { | |
$lastFrench = $de_index; | |
} | |
$de_index++; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php | |
<?php | |
$repos = array(); | |
exec('find -type d -name .git | sed -e "s/\.git//"', $repos); | |
foreach ($repos as $repo) { | |
$status = shell_exec("cd $repo && git status"); | |
if (false == strpos($status, 'nothing to commit (working directory clean)')) { | |
echo "$repo\n" . str_repeat('-', strlen($repo)) . "\n$status\n\n"; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UserAdmin | |
{ | |
... | |
// i inject the security.context into the constructor to have it available | |
/** | |
* Alter list query to only see items i created | |
*/ | |
public function createQuery($context = 'list') | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* An implementation of the MutableAclProviderInterface using Doctrine DBAL. | |
* | |
* @author Stefan Paschke <stefan.paschke@liip.ch> | |
*/ | |
class MutableAclProvider extends BaseMutableAclProvider | |
{ | |
/** | |
* Get the entities Ids for the className that match the given role & mask | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
this_dir = File.dirname(__FILE__) + "/" | |
require this_dir + "vagrant/hostmaster.rb" | |
Vagrant::Config.run do |config| | |
# define some colors for our output | |
def colorize(text, color_code) "#{color_code}#{text}\033[0m" end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// match method becomes | |
public function matchRequest(Request $request) | |
{ | |
$defaults = $this->nestedMatcher->matchRequest($request); | |
foreach ($this->enhancers as $enhancer) { | |
$defaults = $enhancer->enhance($defaults, $request); | |
} | |
return $defaults; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Liip\CoreBundle\Command; | |
use Symfony\Bundle\FrameworkBundle\Command\ContainerAwareCommand; | |
use Symfony\Component\Console\Input\InputInterface; | |
use Symfony\Component\Console\Output\OutputInterface; | |
use Symfony\Component\Console\Input\InputOption; | |
use Symfony\Component\Translation\Loader\LoaderInterface; | |
use Symfony\Component\Finder\Finder; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
sudo apt-get install -y --force-yes apache2 | |
sudo a2enmod actions | |
sudo a2enmod rewrite | |
echo "export PATH=/home/vagrant/.phpenv/bin:$PATH" | sudo tee -a /etc/apache2/envvars > /dev/null | |
echo "$(cat scripts/travis/assets/phpconfig.txt)" | sudo tee /etc/apache2/conf.d/phpconfig > /dev/null | |
echo "$(cat scripts/travis/assets/vhost.txt)" | sed -e "s,PATH,`pwd`/web,g" | sudo tee /etc/apache2/sites-available/default > /dev/null | |
echo "date.timezone = UTC" >> `php --ini | grep "Loaded Configuration" | sed -e "s|.*:\s*||"` | |
sudo service apache2 restart |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class ImageType extends AbstractType | |
{ | |
public function buildForm(FormBuilderInterface $builder, array $options) | |
{ | |
if ($options['required_auto'] && ! $options['required']) { | |
$builder->addEventListener(\Symfony\Component\Form\FormEvents::PRE_SET_DATA, array($this, 'determineRequired')); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Acme\UserBundle\Security\User; | |
use Symfony\Component\Security\Core\Exception\UsernameNotFoundException; | |
use Symfony\Component\Security\Core\User\UserProviderInterface; | |
use Symfony\Component\Security\Core\User\UserInterface as SecurityUserInterface; | |
use Symfony\Component\Validator\Validator; | |
class ConfluenceUserProvider implements UserProviderInterface |
OlderNewer