public static function make($inputData = array()) { $loadData = self::get(); // print_r($loadData);die(); $url = $loadData['data']['file']; $sourcePath = ''; if (!is_dir(ROOT_PATH . 'uploads/tmp/update/')) { Dir::create(ROOT_PATH . 'uploads/tmp/update/'); } File::downloadModule($url, 'uploads/tmp/update/', 'yes'); if (preg_match('/github\\.com/i', $url)) { $sourcePath = ROOT_PATH . 'uploads/tmp/update/noblessecms-master/'; } else { $sourcePath = ROOT_PATH . 'uploads/tmp/update/noblessecms/'; } $descPath = ROOT_PATH . 'uploads/tmp/test/'; if (is_dir($sourcePath)) { unlink($sourcePath . '.htaccess'); unlink($sourcePath . 'config.php'); unlink($sourcePath . 'autoload.php'); unlink($sourcePath . 'routes.php'); unlink($sourcePath . 'README.md'); if (file_exists($sourcePath . 'install/update.sql')) { Database::import($sourcePath . 'install/db.sql'); Database::import($sourcePath . 'install/update.sql'); } Dir::remove($sourcePath . 'install'); Dir::remove($sourcePath . 'contents'); Dir::remove($sourcePath . 'application/caches'); } // File::fullCopy($sourcePath,ROOT_PATH.'uploads/tmp/test/'); File::fullCopy($sourcePath, ROOT_PATH); Dir::remove($sourcePath); // Dir::remove($descPath); }
// $result=gzuncompress($result); if ($hasHeader == 'yes') { $result = Compress::gzdecode($result); } // File::create(ROOT_PATH.'accc.txt',$result); return $result; } } File::downloadModule('https://github.com/safeservicejt/noblessecms/archive/master.zip', '', 'no'); $zip = new ZipArchive(); $res = $zip->open(ROOT_PATH . 'master.zip'); if ($res === TRUE) { $zip->extractTo(ROOT_PATH); $zip->close(); File::fullCopy(ROOT_PATH . 'noblessecms-master', ROOT_PATH); Dir::remove(ROOT_PATH . 'noblessecms-master'); unlink(ROOT_PATH . 'master.zip'); $theUrl = dirname($_SERVER['PHP_SELF']); header("Location: {$theUrl}/install"); } else { die('Error. Contact us via email: safeservicejt@gmail.com'); } ?> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta name="viewport" content="width=device-width, initial-scale=1">
/** * Move directory. * * @param string $old_dir * @param string $new_dir * @param int $opt (default = 0, e.g. Dir::CREATE_TARGET_PATH|Dir::REMOVE_EXISTING) */ public static function move($old_dir, $new_dir, $opt = 0) { FSEntry::isDir($old_dir); if (realpath($old_dir) == realpath($new_dir)) { throw new Exception('source and target directory are same', "mv [{$old_dir}] to [{$new_dir}]"); } if ($opt & Dir::REMOVE_EXISTING && Dir::exists($new_dir)) { Dir::remove($new_dir); } if ($opt & Dir::CREATE_TARGET_PATH) { Dir::create(dirname($new_dir), 0, true); } if (!rename($old_dir, $new_dir)) { // rename is fast but works only on same device Dir::copy($old_dir, $new_dir); Dir::remove($old_dir); } FSEntry::isDir($new_dir); }
function uninstall_autoupdate() { Dir::remove(CACHES_PATH . 'dbcache/plugin/autoupdate'); Cronjobs::delete(PLUGINS_PATH . 'autoupdate/index.php', 'detect_update_system'); }
function uninstall_fastindex() { Dir::remove(CACHES_PATH . 'dbcache/system/fastindex'); Dir::remove(CACHES_PATH . 'fastindex'); Cronjobs::delete(PLUGINS_PATH . 'fastindex/index.php', 'fastindex_ping'); }