Project

General

Profile

Bug #24638 » 17114.diff

Administrator Admin, 2011-01-18 18:00

View differences:

typo3/sysext/em/classes/connection/class.tx_em_connection_extdirectserver.php (working copy)
* @author Steffen Kamper <info@sk-typo3.de>
*/
require_once(PATH_typo3 . 'template.php');
class tx_em_Connection_ExtDirectServer {
/**
typo3/sysext/install/updates/class.tx_coreupdates_installsysexts.php (working copy)
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');
// Create other instances needed by the EM connection
$this->extensionManagerConnection->extensionList = t3lib_div::makeInstance('tx_em_Extensions_List');
$this->extensionManagerConnection->extensionDetails = t3lib_div::makeInstance('tx_em_Extensions_Details');
}
/**
* Checks if an update is needed
*
......
* @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.
......
*
* @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'])) {
......
*
* @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;
(1-1/3)