コード例 #1
0
    if (strnatcmp($current_ver, $tmpver) <= 0) {
        # if overinstalling same ver, then go back in versions
        # jooksev ver = installitav ver
        if (strnatcmp($current_ver, $new_ver) == 0) {
        } else {
            array_push($default_data_files, "admin/updates/update" . $tmpver . "to" . $next . ".sql");
        }
    }
}
# foreach
# remove last element if not repairing/overinstalling same version
if (strnatcmp($current_ver, $new_ver) != 0) {
    array_pop($default_data_files);
}
$update = new Update();
$update->scanUpdates();
if ($cli) {
    if ($update->lastUpdate != $update->updateTo) {
        echo 'This will apply ' . (sizeof($default_data_files) ? ' version updates "' . implode('", "', $default_data_files) . '" and ' : NULL) . 'updates ' . ($update->lastUpdate + 1) . ' through ' . $update->updateTo . ' to Saurus CMS, import dictonary files and syncronise extensions.' . "\n";
        new Log(array('action' => 'update', 'type' => 'NOTICE', 'message' => 'Update started'));
        if (sizeof($default_data_files)) {
            echo 'Version updates: ' . implode(', ', $default_data_files);
            $update->runVersionUpdates($default_data_files);
            echo '.' . "\n";
        }
        $update->runUpdates();
        echo 'Synchronising extensions';
        $update->synchroniseExtensions();
        echo '.' . "\n";
        echo 'Importing glossaries';
        $update->importGlossaries();