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/env php | |
<?php | |
# bin/routes | |
$app = require __DIR__ . '/../app/bootstrap.php'; | |
$routes = $app['routes']->all(); | |
foreach($routes as $route) { | |
$cr = new ReflectionFunction($route->getDefault('_controller')); |
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
$app->register( | |
new Silex\Provider\SwiftmailerServiceProvider(), | |
array( | |
'swiftmailer.options' => array( | |
'sender_address' => $sender, | |
'transport' => 'smtp', | |
'encryption' => null, | |
'auth_mode' => 'login', | |
'host' => $server, | |
'port' => $port', |
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 | |
require "vendor/autoload.php"; | |
$mock = Mockery::mock("Dave")->shouldReceive("doThis")->once(); | |
Mockery::close(); |
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 Childcare\Common; | |
use Doctrine\Common\Persistence\AbstractManagerRegistry; | |
use Doctrine\ORM\ORMException; | |
use Pimple; | |
class DoctrineManagerRegistry extends AbstractManagerRegistry | |
{ |
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
$app['repository.factory'] = $app->protect(function($class) use ($app) { | |
return $app->share(function ($app) use ($class) { | |
return new $class($app['db']); | |
}); | |
}); | |
$app['users'] = $app['repository.factory']("User"); | |
$app['groups'] = $app['repository.factory']("Groups"); |
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 | |
require "vendor/autoload.php"; | |
use Symfony\Component\EventDispatcher\EventDispatcher; | |
use Symfony\Component\EventDispatcher\Event; | |
$dispatcher = new EventDispatcher; | |
$eventName = 'dave'; |
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
Pimple | |
273K | |
2153K | |
0.009068s | |
DependencyInjection | |
275K | |
2903K | |
0.051517s | |
DependencyInjection (dumped) | |
2041K |
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 | |
$app->register(new Silex\Provider\TwigServiceProvider(), array( | |
'twig.path' => __DIR__.'/views', | |
'twig.options' => array( | |
'cache' => __DIR__.'/../data/cache/twig', | |
'auto_reload' => true, | |
'strict_variables' => false, | |
), | |
)); |
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
language: php | |
env: | |
- SYMFONY_DEPS_VERSION=2.1 | |
- SYMFONY_DEPS_VERSION=2.2 | |
before_script: | |
# symfony/* | |
- sh -c "if [ '$SYMFONY_DEPS_VERSION' = '2.2' ]; then sed -i 's/>=2.1,<2.3-dev/2.2.*@dev/g' composer.json; composer require --no-update 'symfony/property-access:2.2.*@dev'; composer update --dev --prefer-source; fi" | |
- sh -c "if [ '$SYMFONY_DEPS_VERSION' = '2.1' ]; then sed -i 's/>=2.1,<2.3-dev/2.1.*@dev/g' composer.json; composer update --dev --prefer-source; fi" |
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 FooConverter | |
{ | |
public function convert($value) {} | |
} | |
$app = new Silex\Application; | |
$app['converters.foo'] = function($value) { |
NewerOlder