Prechádzať zdrojové kódy

Revert "Renamed Bundle classes to be named like the bundle itself for more clarity"

This reverts commit c486e1ba10056b5cd7d1a626b423eb77ce9a5cc9.
Fabien Potencier 15 rokov pred
rodič
commit
fd8505377b

+ 2 - 2
src/Symfony/Framework/DoctrineBundle/DoctrineBundle.php

@@ -2,7 +2,7 @@
 
 namespace Symfony\Framework\DoctrineBundle;
 
-use Symfony\Foundation\Bundle\Bundle;
+use Symfony\Foundation\Bundle\Bundle as BaseBundle;
 use Symfony\Components\DependencyInjection\ContainerInterface;
 use Symfony\Components\DependencyInjection\Loader\Loader;
 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     Jonathan H. Wage <jonwage@gmail.com>
  */
-class DoctrineBundle extends Bundle
+class Bundle extends BaseBundle
 {
     /**
      * Customizes the Container instance.

+ 2 - 2
src/Symfony/Framework/DoctrineMigrationsBundle/DoctrineMigrationsBundle.php

@@ -2,7 +2,7 @@
 
 namespace Symfony\Framework\DoctrineMigrationsBundle;
 
-use Symfony\Foundation\Bundle\Bundle;
+use Symfony\Foundation\Bundle\Bundle as BaseBundle;
 
 /*
  * This file is part of the Symfony framework.
@@ -21,6 +21,6 @@ use Symfony\Foundation\Bundle\Bundle;
  * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
  * @author     Jonathan H. Wage <jonwage@gmail.com>
  */
-class DoctrineMigrationsBundle extends Bundle
+class Bundle extends BaseBundle
 {
 }

+ 2 - 2
src/Symfony/Framework/PropelBundle/PropelBundle.php

@@ -2,13 +2,13 @@
 
 namespace Symfony\Framework\PropelBundle;
 
-use Symfony\Foundation\Bundle\Bundle;
+use Symfony\Foundation\Bundle\Bundle as BaseBundle;
 use Symfony\Components\DependencyInjection\ContainerInterface;
 use Symfony\Components\DependencyInjection\Loader\Loader;
 use Symfony\Components\DependencyInjection\Loader\XmlFileLoader;
 use Symfony\Framework\PropelBundle\DependencyInjection\PropelExtension;
 
-class PropelBundle extends Bundle
+class Bundle extends BaseBundle
 {
     public function buildContainer(ContainerInterface $container)
     {

+ 2 - 2
src/Symfony/Framework/SwiftmailerBundle/SwiftmailerBundle.php

@@ -2,7 +2,7 @@
 
 namespace Symfony\Framework\SwiftmailerBundle;
 
-use Symfony\Foundation\Bundle\Bundle;
+use Symfony\Foundation\Bundle\Bundle as BaseBundle;
 use Symfony\Components\DependencyInjection\ContainerInterface;
 use Symfony\Components\DependencyInjection\Loader\Loader;
 use Symfony\Framework\SwiftmailerBundle\DependencyInjection\SwiftmailerExtension;
@@ -23,7 +23,7 @@ use Symfony\Framework\SwiftmailerBundle\DependencyInjection\SwiftmailerExtension
  * @subpackage Framework_SwiftmailerBundle
  * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
  */
-class SwiftmailerBundle extends Bundle
+class Bundle extends BaseBundle
 {
     /**
      * Customizes the Container instance.

+ 2 - 2
src/Symfony/Framework/TwigBundle/TwigBundle.php

@@ -2,7 +2,7 @@
 
 namespace Symfony\Framework\TwigBundle;
 
-use Symfony\Foundation\Bundle\Bundle;
+use Symfony\Foundation\Bundle\Bundle as BaseBundle;
 use Symfony\Components\DependencyInjection\ContainerInterface;
 use Symfony\Components\DependencyInjection\Loader\Loader;
 use Symfony\Components\DependencyInjection\Loader\XmlFileLoader;
@@ -25,7 +25,7 @@ use Symfony\Framework\TwigBundle\DependencyInjection\TwigExtension;
  * @subpackage Framework_TwigBundle
  * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
  */
-class TwigBundle extends Bundle
+class Bundle extends BaseBundle
 {
     /**
      * Customizes the Container instance.

+ 2 - 2
src/Symfony/Framework/WebBundle/WebBundle.php

@@ -2,7 +2,7 @@
 
 namespace Symfony\Framework\WebBundle;
 
-use Symfony\Foundation\Bundle\Bundle;
+use Symfony\Foundation\Bundle\Bundle as BaseBundle;
 use Symfony\Components\DependencyInjection\ContainerInterface;
 use Symfony\Components\DependencyInjection\Loader\Loader;
 use Symfony\Components\DependencyInjection\Loader\XmlFileLoader;
@@ -25,7 +25,7 @@ use Symfony\Framework\WebBundle\DependencyInjection\WebExtension;
  * @subpackage Framework_WebBundle
  * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
  */
-class WebBundle extends Bundle
+class Bundle extends BaseBundle
 {
     /**
      * Customizes the Container instance.

+ 0 - 2
src/Symfony/Framework/WebBundle/Command/InitBundleCommand.php

@@ -77,7 +77,5 @@ class InitBundleCommand extends Command
             'namespace' => $namespace,
             'bundle'    => $bundle,
         ));
-
-        rename($targetDir.'/Bundle.php', $targetDir.'/'.$bundle.'.php');
     }
 }

+ 1 - 1
src/Symfony/Framework/WebBundle/Controller/ControllerManager.php

@@ -112,7 +112,7 @@ class ControllerManager
                     $logs[] = sprintf('Failed finding controller "%s:%s" from namespace "%s" (%s)', $bundle, $controller, $namespace, $try);
                 }
             } 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));
                 }
 

+ 4 - 4
src/Symfony/Framework/WebBundle/Resources/skeleton/application/xml/Kernel.php

@@ -17,12 +17,12 @@ class {{ class }}Kernel extends Kernel
     {
         $bundles = array(
             new Symfony\Foundation\Bundle\KernelBundle(),
-            new Symfony\Framework\WebBundle\WebBundle(),
+            new Symfony\Framework\WebBundle\Bundle(),
 
             // enable third-party bundles
-            new Symfony\Framework\ZendBundle\ZendBundle(),
-            new Symfony\Framework\DoctrineBundle\DoctrineBundle(),
-            new Symfony\Framework\SwiftmailerBundle\SwiftmailerBundle(),
+            new Symfony\Framework\ZendBundle\Bundle(),
+            new Symfony\Framework\DoctrineBundle\Bundle(),
+            new Symfony\Framework\SwiftmailerBundle\Bundle(),
 
             // register your bundles here
         );

+ 4 - 4
src/Symfony/Framework/WebBundle/Resources/skeleton/application/yaml/Kernel.php

@@ -17,12 +17,12 @@ class {{ class }}Kernel extends Kernel
     {
         $bundles = array(
             new Symfony\Foundation\Bundle\KernelBundle(),
-            new Symfony\Framework\WebBundle\WebBundle(),
+            new Symfony\Framework\WebBundle\Bundle(),
 
             // enable third-party bundles
-            new Symfony\Framework\ZendBundle\ZendBundle(),
-            new Symfony\Framework\DoctrineBundle\DoctrineBundle(),
-            new Symfony\Framework\SwiftmailerBundle\SwiftmailerBundle(),
+            new Symfony\Framework\ZendBundle\Bundle(),
+            new Symfony\Framework\DoctrineBundle\Bundle(),
+            new Symfony\Framework\SwiftmailerBundle\Bundle(),
 
             // register your bundles here
         );

+ 2 - 2
src/Symfony/Framework/WebBundle/Resources/skeleton/bundle/Bundle.php

@@ -2,9 +2,9 @@
 
 namespace {{ namespace }}\{{ bundle }};
 
-use Symfony\Foundation\Bundle\Bundle;
+use Symfony\Foundation\Bundle\Bundle as BaseBundle;
 use Symfony\Components\DependencyInjection\ContainerInterface;
 
-class {{ bundle }} extends Bundle
+class Bundle extends BaseBundle
 {
 }

+ 2 - 2
src/Symfony/Framework/ZendBundle/ZendBundle.php

@@ -2,7 +2,7 @@
 
 namespace Symfony\Framework\ZendBundle;
 
-use Symfony\Foundation\Bundle\Bundle;
+use Symfony\Foundation\Bundle\Bundle as BaseBundle;
 use Symfony\Components\DependencyInjection\ContainerInterface;
 use Symfony\Components\DependencyInjection\Reference;
 use Symfony\Components\DependencyInjection\Loader\Loader;
@@ -24,7 +24,7 @@ use Symfony\Framework\ZendBundle\DependencyInjection\ZendExtension;
  * @subpackage Framework_ZendBundle
  * @author     Fabien Potencier <fabien.potencier@symfony-project.com>
  */
-class ZendBundle extends Bundle
+class Bundle extends BaseBundle
 {
     /**
      * Customizes the Container instance.