public function runUpdate($fileList = array()) { $view = new \model\view_installer('updater'); $view->assign('version', $this->sysconfig->getSysVersion()); include \base_config::$baseDir . '/version.php'; $this->updateConfigKey('sysVersion', $afltrVersion); if (file_exists(\base_config::$updateCache)) { @unlink(\base_config::$updateCache); } $fileDeleteList = array('/inc/model/model_base.php', '/inc/model/dashcontainerbox.php', '/inc/lib/jquery/jquery-1.10.2.min.js'); foreach ($fileDeleteList as $fileDelete) { if (file_exists(\base_config::$baseDir . $fileDelete)) { @unlink(\base_config::$baseDir . $fileDelete); } } $file = new \model\file(); if (is_dir(base_config::$baseDir . '/inc/lib/lightbox')) { $file->deleteRecursive(base_config::$baseDir . '/inc/lib/lightbox'); } if (is_dir(base_config::$baseDir . '/inc/lib/jquery_ui')) { $file->deleteRecursive(base_config::$baseDir . '/inc/lib/jquery_ui'); } if (!file_exists(base_config::$uploadDir . '/banners')) { mkdir(base_config::$uploadDir . '/banners'); } $this->createConfigKey('timeZone', 'Europe/Berlin'); $newVersion = $this->dbconnection->select("config", "config_value", "config_key LIKE 'sysVersion'"); \messages::registerMessage(\language::returnLanguageConstant('UPDATE_SUCCESS'), true); $view->assign('newVersion', $newVersion[0]['config_value']); $view->assign('fileList', $fileList); $view->render(); }
public function process() { if (!parent::process()) { $this->redirectNoSession(true); } @unlink(\base_config::$updateCache); $fileList = array(); $updateFileName = $this->getRequestVar('file'); if (!is_null($updateFileName)) { $fileName = base64_decode($updateFileName); $updateFile = new \model\file(); if ($updateFile->downloadPackage($fileName) && $updateFile->unzipPackage(basename($fileName), $fileList)) { $updateFile->copyRecursive(\base_config::$updateFolder . 'affiliat_r/', \base_config::$baseDir); $updateFile->deleteRecursive(\base_config::$updateFolder . 'affiliat_r/'); @unlink(\base_config::$updateFolder . basename($fileName)); } } $update = new \updateclass($this->dbconnection, $this->sysconfig); $update->runUpdate($fileList); }