initializeContainer() protected method

protected initializeContainer ( )
Example #1
0
 protected function initializeContainer()
 {
     parent::initializeContainer();
     /** @var SymfonyContainerBridge $rootContainer */
     $rootContainer = $this->getContainer();
     $rootContainer->setFallbackContainer($this->getPHPDIContainer());
 }
Example #2
0
 protected function initializeContainer()
 {
     parent::initializeContainer();
     if (PHP_SAPI == 'cli') {
         $this->getContainer()->enterScope('request');
         $this->getContainer()->set('request', new \Symfony\Component\HttpFoundation\Request(), 'request');
     }
 }
 /**
  * PHP-DIのコンテナを初期化する。
  */
 protected function initializeContainer()
 {
     parent::initializeContainer();
     $builder = new \DI\ContainerBuilder();
     $builder->wrapContainer($this->getContainer());
     $builder->useAnnotations(true);
     $this->getContainer()->setFallbackContainer($builder->build());
 }
Example #4
0
 protected function initializeContainer()
 {
     parent::initializeContainer();
     try {
         $timeZone = $this->getContainer()->get('system_preferences_service')->TimeZone;
         if (!empty($timeZone)) {
             date_default_timezone_set($timeZone);
         }
     } catch (\Exception $e) {
     }
     // Set temp dir for Newscoop to project cache directory
     putenv(sprintf('TMPDIR=%s/../cache', __DIR__));
 }
Example #5
0
 /**
  * Only check configuration difference on first test case. The rest test cases might be the same ;).
  *
  * @throws Exception
  */
 protected function initializeContainer()
 {
     static $first = true;
     if ('test' !== $this->getEnvironment()) {
         parent::initializeContainer();
         return;
     }
     $debug = $this->debug;
     if (!$first) {
         // disable debug mode on all but the first initialization
         $this->debug = false;
     }
     // will not work with --process-isolation
     $first = false;
     try {
         parent::initializeContainer();
     } catch (\Exception $e) {
         $this->debug = $debug;
         throw $e;
     }
     $this->debug = $debug;
 }
Example #6
0
 /**
  * Add custom error handler
  */
 protected function initializeContainer()
 {
     $handler = new ErrorHandler();
     $handler->registerHandlers();
     parent::initializeContainer();
 }
 protected function initializeContainer()
 {
     parent::initializeContainer();
     $this->getContainer()->enterScope('request');
     $this->getContainer()->set('request', new Request(), 'request');
 }
 protected function initializeContainer()
 {
     \CampaignChain\CoreBundle\Util\SystemUtil::redirectInstallMode();
     parent::initializeContainer();
     date_default_timezone_set('UTC');
 }
Example #9
0
 protected function initializeContainer()
 {
     parent::initializeContainer();
     static::$_container = $this->getContainer();
 }
Example #10
0
 /**
  * {@inheritdoc}
  */
 protected function initializeContainer()
 {
     parent::initializeContainer();
     $injector = new Injector(new AppModule());
     $this->getContainer()->setInjector($injector);
 }
 /**
  * Overrides the parent method to add the loader to the container.
  *
  * {@inheritdoc}
  */
 protected function initializeContainer()
 {
     parent::initializeContainer();
     $this->container->set('composer.loader', $this->loader);
 }
Example #12
0
 protected function initializeContainer()
 {
     // remove the cache dir when installing a module to trigger rebuilding the kernel
     if ($this->isInstallingModule()) {
         $fileSystem = new Filesystem();
         $fileSystem->remove($this->getCacheDir() . '/' . $this->getContainerClass() . '.php');
     }
     parent::initializeContainer();
 }
Example #13
0
 protected function initializeContainer()
 {
     parent::initializeContainer();
     // Inject the registry to the container
     $this->getContainer()->set('vivait_tenant.registry', $this->getTenantRegistry());
 }
Example #14
0
 /**
  * Initializes the service container.
  *
  * The cached version of the service container is used when fresh, otherwise the
  * container is built.
  *
  * Overridden not to dump the container.
  */
 protected function initializeContainer()
 {
     if (true === $this->dump) {
         return parent::initializeContainer();
     }
     $this->container = $this->buildContainer();
     $this->container->set('kernel', $this);
 }