Renamed Bundle classes to be named like the bundle itself for more clarity
This commit is contained in:
parent
97162cfeda
commit
ed7287538b
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace Symfony\Framework\DoctrineBundle;
|
namespace Symfony\Framework\DoctrineBundle;
|
||||||
|
|
||||||
use Symfony\Foundation\Bundle\Bundle as BaseBundle;
|
use Symfony\Foundation\Bundle\Bundle;
|
||||||
use Symfony\Components\DependencyInjection\ContainerInterface;
|
use Symfony\Components\DependencyInjection\ContainerInterface;
|
||||||
use Symfony\Components\DependencyInjection\Loader\Loader;
|
use Symfony\Components\DependencyInjection\Loader\Loader;
|
||||||
use Symfony\Components\DependencyInjection\Loader\XmlFileLoader;
|
use Symfony\Components\DependencyInjection\Loader\XmlFileLoader;
|
||||||
@ -25,7 +25,7 @@ use Symfony\Framework\DoctrineBundle\DependencyInjection\DoctrineExtension;
|
|||||||
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
|
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
|
||||||
* @author Jonathan H. Wage <jonwage@gmail.com>
|
* @author Jonathan H. Wage <jonwage@gmail.com>
|
||||||
*/
|
*/
|
||||||
class Bundle extends BaseBundle
|
class DoctrineBundle extends Bundle
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Customizes the Container instance.
|
* Customizes the Container instance.
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace Symfony\Framework\DoctrineMigrationsBundle;
|
namespace Symfony\Framework\DoctrineMigrationsBundle;
|
||||||
|
|
||||||
use Symfony\Foundation\Bundle\Bundle as BaseBundle;
|
use Symfony\Foundation\Bundle\Bundle;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file is part of the Symfony framework.
|
* This file is part of the Symfony framework.
|
||||||
@ -21,6 +21,6 @@ use Symfony\Foundation\Bundle\Bundle as BaseBundle;
|
|||||||
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
|
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
|
||||||
* @author Jonathan H. Wage <jonwage@gmail.com>
|
* @author Jonathan H. Wage <jonwage@gmail.com>
|
||||||
*/
|
*/
|
||||||
class Bundle extends BaseBundle
|
class DoctrineMigrationsBundle extends Bundle
|
||||||
{
|
{
|
||||||
}
|
}
|
@ -2,13 +2,13 @@
|
|||||||
|
|
||||||
namespace Symfony\Framework\PropelBundle;
|
namespace Symfony\Framework\PropelBundle;
|
||||||
|
|
||||||
use Symfony\Foundation\Bundle\Bundle as BaseBundle;
|
use Symfony\Foundation\Bundle\Bundle;
|
||||||
use Symfony\Components\DependencyInjection\ContainerInterface;
|
use Symfony\Components\DependencyInjection\ContainerInterface;
|
||||||
use Symfony\Components\DependencyInjection\Loader\Loader;
|
use Symfony\Components\DependencyInjection\Loader\Loader;
|
||||||
use Symfony\Components\DependencyInjection\Loader\XmlFileLoader;
|
use Symfony\Components\DependencyInjection\Loader\XmlFileLoader;
|
||||||
use Symfony\Framework\PropelBundle\DependencyInjection\PropelExtension;
|
use Symfony\Framework\PropelBundle\DependencyInjection\PropelExtension;
|
||||||
|
|
||||||
class Bundle extends BaseBundle
|
class PropelBundle extends Bundle
|
||||||
{
|
{
|
||||||
public function buildContainer(ContainerInterface $container)
|
public function buildContainer(ContainerInterface $container)
|
||||||
{
|
{
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace Symfony\Framework\SwiftmailerBundle;
|
namespace Symfony\Framework\SwiftmailerBundle;
|
||||||
|
|
||||||
use Symfony\Foundation\Bundle\Bundle as BaseBundle;
|
use Symfony\Foundation\Bundle\Bundle;
|
||||||
use Symfony\Components\DependencyInjection\ContainerInterface;
|
use Symfony\Components\DependencyInjection\ContainerInterface;
|
||||||
use Symfony\Components\DependencyInjection\Loader\Loader;
|
use Symfony\Components\DependencyInjection\Loader\Loader;
|
||||||
use Symfony\Framework\SwiftmailerBundle\DependencyInjection\SwiftmailerExtension;
|
use Symfony\Framework\SwiftmailerBundle\DependencyInjection\SwiftmailerExtension;
|
||||||
@ -23,7 +23,7 @@ use Symfony\Framework\SwiftmailerBundle\DependencyInjection\SwiftmailerExtension
|
|||||||
* @subpackage Framework_SwiftmailerBundle
|
* @subpackage Framework_SwiftmailerBundle
|
||||||
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
|
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
|
||||||
*/
|
*/
|
||||||
class Bundle extends BaseBundle
|
class SwiftmailerBundle extends Bundle
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Customizes the Container instance.
|
* Customizes the Container instance.
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace Symfony\Framework\TwigBundle;
|
namespace Symfony\Framework\TwigBundle;
|
||||||
|
|
||||||
use Symfony\Foundation\Bundle\Bundle as BaseBundle;
|
use Symfony\Foundation\Bundle\Bundle;
|
||||||
use Symfony\Components\DependencyInjection\ContainerInterface;
|
use Symfony\Components\DependencyInjection\ContainerInterface;
|
||||||
use Symfony\Components\DependencyInjection\Loader\Loader;
|
use Symfony\Components\DependencyInjection\Loader\Loader;
|
||||||
use Symfony\Components\DependencyInjection\Loader\XmlFileLoader;
|
use Symfony\Components\DependencyInjection\Loader\XmlFileLoader;
|
||||||
@ -25,7 +25,7 @@ use Symfony\Framework\TwigBundle\DependencyInjection\TwigExtension;
|
|||||||
* @subpackage Framework_TwigBundle
|
* @subpackage Framework_TwigBundle
|
||||||
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
|
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
|
||||||
*/
|
*/
|
||||||
class Bundle extends BaseBundle
|
class TwigBundle extends Bundle
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Customizes the Container instance.
|
* Customizes the Container instance.
|
@ -77,5 +77,7 @@ class InitBundleCommand extends Command
|
|||||||
'namespace' => $namespace,
|
'namespace' => $namespace,
|
||||||
'bundle' => $bundle,
|
'bundle' => $bundle,
|
||||||
));
|
));
|
||||||
|
|
||||||
|
rename($targetDir.'/Bundle.php', $targetDir.'/'.$bundle.'.php');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -112,7 +112,7 @@ class ControllerManager
|
|||||||
$logs[] = sprintf('Failed finding controller "%s:%s" from namespace "%s" (%s)', $bundle, $controller, $namespace, $try);
|
$logs[] = sprintf('Failed finding controller "%s:%s" from namespace "%s" (%s)', $bundle, $controller, $namespace, $try);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!in_array($namespace.'\\'.$bundle.'\\Bundle', array_map(function ($bundle) { return get_class($bundle); }, $this->container->getKernelService()->getBundles()))) {
|
if (!in_array($namespace.'\\'.$bundle.'\\'.$bundle, array_map(function ($bundle) { return get_class($bundle); }, $this->container->getKernelService()->getBundles()))) {
|
||||||
throw new \LogicException(sprintf('To use the "%s" controller, you first need to enable the Bundle "%s" in your Kernel class.', $try, $namespace.'\\'.$bundle));
|
throw new \LogicException(sprintf('To use the "%s" controller, you first need to enable the Bundle "%s" in your Kernel class.', $try, $namespace.'\\'.$bundle));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,12 +17,12 @@ class {{ class }}Kernel extends Kernel
|
|||||||
{
|
{
|
||||||
$bundles = array(
|
$bundles = array(
|
||||||
new Symfony\Foundation\Bundle\KernelBundle(),
|
new Symfony\Foundation\Bundle\KernelBundle(),
|
||||||
new Symfony\Framework\WebBundle\Bundle(),
|
new Symfony\Framework\WebBundle\WebBundle(),
|
||||||
|
|
||||||
// enable third-party bundles
|
// enable third-party bundles
|
||||||
new Symfony\Framework\ZendBundle\Bundle(),
|
new Symfony\Framework\ZendBundle\ZendBundle(),
|
||||||
new Symfony\Framework\DoctrineBundle\Bundle(),
|
new Symfony\Framework\DoctrineBundle\DoctrineBundle(),
|
||||||
new Symfony\Framework\SwiftmailerBundle\Bundle(),
|
new Symfony\Framework\SwiftmailerBundle\SwiftmailerBundle(),
|
||||||
|
|
||||||
// register your bundles here
|
// register your bundles here
|
||||||
);
|
);
|
||||||
|
@ -17,12 +17,12 @@ class {{ class }}Kernel extends Kernel
|
|||||||
{
|
{
|
||||||
$bundles = array(
|
$bundles = array(
|
||||||
new Symfony\Foundation\Bundle\KernelBundle(),
|
new Symfony\Foundation\Bundle\KernelBundle(),
|
||||||
new Symfony\Framework\WebBundle\Bundle(),
|
new Symfony\Framework\WebBundle\WebBundle(),
|
||||||
|
|
||||||
// enable third-party bundles
|
// enable third-party bundles
|
||||||
new Symfony\Framework\ZendBundle\Bundle(),
|
new Symfony\Framework\ZendBundle\ZendBundle(),
|
||||||
new Symfony\Framework\DoctrineBundle\Bundle(),
|
new Symfony\Framework\DoctrineBundle\DoctrineBundle(),
|
||||||
new Symfony\Framework\SwiftmailerBundle\Bundle(),
|
new Symfony\Framework\SwiftmailerBundle\SwiftmailerBundle(),
|
||||||
|
|
||||||
// register your bundles here
|
// register your bundles here
|
||||||
);
|
);
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
namespace {{ namespace }}\{{ bundle }};
|
namespace {{ namespace }}\{{ bundle }};
|
||||||
|
|
||||||
use Symfony\Foundation\Bundle\Bundle as BaseBundle;
|
use Symfony\Foundation\Bundle\Bundle;
|
||||||
use Symfony\Components\DependencyInjection\ContainerInterface;
|
use Symfony\Components\DependencyInjection\ContainerInterface;
|
||||||
|
|
||||||
class Bundle extends BaseBundle
|
class {{ bundle }} extends Bundle
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace Symfony\Framework\WebBundle;
|
namespace Symfony\Framework\WebBundle;
|
||||||
|
|
||||||
use Symfony\Foundation\Bundle\Bundle as BaseBundle;
|
use Symfony\Foundation\Bundle\Bundle;
|
||||||
use Symfony\Components\DependencyInjection\ContainerInterface;
|
use Symfony\Components\DependencyInjection\ContainerInterface;
|
||||||
use Symfony\Components\DependencyInjection\Loader\Loader;
|
use Symfony\Components\DependencyInjection\Loader\Loader;
|
||||||
use Symfony\Components\DependencyInjection\Loader\XmlFileLoader;
|
use Symfony\Components\DependencyInjection\Loader\XmlFileLoader;
|
||||||
@ -25,7 +25,7 @@ use Symfony\Framework\WebBundle\DependencyInjection\WebExtension;
|
|||||||
* @subpackage Framework_WebBundle
|
* @subpackage Framework_WebBundle
|
||||||
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
|
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
|
||||||
*/
|
*/
|
||||||
class Bundle extends BaseBundle
|
class WebBundle extends Bundle
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Customizes the Container instance.
|
* Customizes the Container instance.
|
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace Symfony\Framework\ZendBundle;
|
namespace Symfony\Framework\ZendBundle;
|
||||||
|
|
||||||
use Symfony\Foundation\Bundle\Bundle as BaseBundle;
|
use Symfony\Foundation\Bundle\Bundle;
|
||||||
use Symfony\Components\DependencyInjection\ContainerInterface;
|
use Symfony\Components\DependencyInjection\ContainerInterface;
|
||||||
use Symfony\Components\DependencyInjection\Reference;
|
use Symfony\Components\DependencyInjection\Reference;
|
||||||
use Symfony\Components\DependencyInjection\Loader\Loader;
|
use Symfony\Components\DependencyInjection\Loader\Loader;
|
||||||
@ -24,7 +24,7 @@ use Symfony\Framework\ZendBundle\DependencyInjection\ZendExtension;
|
|||||||
* @subpackage Framework_ZendBundle
|
* @subpackage Framework_ZendBundle
|
||||||
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
|
* @author Fabien Potencier <fabien.potencier@symfony-project.com>
|
||||||
*/
|
*/
|
||||||
class Bundle extends BaseBundle
|
class ZendBundle extends Bundle
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Customizes the Container instance.
|
* Customizes the Container instance.
|
Reference in New Issue
Block a user