[BUGFIX] autoloader should ignore non existing extensions
authorGeorg Ringer <mail@ringerge.org>
Thu, 9 Aug 2012 13:56:08 +0000 (15:56 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Tue, 14 Aug 2012 20:52:42 +0000 (22:52 +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: I79e34758617675957c732bbd533302adbb2edab0
Resolves: #39649
Releases: 6.0, 4.7, 4.6
Reviewed-on: http://review.typo3.org/13541
Tested-by: Philipp Gampe
Reviewed-by: Stefan Neufeind
Reviewed-by: Oliver Klee
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
t3lib/class.t3lib_autoloader.php

index 6148e42..3ebc891 100644 (file)
@@ -208,9 +208,13 @@ class t3lib_autoloader {
                        // At this point during bootstrap the local configuration is initialized,
                        // extMgm is ready to get the list of enabled extensions
                foreach (t3lib_extMgm::getLoadedExtensionListArray() 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;