예제 #1
0
파일: backup.php 프로젝트: BarneyH/razorCMS
 public function get($type)
 {
     if ((int) $this->check_access() < 10 || empty($type)) {
         $this->response(null, null, 401);
     }
     if ($type != "full") {
         $this->response(null, null, 400);
     }
     // compress the whole system to a single zip backup file
     $zip = new RazorZip();
     $time = time();
     $zip->open("{$this->backup_path}/upgrade_backup_{$time}.zip", ZipArchive::CREATE);
     $zip->add_dir(RAZOR_BASE_PATH);
     $zip->close();
     $this->response(array("backup" => "{$this->backup_url}/upgrade_backup_{$time}.zip"), "json");
 }