コード例 #1
0
ファイル: console_upgrade.php プロジェクト: samuell/Core
// Run upgrades until we are up to date.
$total = count($upgrades);
$index = 0;
foreach ($upgrades as $id => $upgrade) {
    $index++;
    if (!$noprompt) {
        if ($total == 1) {
            echo "Upgrade: {$id}\n";
        } else {
            echo "Next upgrade: {$id} ({$index} of {$total})\n";
        }
        echo "Press ENTER to run this upgrade or CTRL+C to stop > ";
        fgets(STDIN);
    } else {
        if ($total == 1) {
            echo "Running upgrade: {$id}\n";
        } else {
            echo "Running upgrade {$index} of {$total}\n";
        }
    }
    // Run the upgrade.
    $update_internal_version = $file ? FALSE : TRUE;
    $message = phorum_dbupgrade_run($upgrade, $update_internal_version);
    // Strip HTML code from the returned upgrade message,
    // so we can display it on the console.
    $message = strip_tags($message);
    print $message;
    print "\n";
}
echo "Your install is up-to-date.\n\n";
exit(0);
コード例 #2
0
ファイル: upgrade.php プロジェクト: samuell/Core
     break;
     // Step 1: this step performs the actual upgrading steps.
 // Step 1: this step performs the actual upgrading steps.
 case 1:
     // For some extra status information to the user.
     $index = isset($_POST["upgradeindex"]) ? $_POST["upgradeindex"] + 1 : 1;
     $count = isset($_POST["upgradecount"]) ? $_POST["upgradecount"] : $upgradecount;
     // Make sure that the visual feedback doesn't turn up weird
     // if the admin does some clicking back and forth in the browser.
     if ($index > $count) {
         $index = 1;
         $count = $upgradecount;
     }
     // Run the first upgrade from the list of available upgrades.
     list($dummy, $upgrade) = each($upgrades);
     $message = phorum_dbupgrade_run($upgrade);
     // Show the results.
     $frm = new PhorumInputForm("", "post", "Continue ->");
     $frm->addbreak("Upgrading Phorum (multiple steps possible) ...");
     $w = floor($index / $count * 100);
     $frm->addmessage('<table><tr><td>' . '<div style="height:20px;width:300px; border:1px solid black">' . '<div style="height:20px;width:' . $w . '%; background-color:green">' . '</div></div></td><td style="padding-left:10px">' . 'upgrade ' . $index . " of " . $count . '</td></tr></table>');
     $frm->addmessage($message);
     $frm->hidden("step", 1);
     $frm->hidden("module", "upgrade");
     $frm->hidden("is_module_upgrade", $is_module_upgrade);
     $frm->hidden("upgradeindex", $index);
     $frm->hidden("upgradecount", $count);
     $frm->show();
     break;
     // Step 2: the upgrade has been completed.
 // Step 2: the upgrade has been completed.