예제 #1
0
 }
 if (!$error) {
     if ($latest_version <= $current_version) {
         $should_upgrade = false;
         $updater->upgradeLog("Your installation is up to date", true, "Version: " . $current_version);
     } elseif (!isset($_POST['do_start_upgrade'])) {
         $release_notes = $curl->get($updater->api_path . "?method=getReleaseNotes&key=" . $license_key . "&current_version=" . $current_version);
         if ($curl->getHttpCode() >= 200 && $curl->getHttpCode() < 400) {
             $release_notes = json_decode($release_notes, true);
             if (isset($release_notes['error'])) {
                 $updater->upgradeLog("Getting release notes...", false, "API down, try again later #1");
             } else {
                 if (!count($release_notes)) {
                     $release_notes[$latest_version] = array("No release notes found for this version");
                 }
                 $updater->printReleaseNotes($release_notes);
             }
         } else {
             $updater->upgradeLog("Getting release notes...", false, "API down, try again later #2");
         }
     }
 }
 if ($should_upgrade && isset($_POST['do_start_upgrade'])) {
     if (!$error) {
         if (!is_writeable($basepath . "/cachefiles")) {
             $updater->upgradeLog("Checking if cache folder is writable...", false, "Fail. Please chmod /cachefiles");
             $error = true;
         } else {
             $updater->upgradeLog("Checking if cache folder is writable...", true, "Success");
         }
     }