本文整理汇总了PHP中Symfony\Component\HttpKernel\Kernel::prepareContainer方法的典型用法代码示例。如果您正苦于以下问题:PHP Kernel::prepareContainer方法的具体用法?PHP Kernel::prepareContainer怎么用?PHP Kernel::prepareContainer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symfony\Component\HttpKernel\Kernel
的用法示例。
在下文中一共展示了Kernel::prepareContainer方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepareContainer
/**
* {@inheritdoc}
*/
protected function prepareContainer(\Symfony\Component\DependencyInjection\ContainerBuilder $container)
{
parent::prepareContainer($container);
$container->setDefinition(
'session.test_storage',
new \Symfony\Component\DependencyInjection\Definition('FOS\HttpCacheBundle\Tests\Functional\Fixtures\Session\TestSessionStorage')
);
}
示例2: prepareContainer
/**
* {@inheritdoc}
*
* @param ContainerBuilder $container Container builder.
*/
protected function prepareContainer(ContainerBuilder $container)
{
parent::prepareContainer($container);
$loader = $this->getContainerLoader($container);
$loader->load($this->getConfigDir() . '/parameters.yml');
$loader->load($this->getRootDir() . '/Resources/config/config_' . $this->getEnvironment() . '.yml');
$loader->load($this->getRootDir() . '/Resources/services/services.yml');
$this->configure($container, $loader);
}
示例3: prepareContainer
protected function prepareContainer(ContainerBuilder $container)
{
parent::prepareContainer($container);
$bundles = $container->getParameter('kernel.bundles');
foreach ($bundles as $name => $fqcn) {
switch ($name) {
case 'DoctrineBundle':
$container->loadFromExtension('doctrine', array('orm' => array('mappings' => array('App' => array('type' => 'annotation', 'prefix' => $this->appNamespace ? $this->appNamespace . '\\Entity' : 'Entity', 'dir' => $this->appPath . '/Entity')))));
break;
}
}
$container->setParameter('controller_name_converter.class', 'WouterJ\\Bundleless\\Controller\\ControllerNameParser');
}
示例4: prepareContainer
protected function prepareContainer(ContainerBuilder $container)
{
parent::prepareContainer($container);
$container->addCompilerPass(new OverrideServiceCompilerPass());
}