當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。