/**
  * Writes the extension list to "localconf.php" file
  * Removes the temp_CACHED* files before return.
  *
  * @param	string		List of extensions
  * @return	void
  * @deprecated since TYPO3 4.5, will be removed in TYPO3 4.7 - Use Tx_Install_Updates_Base::installExtensions() instead
  */
 protected function writeNewExtensionList($newExtList)
 {
     t3lib_div::logDeprecatedFunction();
     // Instance of install tool
     $instObj = new t3lib_install();
     $instObj->allowUpdateLocalConf = 1;
     $instObj->updateIdentity = 'TYPO3 Core Update Manager';
     // Get lines from localconf file
     $lines = $instObj->writeToLocalconf_control();
     $instObj->setValueInLocalconfFile($lines, '$TYPO3_CONF_VARS[\'EXT\'][\'extList\']', $newExtList);
     $instObj->writeToLocalconf_control($lines);
     $GLOBALS['TYPO3_CONF_VARS']['EXT']['extList'] = $newExtList;
     t3lib_extMgm::removeCacheFiles();
 }
 /**
  * Removes TinyMCE gzip cache files and TYPO3 cache files.
  *
  * @return	void
  */
 function removeCachedFiles()
 {
     $path = PATH_site . 'typo3temp/tinymce_rte/';
     if (is_dir($path)) {
         // Remove TinyMCE gzip cache files.
         $cfiles = t3lib_div::getFilesInDir($path);
         foreach ($cfiles as $cfile) {
             if (preg_match('/tiny_mce_\\w{32}\\.gz/', $cfile)) {
                 @unlink($path . $cfile);
             }
         }
     }
     // Remove TYPO3 cache files.
     t3lib_extMgm::removeCacheFiles();
 }
 /**
  * Unlink (delete) typo3conf/temp_CACHED_*.php cache files
  *
  * @return	integer		The number of files deleted
  */
 function removeCacheFiles()
 {
     return t3lib_extMgm::removeCacheFiles();
 }
 /**
  * Updates the list of extensions.
  *
  * @param string $newExtList
  * @return void
  */
 protected function updateExtensionList($newExtList)
 {
     // Instance of install tool
     $instObj = t3lib_div::makeInstance('t3lib_install');
     $instObj->allowUpdateLocalConf = 1;
     $instObj->updateIdentity = 'TYPO3 Core Update Manager';
     try {
         // Get lines from localconf file
         $lines = $instObj->writeToLocalconf_control();
         $instObj->setValueInLocalconfFile($lines, '$TYPO3_CONF_VARS[\'EXT\'][\'extList\']', $newExtList);
         $result = $instObj->writeToLocalconf_control($lines);
         if ($result === 'nochange') {
             $message = 'DBAL was not loaded.';
             if (!@is_writable(PATH_typo3conf)) {
                 $message .= ' ' . PATH_typo3conf . ' is not writable!';
             }
             throw new Exception($message);
         }
         $GLOBALS['TYPO3_CONF_VARS']['EXT']['extList'] = $newExtList;
         // Make sure to get cache file for backend, not frontend
         $cacheFilePrefix = $GLOBALS['TYPO3_LOADED_EXT']['_CACHEFILE'];
         $GLOBALS['TYPO3_LOADED_EXT']['_CACHEFILE'] = str_replace('temp_CACHED_FE', 'temp_CACHED', $cacheFilePrefix);
         t3lib_extMgm::removeCacheFiles();
     } catch (Exception $e) {
         $header = 'Error';
         $message = $e->getMessage();
         t3lib_timeTrack::debug_typo3PrintError($header, $message, FALSE, t3lib_div::getIndpEnv('TYPO3_SITE_URL'));
         exit;
     }
 }
 /**
  * Writes the extension list to "localconf.php" file
  * Removes the temp_CACHED* files before return.
  *
  * @param	string		List of extensions
  * @return	void
  */
 function writeNewExtensionList($newExtList)
 {
     $strippedExtensionList = $this->stripNonFrontendExtensions($newExtList);
     // Instance of install tool
     $instObj = new t3lib_install();
     $instObj->allowUpdateLocalConf = 1;
     $instObj->updateIdentity = 'TYPO3 Extension Manager';
     // Get lines from localconf file
     $lines = $instObj->writeToLocalconf_control();
     $instObj->setValueInLocalconfFile($lines, '$TYPO3_CONF_VARS[\'EXT\'][\'extList\']', $newExtList);
     $instObj->setValueInLocalconfFile($lines, '$TYPO3_CONF_VARS[\'EXT\'][\'extList_FE\']', $strippedExtensionList);
     $instObj->writeToLocalconf_control($lines);
     $GLOBALS['TYPO3_CONF_VARS']['EXT']['extList'] = $newExtList;
     $GLOBALS['TYPO3_CONF_VARS']['EXT']['extList_FE'] = $strippedExtensionList;
     t3lib_extMgm::removeCacheFiles();
 }
 /**
  * Write back configuration
  *
  * @param array $extConf
  * @return void
  */
 protected function writeExtConf($extConf)
 {
     $install = new t3lib_install();
     $install->allowUpdateLocalConf = 1;
     $install->updateIdentity = 'Caretaker Instance installation';
     $lines = $install->writeToLocalconf_control();
     $install->setValueInLocalconfFile($lines, '$TYPO3_CONF_VARS[\'EXT\'][\'extConf\'][\'caretaker_instance\']', serialize($extConf));
     $install->writeToLocalconf_control($lines);
     t3lib_extMgm::removeCacheFiles();
 }
 /**
  * Generates update wizard
  *
  * @return void
  */
 function updateWizard()
 {
     global $TYPO3_CONF_VARS;
     // clear cache files
     t3lib_extMgm::removeCacheFiles();
     // generate new cache files and include them
     $GLOBALS['TYPO3_CONF_VARS']['EXT']['extCache'] = 1;
     $TYPO3_LOADED_EXT = t3lib_extMgm::typo3_loadExtensions();
     if ($TYPO3_LOADED_EXT['_CACHEFILE']) {
         require PATH_typo3conf . $TYPO3_LOADED_EXT['_CACHEFILE'] . '_ext_localconf.php';
     }
     // call wizard
     $action = $this->INSTALL['database_type'] ? $this->INSTALL['database_type'] : 'checkForUpdate';
     $this->updateWizard_parts($action);
     $this->output($this->outputWrapper($this->printAll()));
 }