[TASK] Separate ext:statictemplates code from core
[Packages/TYPO3.CMS.git] / typo3 / sysext / core / Classes / Utility / ExtensionManagementUtility.php
index f44ec52..13262df 100644 (file)
@@ -4,7 +4,7 @@ namespace TYPO3\CMS\Core\Utility;
 /***************************************************************
  *  Copyright notice
  *
- *  (c) 1999-2011 Kasper Skårhøj (kasperYYYY@typo3.com)
+ *  (c) 1999-2013 Kasper Skårhøj (kasperYYYY@typo3.com)
  *  All rights reserved
  *
  *  This script is part of the TYPO3 project. The TYPO3 project is
@@ -1288,7 +1288,6 @@ tt_content.' . $key . $prefix . ' {
 
        /**
         * Call this method to add an entry in the static template list found in sys_templates
-        * "static template files" are the modern equivalent (provided from extensions) to the traditional records in "static_templates"
         * FOR USE IN ext_localconf.php FILES
         *
         * @param string $extKey Is of course the extension key
@@ -1570,20 +1569,22 @@ tt_content.' . $key . $prefix . ' {
                $phpCodeToCache[] = '';
                // Iterate through loaded extensions and add ext_localconf content
                foreach ($extensionInformation as $extensionKey => $extensionDetails) {
-                       // Include a header per extension to make the cache file more readable
-                       $phpCodeToCache[] = '/**';
-                       $phpCodeToCache[] = ' * Extension: ' . $extensionKey;
-                       $phpCodeToCache[] = ' * File: ' . $extensionDetails['ext_localconf.php'];
-                       $phpCodeToCache[] = ' */';
-                       $phpCodeToCache[] = '';
-                       // Set $_EXTKEY and $_EXTCONF for this extension
-                       $phpCodeToCache[] = '$_EXTKEY = \'' . $extensionKey . '\';';
-                       $phpCodeToCache[] = '$_EXTCONF = $GLOBALS[\'TYPO3_CONF_VARS\'][\'EXT\'][\'extConf\'][$_EXTKEY];';
-                       $phpCodeToCache[] = '';
-                       // Add ext_localconf.php content of extension
-                       $phpCodeToCache[] = trim(\TYPO3\CMS\Core\Utility\GeneralUtility::getUrl($extensionDetails['ext_localconf.php']));
-                       $phpCodeToCache[] = '';
-                       $phpCodeToCache[] = '';
+                       if (isset($extensionDetails['ext_localconf.php']) && $extensionDetails['ext_localconf.php']) {
+                               // Include a header per extension to make the cache file more readable
+                               $phpCodeToCache[] = '/**';
+                               $phpCodeToCache[] = ' * Extension: ' . $extensionKey;
+                               $phpCodeToCache[] = ' * File: ' . $extensionDetails['ext_localconf.php'];
+                               $phpCodeToCache[] = ' */';
+                               $phpCodeToCache[] = '';
+                               // Set $_EXTKEY and $_EXTCONF for this extension
+                               $phpCodeToCache[] = '$_EXTKEY = \'' . $extensionKey . '\';';
+                               $phpCodeToCache[] = '$_EXTCONF = $GLOBALS[\'TYPO3_CONF_VARS\'][\'EXT\'][\'extConf\'][$_EXTKEY];';
+                               $phpCodeToCache[] = '';
+                               // Add ext_localconf.php content of extension
+                               $phpCodeToCache[] = trim(\TYPO3\CMS\Core\Utility\GeneralUtility::getUrl($extensionDetails['ext_localconf.php']));
+                               $phpCodeToCache[] = '';
+                               $phpCodeToCache[] = '';
+                       }
                }
                $phpCodeToCache = implode(LF, $phpCodeToCache);
                // Remove all start and ending php tags from content
@@ -1760,21 +1761,23 @@ tt_content.' . $key . $prefix . ' {
                $phpCodeToCache[] = '';
                // Iterate through loaded extensions and add ext_tables content
                foreach ($extensionInformation as $extensionKey => $extensionDetails) {
-                       // Include a header per extension to make the cache file more readable
-                       $phpCodeToCache[] = '/**';
-                       $phpCodeToCache[] = ' * Extension: ' . $extensionKey;
-                       $phpCodeToCache[] = ' * File: ' . $extensionDetails['ext_tables.php'];
-                       $phpCodeToCache[] = ' */';
-                       $phpCodeToCache[] = '';
-                       // Set $_EXTKEY and $_EXTCONF for this extension
-                       $phpCodeToCache[] = '$_EXTKEY = \'' . $extensionKey . '\';';
-                       $phpCodeToCache[] = '$_EXTCONF = $GLOBALS[\'TYPO3_CONF_VARS\'][\'EXT\'][\'extConf\'][$_EXTKEY];';
-                       $phpCodeToCache[] = '';
-                       // Add ext_tables.php content of extension
-                       $phpCodeToCache[] = trim(\TYPO3\CMS\Core\Utility\GeneralUtility::getUrl($extensionDetails['ext_tables.php']));
-                       $phpCodeToCache[] = '';
-                       $phpCodeToCache[] = '\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::loadNewTcaColumnsConfigFiles();';
-                       $phpCodeToCache[] = '';
+                       if (isset($extensionDetails['ext_tables.php']) && $extensionDetails['ext_tables.php']) {
+                               // Include a header per extension to make the cache file more readable
+                               $phpCodeToCache[] = '/**';
+                               $phpCodeToCache[] = ' * Extension: ' . $extensionKey;
+                               $phpCodeToCache[] = ' * File: ' . $extensionDetails['ext_tables.php'];
+                               $phpCodeToCache[] = ' */';
+                               $phpCodeToCache[] = '';
+                               // Set $_EXTKEY and $_EXTCONF for this extension
+                               $phpCodeToCache[] = '$_EXTKEY = \'' . $extensionKey . '\';';
+                               $phpCodeToCache[] = '$_EXTCONF = $GLOBALS[\'TYPO3_CONF_VARS\'][\'EXT\'][\'extConf\'][$_EXTKEY];';
+                               $phpCodeToCache[] = '';
+                               // Add ext_tables.php content of extension
+                               $phpCodeToCache[] = trim(\TYPO3\CMS\Core\Utility\GeneralUtility::getUrl($extensionDetails['ext_tables.php']));
+                               $phpCodeToCache[] = '';
+                               $phpCodeToCache[] = '\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::loadNewTcaColumnsConfigFiles();';
+                               $phpCodeToCache[] = '';
+                       }
                }
                $phpCodeToCache = implode(LF, $phpCodeToCache);
                // Remove all start and ending php tags from content