initializeContainer() 보호된 메소드

protected initializeContainer ( )
예제 #1
0
 protected function initializeContainer()
 {
     parent::initializeContainer();
     /** @var SymfonyContainerBridge $rootContainer */
     $rootContainer = $this->getContainer();
     $rootContainer->setFallbackContainer($this->getPHPDIContainer());
 }
예제 #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');
     }
 }
예제 #3
0
 /**
  * PHP-DIのコンテナを初期化する。
  */
 protected function initializeContainer()
 {
     parent::initializeContainer();
     $builder = new \DI\ContainerBuilder();
     $builder->wrapContainer($this->getContainer());
     $builder->useAnnotations(true);
     $this->getContainer()->setFallbackContainer($builder->build());
 }
예제 #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__));
 }
예제 #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;
 }
예제 #6
0
 /**
  * Add custom error handler
  */
 protected function initializeContainer()
 {
     $handler = new ErrorHandler();
     $handler->registerHandlers();
     parent::initializeContainer();
 }
예제 #7
0
 protected function initializeContainer()
 {
     parent::initializeContainer();
     $this->getContainer()->enterScope('request');
     $this->getContainer()->set('request', new Request(), 'request');
 }
예제 #8
0
 protected function initializeContainer()
 {
     \CampaignChain\CoreBundle\Util\SystemUtil::redirectInstallMode();
     parent::initializeContainer();
     date_default_timezone_set('UTC');
 }
예제 #9
0
 protected function initializeContainer()
 {
     parent::initializeContainer();
     static::$_container = $this->getContainer();
 }
예제 #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);
 }
예제 #12
0
파일: Kernel.php 프로젝트: forkcms/forkcms
 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();
 }
예제 #13
0
 protected function initializeContainer()
 {
     parent::initializeContainer();
     // Inject the registry to the container
     $this->getContainer()->set('vivait_tenant.registry', $this->getTenantRegistry());
 }
예제 #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);
 }