Index: typo3/sysext/em/classes/connection/class.tx_em_connection_extdirectserver.php =================================================================== --- typo3/sysext/em/classes/connection/class.tx_em_connection_extdirectserver.php (revision 10120) +++ typo3/sysext/em/classes/connection/class.tx_em_connection_extdirectserver.php (revision ) @@ -71,10 +71,15 @@ /** * Constructor * + * @param boolean $createTemplateInstance: set to FALSE if no instance of template class needs to be created * @return void */ - public function __construct() { + public function __construct($createTemplateInstance = TRUE) { + // Create an instance of template class only if necessary + // It is necessary only if extension configuration is to be displayed + if ($createTemplateInstance) { - $this->template = t3lib_div::makeInstance('template'); + $this->template = t3lib_div::makeInstance('template'); + } $this->globalSettings = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['em']); } Index: typo3/sysext/install/updates/class.tx_coreupdates_installsysexts.php =================================================================== --- typo3/sysext/install/updates/class.tx_coreupdates_installsysexts.php (revision 10120) +++ typo3/sysext/install/updates/class.tx_coreupdates_installsysexts.php (revision ) @@ -37,7 +37,23 @@ class tx_coreupdates_installsysexts extends Tx_Install_Updates_Base { protected $title = 'Install Outsourced System Extensions'; protected $newSystemExtensions = array('info', 'perm', 'func', 'filelist', 'about', 'cshmanual', 'feedit', 'opendocs', 'simulatestatic'); + /** + * Instance of the EM connection class, used to install new extensions + * + * @var tx_em_Connection_ExtDirectServer + */ + protected $extensionManagerConnection; + public function __construct() { + // Create an instance of language, if necessary. + // Needed in order to make the em_index work + if (!isset($GLOBALS['LANG'])) { + $GLOBALS['LANG'] = t3lib_div::makeInstance('language'); + $GLOBALS['LANG']->csConvObj = t3lib_div::makeInstance('t3lib_cs'); + } + // Create an instance of a connection class to the EM + $this->extensionManagerConnection = t3lib_div::makeInstance('tx_em_Connection_ExtDirectServer', FALSE); + } /** * Checks if an update is needed * @@ -179,24 +195,33 @@ * @return boolean whether it worked (true) or not (false) */ public function performUpdate(&$dbQueries, &$customMessages) { - $result = false; + $result = FALSE; - // Get extension keys that were submitted by the used to be installed and that are valid for this update wizard: + // Get extension keys that were submitted by the used to be installed and that are valid for this update wizard: if (is_array($this->pObj->INSTALL['update']['installSystemExtensions']['sysext'])) { $extArray = array_intersect( $this->newSystemExtensions, array_keys($this->pObj->INSTALL['update']['installSystemExtensions']['sysext']) ); - $extList = $this->addExtToList($extArray); - if ($extList) { - $this->writeNewExtensionList($extList); - $result = true; + foreach ($extArray as $extensionKey) { + $this->installExtension($extensionKey); } + $result = TRUE; } return $result; } + /** + * This method can be called to install an extension following all proper processes + * (e.g. installing in both extList and extList_FE, respecting priority, etc.) + * + * @param string $extensionKey Key of the extension to install + * @return void + */ + protected function installExtension($extensionKey) { + $this->extensionManagerConnection->enableExtension($extensionKey); + } /** * Adds extension to extension list and returns new list. If -1 is returned, an error happend. @@ -204,8 +229,10 @@ * * @param array Extension keys to add * @return string New list of installed extensions or -1 if error + * @deprecated since TYPO3 4.5, will be removed in TYPO3 4.7 - Should not be needed anymore. Extension should be installed directly by calling tx_coreupdates_installsysexts::installExtension() */ function addExtToList(array $extKeys) { + self::logDeprecatedFunction(); // Get list of installed extensions and add this one. $tmpLoadedExt = $GLOBALS['TYPO3_LOADED_EXT']; if (isset($tmpLoadedExt['_CACHEFILE'])) { @@ -226,8 +253,10 @@ * * @param string List of extensions * @return void + * @deprecated since TYPO3 4.5, will be removed in TYPO3 4.7 - Use tx_coreupdates_installsysexts::installExtension() instead (one call per extension to install) */ - protected function writeNewExtensionList($newExtList) { + protected function writeNewExtensionList($newExtList) { + self::logDeprecatedFunction(); // Instance of install tool $instObj = new t3lib_install; $instObj->allowUpdateLocalConf = 1; @@ -242,4 +271,4 @@ t3lib_extMgm::removeCacheFiles(); } } -?> \ No newline at end of file +?>