[BUGFIX] autoloader should ignore non existing extensions
authorGeorg Ringer <mail@ringerge.org>
Thu, 9 Aug 2012 13:56:08 +0000 (15:56 +0200)
committerGeorg Ringer <georg.ringer@gmail.com>
Fri, 21 Sep 2012 09:11:51 +0000 (11:11 +0200)
When building the core registry a call to t3lib_extMgm::extPath() is done
for every extension of the LocalConfiguration/localconf.php
Sometimes the extension is not installed anymore which was never a problem
in earlier versions.

The change catches the exception and ignores this extension when building
the registry.

Change-Id: I3b358bcd6aa9311460ece3c8cb845a2a6cb0a36a
Resolves: #39649
Releases: 6.0, 4.7, 4.6
Reviewed-on: http://review.typo3.org/13892
Reviewed-by: Georg Ringer
Tested-by: Georg Ringer
t3lib/class.t3lib_autoloader.php

index ab41c11..271a870 100644 (file)
@@ -164,13 +164,18 @@ class t3lib_autoloader {
         */
        protected static function createCoreAndExtensionRegistry() {
                $classRegistry = require(PATH_t3lib . 'core_autoload.php');
+
                        // At this point localconf.php was already initialized
                        // we have a current extList and extMgm is also known
                $loadedExtensions = array_unique(t3lib_div::trimExplode(',', t3lib_extMgm::getEnabledExtensionList(), TRUE));
                foreach ($loadedExtensions as $extensionKey) {
-                       $extensionAutoloadFile = t3lib_extMgm::extPath($extensionKey, 'ext_autoload.php');
-                       if (file_exists($extensionAutoloadFile)) {
-                               $classRegistry = array_merge($classRegistry, require($extensionAutoloadFile));
+                       try {
+                               $extensionAutoloadFile = t3lib_extMgm::extPath($extensionKey, 'ext_autoload.php');
+                               if (@file_exists($extensionAutoloadFile)) {
+                                       $classRegistry = array_merge($classRegistry, require($extensionAutoloadFile));
+                               }
+                       } catch (BadFunctionCallException $e) {
+                               // The extension is not available, therefore ignore it
                        }
                }
                return $classRegistry;