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 MediaServerFilter extends sfFilter | |
{ | |
public function execute($filterChain) | |
{ | |
$filterChain->execute(); | |
// Execute this filter only once | |
if ($this->isFirstCall() && sfConfig::get('app_media_filter_disable', false) == false) { | |
// Filters don't have direct access to the request and user objects. |
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 Demo\Bundle\WebsiteBundle\DataFixtures\ORM; | |
use Doctrine\Common\DataFixtures\AbstractFixture; | |
use Doctrine\Common\DataFixtures\OrderedFixtureInterface; | |
use Doctrine\Common\Persistence\ObjectManager; | |
use Doctrine\Common\DataFixtures\FixtureInterface; | |
use Application\Sonata\UserBundle\Entity\User; | |
use Symfony\Component\DependencyInjection\ContainerAwareInterface; |
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/sh | |
NFSUID=`stat -c %u /vagrant/` | |
/usr/bin/sudo su -c "cat /etc/passwd | grep -v vagrant:x: > /etc/passwd.new" | |
/usr/bin/sudo su -c "echo \"vagrant:x:${NFSUID}:502::/home/vagrant:/bin/bash\" >> /etc/passwd.new" | |
/usr/bin/sudo su -c "chown -R ${NFSUID}:vagrant /home/vagrant" | |
/usr/bin/sudo su -c "mv -f /etc/passwd.new /etc/passwd" | |
/usr/bin/sudo su -c "chown -R vagrant:vagrant /var/lib/php/session" | |
/usr/bin/sudo su -c "chown vagrant:vagrant /tmp/vagrant-*" |
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 My\Bundle\BlockBundle\Block; | |
use Symfony\Component\HttpFoundation\Response; | |
use Sonata\BlockBundle\Model\BlockInterface; | |
use Sonata\BlockBundle\Block\BaseBlockService; | |
use Sonata\AdminBundle\Form\FormMapper; | |
use Sonata\AdminBundle\Validator\ErrorElement; |
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
public function setProfileImage($profile_image) | |
{ | |
$this->profile_image = $profile_image; | |
if ($profile_image instanceof UploadedFile) { | |
$this->setUpdatedAt(new \DateTime()); | |
} | |
} |
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 | |
use Silex\WebTestCase; | |
use Silex\Application; | |
use Silex\Provider\SessionServiceProvider; | |
use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage; | |
use Symfony\Component\HttpFoundation\Session\Storage\MockFileSessionStorage; | |
class unitTest extends WebTestCase | |
{ |
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 | |
use Silex\WebTestCase; | |
use Silex\Application; | |
use Silex\Provider\SessionServiceProvider; | |
use Symfony\Component\HttpFoundation\Session\Storage\MockArraySessionStorage; | |
class unitTest extends WebTestCase | |
{ | |
public function testUn() |
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 | |
interface MyAPI | |
{ | |
public function getThing(); | |
} | |
class MyApiImplentation implements MyAPI | |
{ | |
public function getThing() |
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 Majax\PortalBundle\Builder; | |
use Symfony\Bundle\DoctrineBundle\Registry; | |
class SiteListBuilder { | |
/** @var \Symfony\Bundle\DoctrineBundle\Registry */ | |
private $orm; | |
public function __construct($orm) |
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 | |
source /etc/profile | |
git init | |
mv base.iml $1.iml | |
cd .idea/ | |
cat modules.xml | sed "s/base/$1/g" > modules.xml.new | |
mv modules.xml.new modules.xml |