[BUGFIX] Loaded Extensions in ExtensionCompatibilityTester 20/24820/4
authorAlexander Stehlik <alexander.stehlik@googlemail.com>
Tue, 15 Oct 2013 21:16:22 +0000 (23:16 +0200)
committerMarkus Klein <klein.t3@mfc-linz.at>
Wed, 16 Oct 2013 12:02:38 +0000 (14:02 +0200)
Remove the obsolete call to loadTypo3LoadedExtensionInformation() and
read the loaded Extensions from the TYPO3_LOADED_EXT global.

Additionally the array type hints are replaced with the ArrayAccess
interface since the LoadedExtensionsArray returns instances of
LoadedExtensionArrayElement which implements that interface.

Resolves: #52866
Releases: 6.2
Change-Id: I40db793f2c35b50636c8411aa7a141efc3c90320
Reviewed-on: https://review.typo3.org/24820
Reviewed-by: Wouter Wolters
Tested-by: Wouter Wolters
Reviewed-by: Thomas Maroschik
Tested-by: Thomas Maroschik
Reviewed-by: Markus Klein
Tested-by: Markus Klein
typo3/sysext/install/Classes/Controller/Action/Ajax/ExtensionCompatibilityTester.php

index b319b50..bd375e1 100644 (file)
@@ -98,8 +98,6 @@ class ExtensionCompatibilityTester extends Action\AbstractAction implements Acti
         */
        protected function getExtensionsToLoad() {
                $extensionsToLoad = array();
-               //TODO: FIXME
-               $GLOBALS['TYPO3_LOADED_EXT'] = Utility\ExtensionManagementUtility::loadTypo3LoadedExtensionInformation(FALSE);
                $extensionsToExclude = $this->getExtensionsToExclude();
                foreach ($GLOBALS['TYPO3_LOADED_EXT'] as $key => $extension) {
                        if (!in_array($key, $extensionsToExclude)) {
@@ -148,10 +146,10 @@ class ExtensionCompatibilityTester extends Action\AbstractAction implements Acti
         * the original bootstrap method.
         *
         * @param string $extensionKey
-        * @param array $extension
+        * @param \ArrayAccess $extension
         * @return void
         */
-       protected function loadExtTablesForExtension($extensionKey, array $extension) {
+       protected function loadExtTablesForExtension($extensionKey, \ArrayAccess $extension) {
                // In general it is recommended to not rely on it to be globally defined in that
                // scope, but we can not prohibit this without breaking backwards compatibility
                global $T3_SERVICES, $T3_VAR, $TYPO3_CONF_VARS;
@@ -160,7 +158,7 @@ class ExtensionCompatibilityTester extends Action\AbstractAction implements Acti
                global $_EXTKEY;
                // Load each ext_tables.php file of loaded extensions
                $_EXTKEY = $extensionKey;
-               if (is_array($extension) && $extension['ext_tables.php']) {
+               if (isset($extension['ext_tables.php']) && $extension['ext_tables.php']) {
                        // $_EXTKEY and $_EXTCONF are available in ext_tables.php
                        // and are explicitly set in cached file as well
                        $_EXTCONF = $GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$_EXTKEY];
@@ -174,17 +172,17 @@ class ExtensionCompatibilityTester extends Action\AbstractAction implements Acti
         * the original bootstrap method.
         *
         * @param string $extensionKey
-        * @param array $extension
+        * @param \ArrayAccess $extension
         * @return void
         */
-       protected function loadExtLocalconfForExtension($extensionKey, array $extension) {
+       protected function loadExtLocalconfForExtension($extensionKey, \ArrayAccess $extension) {
                // This is the main array meant to be manipulated in the ext_localconf.php files
                // In general it is recommended to not rely on it to be globally defined in that
                // scope but to use $GLOBALS['TYPO3_CONF_VARS'] instead.
                // Nevertheless we define it here as global for backwards compatibility.
                global $TYPO3_CONF_VARS;
                $_EXTKEY = $extensionKey;
-               if (is_array($extension) && $extension['ext_localconf.php']) {
+               if (isset($extension['ext_localconf.php']) && $extension['ext_localconf.php']) {
                        // $_EXTKEY and $_EXTCONF are available in ext_localconf.php
                        // and are explicitly set in cached file as well
                        $_EXTCONF = $GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$_EXTKEY];