當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Kernel::initializeContainer方法代碼示例

本文整理匯總了PHP中Symfony\Component\HttpKernel\Kernel::initializeContainer方法的典型用法代碼示例。如果您正苦於以下問題:PHP Kernel::initializeContainer方法的具體用法?PHP Kernel::initializeContainer怎麽用?PHP Kernel::initializeContainer使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Symfony\Component\HttpKernel\Kernel的用法示例。


在下文中一共展示了Kernel::initializeContainer方法的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: initializeContainer

 protected function initializeContainer()
 {
     parent::initializeContainer();
     /** @var SymfonyContainerBridge $rootContainer */
     $rootContainer = $this->getContainer();
     $rootContainer->setFallbackContainer($this->getPHPDIContainer());
 }
開發者ID:mnapoli,項目名稱:php-di-symfony2,代碼行數:7,代碼來源:Kernel.php

示例2: initializeContainer

 protected function initializeContainer()
 {
     parent::initializeContainer();
     if (PHP_SAPI == 'cli') {
         $this->getContainer()->enterScope('request');
         $this->getContainer()->set('request', new \Symfony\Component\HttpFoundation\Request(), 'request');
     }
 }
開發者ID:Jheengut,項目名稱:linuxcounter.new,代碼行數:8,代碼來源:AppKernel.php

示例3: initializeContainer

 /**
  * PHP-DIのコンテナを初期化する。
  */
 protected function initializeContainer()
 {
     parent::initializeContainer();
     $builder = new \DI\ContainerBuilder();
     $builder->wrapContainer($this->getContainer());
     $builder->useAnnotations(true);
     $this->getContainer()->setFallbackContainer($builder->build());
 }
開發者ID:teematsu,項目名稱:SymfonyAutoWiringStudy,代碼行數:11,代碼來源:AppKernel.php

示例4: initializeContainer

 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__));
 }
開發者ID:sourcefabric,項目名稱:newscoop,代碼行數:13,代碼來源:AppKernel.php

示例5: initializeContainer

 /**
  * 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;
 }
開發者ID:N3m1s,項目名稱:ElasticsearchBundle,代碼行數:27,代碼來源:AppKernel.php

示例6: initializeContainer

 /**
  * Add custom error handler
  */
 protected function initializeContainer()
 {
     $handler = new ErrorHandler();
     $handler->registerHandlers();
     parent::initializeContainer();
 }
開發者ID:antrampa,項目名稱:platform,代碼行數:9,代碼來源:OroKernel.php

示例7: initializeContainer

 protected function initializeContainer()
 {
     parent::initializeContainer();
     $this->getContainer()->enterScope('request');
     $this->getContainer()->set('request', new Request(), 'request');
 }
開發者ID:spin7ion,項目名稱:JonlilCKFinderBundle,代碼行數:6,代碼來源:AppKernel.php

示例8: initializeContainer

 protected function initializeContainer()
 {
     \CampaignChain\CoreBundle\Util\SystemUtil::redirectInstallMode();
     parent::initializeContainer();
     date_default_timezone_set('UTC');
 }
開發者ID:campaignchain,項目名稱:campaignchain-ce,代碼行數:6,代碼來源:AppKernel.php

示例9: initializeContainer

 protected function initializeContainer()
 {
     parent::initializeContainer();
     static::$_container = $this->getContainer();
 }
開發者ID:defan-marunchak,項目名稱:eurotax,代碼行數:5,代碼來源:AppKernel.php

示例10: initializeContainer

 /**
  * {@inheritdoc}
  */
 protected function initializeContainer()
 {
     parent::initializeContainer();
     $injector = new Injector(new AppModule());
     $this->getContainer()->setInjector($injector);
 }
開發者ID:ttskch,項目名稱:symfony-raydi-sample,代碼行數:9,代碼來源:AppKernel.php

示例11: initializeContainer

 /**
  * Overrides the parent method to add the loader to the container.
  *
  * {@inheritdoc}
  */
 protected function initializeContainer()
 {
     parent::initializeContainer();
     $this->container->set('composer.loader', $this->loader);
 }
開發者ID:chancegarcia,項目名稱:TheodoEvolutionLegacyWrapperBundle,代碼行數:10,代碼來源:EvolutionKernel.php

示例12: initializeContainer

 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();
 }
開發者ID:forkcms,項目名稱:forkcms,代碼行數:9,代碼來源:Kernel.php

示例13: initializeContainer

 protected function initializeContainer()
 {
     parent::initializeContainer();
     // Inject the registry to the container
     $this->getContainer()->set('vivait_tenant.registry', $this->getTenantRegistry());
 }
開發者ID:kieljohn,項目名稱:TenantBundle,代碼行數:6,代碼來源:TenantKernel.php

示例14: initializeContainer

 /**
  * 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);
 }
開發者ID:rmaiwald,項目名稱:core,代碼行數:16,代碼來源:ZikulaKernel.php


注:本文中的Symfony\Component\HttpKernel\Kernel::initializeContainer方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。