/** * (non-PHPdoc) * @see \OatBox\Common\ScriptRunner::run() */ public function run() { $service = UpdateService::getInstance(); $extManifests = $service->getUpdateManifests(); $releaseManifest = $service->getReleaseManifest(); $oldRootPath = $releaseManifest['old_root_path']; foreach ($extManifests as $ext => $update) { Logger::t('Moving Folder ' . $ext); File::move($oldRootPath . $ext, DIR_DATA . 'old/' . $ext, false); } $rootFiles = array('.htaccess', 'index.php', 'favicon.ico', 'fdl-1.3.txt', 'gpl-2.0.txt', 'license', 'version', 'readme.txt'); foreach ($rootFiles as $file) { if (is_file($oldRootPath . $file)) { Logger::t('Moving File ' . $file); File::move($oldRootPath . $file, DIR_DATA . 'old/' . $file, false); } else { Logger::w('File not found : ' . $file); } } }
public function run() { $this->out('Move File back'); File::move(DIR_DATA . 'old/', $this->getOldRootPath()); mkdir(DIR_DATA . 'old/'); }
/** * * @access * @author "Lionel Lecaque, <*****@*****.**>" * @param unknown $ext * @return boolean */ public function unShield($ext) { $releaseManifest = $this->getReleaseManifest(); $extFolder = $releaseManifest['old_root_path'] . $ext; if (!is_file($extFolder . '/htaccess.1')) { Logger::d('Previous lock, htaccess.1 do not exits something new extension'); return true; } if (unlink($extFolder . '/.htaccess')) { return File::move($extFolder . '/htaccess.1', $extFolder . '/.htaccess', false); } else { Logger::e('Fail to remove htaccess in ' . $ext . ' . You may copy by hand file htaccess.1'); return false; } }