Skip to content

Instantly share code, notes, and snippets.

@marzocchi
Last active December 17, 2015 07:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marzocchi/5575715 to your computer and use it in GitHub Desktop.
Save marzocchi/5575715 to your computer and use it in GitHub Desktop.
Boots a Symfony 2.0 kernel when running boris from the project directory, and make the DIC available as $container.
<?php
/**
* Boots a Symfony 2.0 kernel when running boris from the project directory, and
* make the DIC available as $container.
*/
require_once __DIR__ . '/app/bootstrap.php.cache';
require_once __DIR__ . '/app/AppKernel.php';
$kernel = new AppKernel('dev', true);
$kernel->boot();
$boris->setLocal('container', $kernel->getContainer());
$boris->setLocal('kernel', $kernel);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment