示例#1
0
 public static function install_from_repository($file_id)
 {
     global $DB;
     global $website;
     @set_time_limit(0);
     $latest = update::latest_installed();
     $ulog = NAVIGATE_PATH . '/updates/update-' . $latest->revision . '-custom-' . time() . '.log.txt';
     file_put_contents($ulog, "UPDATE PROCESS " . $latest->version . 'c ' . $latest->revision . ' (CUSTOM) on ' . time() . "\n", FILE_APPEND);
     // copy file from repository to updates folder
     $ufile = NAVIGATE_PATH . '/updates/update-' . $latest->revision . 'c.zip';
     copy(NAVIGATE_PRIVATE . '/' . $website->id . '/files/' . $file_id, $ufile);
     return update::install_from_file($latest->version . 'c', $latest->revision, $ufile, $ulog);
 }