本文整理匯總了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;
}