/** * {@inheritDoc} * * @param InputInterface $input input * @param OutputInterface $output output * * @return void */ protected function execute(InputInterface $input, OutputInterface $output) { // @todo it was suggested this may/should be moved to app/cache..? $dynamicDir = $this->kernel->getRootDir() . '/../src/GravitonDyn/'; if ($this->filesystem->exists($dynamicDir)) { $this->filesystem->remove($dynamicDir); } }
/** * return our namespaced AppKernel * * Most symfony projects keep their AppKernel class in phps * global space. Since we don't this needs to be overridden. * * This also allows us to properly set up the BundleLoader * infrastucture. This isn't in the DIC since it is used to * bootstrap the DIC itself. * * @param array $options array of options, default: empty, currently ignored * * @return \Graviton\AppKernel */ public static function createKernel(array $options = array()) { include_once __DIR__ . '/../../../../app/AppKernel.php'; $env = 'test'; $debug = true; $kernel = new AppKernel($env, $debug); $kernel->setBundleLoader(new BundleLoader(new GravitonBundleBundle())); //set error reporting for phpunit ini_set('error_reporting', E_ALL); return $kernel; }
$loader = (require_once __DIR__ . '/../app/bootstrap.php.cache'); // @codingStandardsIgnoreEnd require_once __DIR__ . '/../app/AppKernel.php'; require_once __DIR__ . '/../app/AppCache.php'; // check for env $env = getenv('SYMFONY_ENV'); if (false === $env) { // fallback to 'prod' $env = 'prod'; } $activateDebug = false; if (strpos($env, 'dev') !== false) { // catch also oauth_dev & co.. $activateDebug = true; } if ($activateDebug) { Debug::enable(); } $kernel = new AppKernel($env, $activateDebug); $kernel->setBundleLoader(new BundleLoader(new GravitonBundleBundle())); $kernel->loadClassCache(); if (!$activateDebug) { $kernel = new AppCache($kernel); } // When using the HttpCache, you need to call the method in your front controller // instead of relying on the configuration parameter // Request::enableHttpMethodParameterOverride(); $request = Request::createFromGlobals(); $response = $kernel->handle($request); $response->send(); $kernel->terminate($request, $response);