当前位置: 首页>>代码示例>>PHP>>正文


PHP Kernel::buildContainer方法代码示例

本文整理汇总了PHP中Symfony\Component\HttpKernel\Kernel::buildContainer方法的典型用法代码示例。如果您正苦于以下问题:PHP Kernel::buildContainer方法的具体用法?PHP Kernel::buildContainer怎么用?PHP Kernel::buildContainer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Symfony\Component\HttpKernel\Kernel的用法示例。


在下文中一共展示了Kernel::buildContainer方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: buildContainer

 protected function buildContainer()
 {
     $builder = parent::buildContainer();
     $serviceContainer = new ServiceContainer($builder);
     $this->dumplieKernel->build($serviceContainer);
     return $builder;
 }
开发者ID:dumplie,项目名称:dumplie,代码行数:7,代码来源:Kernel.php

示例2: buildContainer

 /**
  * Builds the service container.
  *
  * @return \Symfony\Component\DependencyInjection\ContainerBuilder The compiled service container
  *
  * @throws \RuntimeException
  */
 protected function buildContainer()
 {
     $container = parent::buildContainer();
     try {
         $installedModules = $container->get('database')->getColumn('SELECT name FROM modules');
     } catch (\SpoonDatabaseException $e) {
         $installedModules = array();
     } catch (\PDOException $e) {
         // fork is probably not installed yet
         $installedModules = array();
     }
     $container->setParameter('installed_modules', $installedModules);
     $extensions = array();
     foreach ($installedModules as $module) {
         $class = 'Backend\\Modules\\' . $module . '\\DependencyInjection\\' . $module . 'Extension';
         if (class_exists($class)) {
             $extension = new $class();
             $container->registerExtension($extension);
             $extensions[] = $extension->getAlias();
         }
     }
     // ensure these extensions are implicitly loaded
     $container->getCompilerPassConfig()->setMergePass(new MergeExtensionConfigurationPass(array_keys($container->getExtensions())));
     return $container;
 }
开发者ID:bwgraves,项目名称:forkcms,代码行数:32,代码来源:Kernel.php

示例3: buildContainer

 /**
  * {@inheritdoc}
  */
 protected function buildContainer()
 {
     $container = parent::buildContainer();
     $loader = new XmlFileLoader($container, new FileLocator(__DIR__ . '/config'));
     $loader->load('services.xml');
     $container->setParameter('kernel.storage', $this->storage);
     return $container;
 }
开发者ID:php-task,项目名称:TaskBundle,代码行数:11,代码来源:TestKernel.php

示例4: buildContainer

 /**
  * {@inheritDoc}
  */
 protected function buildContainer()
 {
     $container = parent::buildContainer();
     call_user_func($this->localKernelContainerSetUp, $this, $container);
     return $container;
 }
开发者ID:absolvent,项目名称:phpunit-symfony,代码行数:9,代码来源:TestKernel.php

示例5: buildContainer

 /**
  * Builds the service container.
  *
  * @return ContainerBuilder The compiled service container
  *
  * @throws \RuntimeException
  */
 protected function buildContainer()
 {
     $container = parent::buildContainer();
     $this->loadConfiguration($container);
     $container->customCompile();
     return $container;
 }
开发者ID:puterakahfi,项目名称:thelia,代码行数:14,代码来源:Thelia.php

示例6: buildContainer

 /**
  * When this method is called, the cache was invalidated
  *
  * @see \Symfony\Component\HttpKernel\Kernel::buildContainer()
  */
 protected function buildContainer()
 {
     $this->is_fresh = false;
     return parent::buildContainer();
 }
开发者ID:eddypouw,项目名称:hnDependencyInjectionPlugin,代码行数:10,代码来源:Symfony1Kernel.php

示例7: buildContainer

 protected function buildContainer()
 {
     $containerBuilder = parent::buildContainer();
     $this->removeInvalidReferenceBehaviorPass($containerBuilder);
     return $containerBuilder;
 }
开发者ID:mnapoli,项目名称:php-di-symfony2,代码行数:6,代码来源:Kernel.php

示例8: buildContainer

 /**
  * {@inheritdoc}
  */
 protected function buildContainer()
 {
     $container = parent::buildContainer();
     foreach ($this->discoverDrupalServicesDefinitionFiles() as $filename) {
         $loader = new YamlFileLoader($container, new FileLocator(dirname($filename)));
         $loader->load(basename($filename));
     }
     foreach ($this->discoverDrupalServiceProviders() as $provider) {
         $provider->register($container);
     }
     return $container;
 }
开发者ID:makinacorpus,项目名称:drupal-sf-dic,代码行数:15,代码来源:Kernel.php

示例9: buildContainer

 /**
  * Builds the service container.
  *
  * @throws \RuntimeException
  *
  * @return ContainerBuilder The compiled service container
  */
 protected function buildContainer()
 {
     $container = parent::buildContainer();
     $installedModules = $this->getInstalledModules($container);
     $container->setParameter('installed_modules', $installedModules);
     foreach ($installedModules as $module) {
         $class = 'Backend\\Modules\\' . $module . '\\DependencyInjection\\' . $module . 'Extension';
         if (class_exists($class)) {
             $container->registerExtension(new $class());
         }
     }
     $container->registerExtension(new BackendExtension());
     // ensure these extensions are implicitly loaded
     $container->getCompilerPassConfig()->setMergePass(new MergeExtensionConfigurationPass(array_keys($container->getExtensions())));
     return $container;
 }
开发者ID:forkcms,项目名称:forkcms,代码行数:23,代码来源:Kernel.php

示例10: buildContainer

 /**
  * Builds the service container.
  *
  * @return \Symfony\Component\DependencyInjection\TaggedContainerInterface The compiled service container
  *
  * @throws \RuntimeException
  */
 protected function buildContainer()
 {
     $container = parent::buildContainer();
     $container->setParameter('app.command.ids', array_keys($container->findTaggedServiceIds('app.command')));
     return $container;
 }
开发者ID:VEBERArnaudPlayground,项目名称:GCSTest,代码行数:13,代码来源:Kernel.php


注:本文中的Symfony\Component\HttpKernel\Kernel::buildContainer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。