本文整理汇总了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;
}
示例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;
}
示例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;
}
示例4: buildContainer
/**
* {@inheritDoc}
*/
protected function buildContainer()
{
$container = parent::buildContainer();
call_user_func($this->localKernelContainerSetUp, $this, $container);
return $container;
}
示例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;
}
示例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();
}
示例7: buildContainer
protected function buildContainer()
{
$containerBuilder = parent::buildContainer();
$this->removeInvalidReferenceBehaviorPass($containerBuilder);
return $containerBuilder;
}
示例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;
}
示例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;
}
示例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;
}