Explorar el Código

updated bootstrap.php

Fabien Potencier hace 14 años
padre
commit
dacb25f13a
Se han modificado 1 ficheros con 4 adiciones y 4 borrados
  1. 4 4
      src/Symfony/Component/HttpKernel/bootstrap.php

+ 4 - 4
src/Symfony/Component/HttpKernel/bootstrap.php

@@ -705,11 +705,11 @@ abstract class Kernel implements KernelInterface
         $this->bundleMap = array();
         foreach ($this->registerBundles() as $bundle) {
             $name = $bundle->getName();
-            $this->bundles[$name] = $bundle;
-            if (!isset($this->bundleMap[$name])) {
-                $this->bundleMap[$name] = array();
+            if (isset($this->bundles[$name])) {
+                throw new \LogicException(sprintf('Trying to register two bundles with the same name "%s"', $name));
             }
-            $this->bundleMap[$name][] = $bundle;
+            $this->bundles[$name] = $bundle;
+            $this->bundleMap[$name] = array($bundle);
         }
                 $extended = array();
         foreach ($this->bundles as $name => $bundle) {