Skip to content

Commit

Permalink
[HttpKernel] allowed bundle names to have 'bundle' in their base name
Browse files Browse the repository at this point in the history
  • Loading branch information
fabpot committed Apr 28, 2011
1 parent 40d256e commit 77f9daf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/Symfony/Component/HttpKernel/Bundle/Bundle.php
Expand Up @@ -65,12 +65,14 @@ public function build(ContainerBuilder $container)
public function getContainerExtension()
{
if (null === $this->extension) {
$class = $this->getNamespace().'\\DependencyInjection\\'.str_replace('Bundle', 'Extension', $this->getName());
$basename = preg_replace('/Bundle$/', '', $this->getName());

$class = $this->getNamespace().'\\DependencyInjection\\'.$basename.'Extension';
if (class_exists($class)) {
$extension = new $class();

// check naming convention
$expectedAlias = Container::underscore(str_replace('Bundle', '', $this->getName()));
$expectedAlias = Container::underscore($basename);
if ($expectedAlias != $extension->getAlias()) {
throw new \LogicException(sprintf(
'The extension alias for the default extension of a '.
Expand Down

0 comments on commit 77f9daf

Please sign in to comment.