当前位置: 首页>>代码示例>>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;未经允许,请勿转载。