/** * @return null */ public function setUp() { $this->kernel = new \AppKernel('test', true); $this->kernel->boot(); $this->container = $this->kernel->getContainer(); parent::setUp(); }
/** * @before * */ protected function setUpSymfonyKernel() { $this->kernel = $this->createKernel(); $this->kernel->boot(); $this->container = $this->kernel->getContainer(); $this->logger = $this->container->get('logger'); }
/** * @Given the following acme_php configuration: */ public function theFollowingAcmePhpConfiguration(PyStringNode $rawConfig) { $yaml = new Yaml(); $config = ['acme_php' => array_merge($this->getDefaultConfig(), $yaml->parse($rawConfig->getRaw()))]; $this->filesystem->dumpFile($this->acmeConfigPath, $yaml->dump($config, 4)); $this->kernel->shutdown(); $this->filesystem->remove($this->kernel->getCacheDir()); $this->kernel->boot(); }
public function _before(\Codeception\TestCase $test) { $this->kernel->boot(); $this->container = $this->kernel->getContainer(); if ($this->container->has('test.client')) { // it is Symfony2.2 $this->client = $this->container->get('test.client'); } else { $this->client = new $this->clientClass($this->kernel); } $this->client->followRedirects(true); }
/** * Sets up the kernel. * * @return void */ protected function setUpKernel() { if (null !== $this->kernel) { $this->tearDownKernel(); } $this->kernel = $this->createKernel(array('environment' => 'test', 'debug' => true)); $this->kernel->boot(); // Create Application $this->application = new Application($this->kernel); $this->application->setAutoExit(false); // Reset database and load fixtures $this->runConsole("doctrine:schema:drop", array("--force" => true)); $this->runConsole("doctrine:schema:create"); $this->runConsole("doctrine:fixtures:load", array("--no-interaction" => true)); }
public function _initialize() { $cache = getcwd() . DIRECTORY_SEPARATOR . $this->config['app_path'] . DIRECTORY_SEPARATOR . 'bootstrap.php.cache'; if (!file_exists($cache)) { throw new \RuntimeException('Symfony2 bootstrap file not found in ' . $cache); } require_once $cache; $this->kernelClass = $this->getKernelClass(); $this->kernel = new $this->kernelClass('test', true); $this->kernel->boot(); $dispatcher = $this->kernel->getContainer()->get('event_dispatcher'); $dispatcher->addListener('kernel.exception', function ($event) { throw $event->getException(); }); }
public function _before(\Codeception\TestCase $test) { $this->kernel->boot(); $this->container = $this->kernel->getContainer(); $this->client = new Symfony2Connector($this->kernel); $this->client->followRedirects(true); }
public function boot() { $modules = array(); $this->loadModuleBundlesFromFilesystem(); $this->loadThemeBundlesFromFilesystem(); parent::boot(); }
public function boot() { parent::boot(); if ($this->prepareDoctrineAfterBoot === true) { $this->prepareDoctrine(); } }
public function boot() { parent::boot(); if (!$this->container->getParameter('bzion.miscellaneous.development')) { if ($this->getEnvironment() != 'prod' || $this->isDebug()) { throw new ForbiddenDeveloperAccessException('You are not allowed to access this page in a non-production ' . 'environment. Please change the "development" configuration ' . 'value and clear the cache before proceeding.'); } } if (in_array($this->getEnvironment(), array('profile', 'dev'), true)) { Debug::enable(); } Service::setGenerator($this->container->get('router')->getGenerator()); Service::setEnvironment($this->getEnvironment()); Service::setModelCache(new ModelCache()); Service::setContainer($this->container); $this->setUpTwig(); // Ratchet doesn't support PHP's native session storage, so use our own // if we need it if (Service::getParameter('bzion.features.websocket.enabled') && $this->getEnvironment() !== 'test') { $storage = new NativeSessionStorage(array(), new DatabaseSessionHandler()); $session = new Session($storage); Service::getContainer()->set('session', $session); } Notification::initializeAdapters(); }
public function boot() { if (!Doctrine\ODM\MongoDB\Types\Type::hasType('object')) { Doctrine\ODM\MongoDB\Types\Type::addType('object', 'Payum\\Core\\Bridge\\Doctrine\\Types\\ObjectType'); } parent::boot(); }
/** * dispatch an event when application is boot */ public function boot() { parent::boot(); if (self::isInstalled()) { $this->getContainer()->get("event_dispatcher")->dispatch(TheliaEvents::BOOT); } }
/** * {@inheritdoc} */ public function boot() { if (true === $this->booted) { return; } parent::boot(); $this->container->compile(); }
/** * {@inheritdoc} */ public function boot() { parent::boot(); if ($kernelModifier = $this->kernelModifier) { $kernelModifier($this); $this->kernelModifier = null; } }
public function boot() { if (true === $this->booted) { return; } ++$this->containerNameCounter; return parent::boot(); }
protected function bootKernel() { if ($this->kernel) { return; } $this->kernel = new $this->kernelClass($this->config['environment'], $this->config['debug']); $this->kernel->boot(); }
public function _before(\Codeception\TestCase $test) { $this->kernel = new $this->kernelClass($this->config['environment'], $this->config['debug']); $this->kernel->boot(); $this->container = $this->kernel->getContainer(); $this->client = new Symfony2Connector($this->kernel); $this->client->followRedirects(true); }
/** * Boot and define the Fork Constants. */ public function boot() { if ($this->booted) { return; } parent::boot(); // define Fork constants $this->defineForkConstants(); }
public function _getEntityManager() { $this->kernel->boot(); if (!$this->kernel->getContainer()->has($this->config['em_service'])) { return null; } $this->client->persistentServices[] = $this->config['em_service']; $this->client->persistentServices[] = 'doctrine.orm.default_entity_manager'; return $this->kernel->getContainer()->get($this->config['em_service']); }
public function boot() { if (null === $this->autoloader) { $this->getAutoloader(); } parent::boot(); foreach ($this->bundles as $bundle) { if ($bundle instanceof AbstractModule) { $this->modules[] = $bundle; } elseif ($bundle instanceof AbstractTheme) { $this->themes[] = $bundle; } } foreach ($this->bundleMap as $name => $bundles) { if ($bundles[0] instanceof AbstractModule) { $this->moduleMap[$name] = $bundles; } elseif ($bundles[0] instanceof AbstractTheme) { $this->themeMap[$name] = $bundles; } } }
/** * {@inheritdoc} * * @SuppressWarnings(PHPMD.ExitExpression) */ public function boot() { $phpVersion = phpversion(); include_once $this->getRootDir() . '/OroRequirements.php'; if (!version_compare($phpVersion, OroRequirements::REQUIRED_PHP_VERSION, '>=')) { throw new \Exception(sprintf('PHP version must be at least %s (%s is installed)', OroRequirements::REQUIRED_PHP_VERSION, $phpVersion)); } parent::boot(); }
public function boot() { Type::addType('object', 'Payum\\Core\\Bridge\\Doctrine\\Types\\ObjectType'); parent::boot(); }
/** * {@inheritdoc} */ protected function setUp() { $this->kernel = new AppKernel('FakerExtensionTest', true); $this->kernel->boot(); }
public function _initialize() { $cache = Configuration::projectDir() . $this->config['var_path'] . DIRECTORY_SEPARATOR . 'bootstrap.php.cache'; if (!file_exists($cache)) { throw new ModuleRequireException(__CLASS__, "Symfony bootstrap file not found in {$cache}\n \n" . "Please specify path to bootstrap file using `var_path` config option\n \n" . "If you are trying to load bootstrap from a Bundle provide path like:\n \n" . "modules:\n enabled:\n" . " - Symfony:\n" . " var_path: '../../app'\n" . " app_path: '../../app'"); } require_once $cache; $this->kernelClass = $this->getKernelClass(); $maxNestingLevel = 200; // Symfony may have very long nesting level $xdebugMaxLevelKey = 'xdebug.max_nesting_level'; if (ini_get($xdebugMaxLevelKey) < $maxNestingLevel) { ini_set($xdebugMaxLevelKey, $maxNestingLevel); } $this->kernel = new $this->kernelClass($this->config['environment'], $this->config['debug']); $this->kernel->boot(); if ($this->config['cache_router'] === true) { $this->persistService('router', true); } }
/** * {@inheritdoc} */ protected function setUp() { $this->kernel = new AppKernel('dev', true); $this->kernel->boot(); }
public function setUp() { $this->kernel = new TestKernel('test', false); $this->kernel->boot(); }
/** * Boots the kernel * * @return void */ public function boot() { parent::boot(); $this->initializePlugins(); }
/** * @beforeClass */ public static function createSharedKernel() { static::$sharedKernel = static::createKernel(); static::$sharedKernel->boot(); }
protected function bootKernel() { if ($this->kernel) { return; } $this->kernel = new $this->kernelClass($this->config['environment'], $this->config['debug']); $this->kernel->boot(); if ($this->config['cache_router'] === true) { if (isset($this->permanentServices['router'])) { $this->kernel->getContainer()->set('router', $this->permanentServices['router']); } else { $this->permanentServices['router'] = $this->getRouter(); } } }
public function __construct(Kernel $kernel) { $kernel->boot(); $this->container = $kernel->getContainer(); }