[BUGFIX] Fatal error is thrown when more drivers are registered
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Classes / Resource / Driver / DriverRegistry.php
index fd127e5..25dadbf 100644 (file)
@@ -74,7 +74,12 @@ class DriverRegistry implements \TYPO3\CMS\Core\SingletonInterface {
                        $shortName = $className;
                }
                if (array_key_exists($shortName, $this->drivers)) {
-                       throw new \InvalidArgumentException('Driver ' . $shortName . ' is already registered.', 1314979451);
+                               // Return immediately without changing configuration
+                       if ($this->drivers[$shortName] === $className) {
+                               return TRUE;
+                       } else {
+                               throw new \InvalidArgumentException('Driver ' . $shortName . ' is already registered.', 1314979451);
+                       }
                }
                $this->drivers[$shortName] = $className;
                $this->driverConfigurations[$shortName] = array(