improves extensibility between bundles
This commit is contained in:
parent
3d64d8e70f
commit
59e2e97055
@ -11,6 +11,8 @@
|
|||||||
|
|
||||||
namespace Symfony\Component\HttpKernel\Bundle;
|
namespace Symfony\Component\HttpKernel\Bundle;
|
||||||
|
|
||||||
|
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
|
||||||
|
|
||||||
use Symfony\Component\DependencyInjection\ContainerAware;
|
use Symfony\Component\DependencyInjection\ContainerAware;
|
||||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||||
use Symfony\Component\DependencyInjection\Container;
|
use Symfony\Component\DependencyInjection\Container;
|
||||||
@ -97,6 +99,13 @@ abstract class Bundle extends ContainerAware implements BundleInterface
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* {@inheritDoc}
|
||||||
|
*/
|
||||||
|
public function configureContainerExtension(ExtensionInterface $extension)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the Bundle namespace.
|
* Gets the Bundle namespace.
|
||||||
*
|
*
|
||||||
|
@ -11,6 +11,8 @@
|
|||||||
|
|
||||||
namespace Symfony\Component\HttpKernel\Bundle;
|
namespace Symfony\Component\HttpKernel\Bundle;
|
||||||
|
|
||||||
|
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
|
||||||
|
|
||||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -56,6 +58,13 @@ interface BundleInterface
|
|||||||
*/
|
*/
|
||||||
function getContainerExtension();
|
function getContainerExtension();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Allows the bundle to configure extensions of other bundles.
|
||||||
|
*
|
||||||
|
* @param ExtensionInterface $extension
|
||||||
|
*/
|
||||||
|
function configureContainerExtension(ExtensionInterface $extension);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the bundle parent name.
|
* Returns the bundle parent name.
|
||||||
*
|
*
|
||||||
|
@ -628,6 +628,10 @@ abstract class Kernel implements KernelInterface
|
|||||||
$bundle->build($container);
|
$bundle->build($container);
|
||||||
|
|
||||||
if ($extension = $bundle->getContainerExtension()) {
|
if ($extension = $bundle->getContainerExtension()) {
|
||||||
|
foreach ($this->bundles as $b) {
|
||||||
|
$b->configureContainerExtension($extension);
|
||||||
|
}
|
||||||
|
|
||||||
$container->registerExtension($extension);
|
$container->registerExtension($extension);
|
||||||
$extensions[] = $extension->getAlias();
|
$extensions[] = $extension->getAlias();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user