Example #1
0
            $required = $remote['required'];
            $autoupgrade = 'autoupgrade()';
            if (!$showupdatemsg) {
                print '<div id="updatewarning">';
            }
            $wikilink = 'https://github.com/digitalmethodsinitiative/dmi-tcat/wiki/Upgrading-TCAT';
            if ($required) {
                print "A newer version of TCAT is available, containing important updates. You are strongly recommended to upgrade. Please read the <a href='{$wikilink}' target='_blank'>documentation</a> for instructions on upgrading, or click <a href='#' onclick='{$autoupgrade}'>here</a> to schedule an automatic upgrade. [ commit <a href='{$url}' target='_blank'>{$commit}</a> - {$mesg} ]<br>";
            } else {
                print "A newer version of TCAT is available. You can get the latest code via git pull. Please read the <a href='{$wikilink}' target='_blank'>documentation</a> for instructions on upgrading, or click <a href='#' onclick='{$autoupgrade}'>here</a> to schedule an automatic upgrade. [ commit <a href='{$url}' target='_blank'>{$commit}</a> - {$mesg} ]<br>";
            }
            $showupdatemsg = true;
        }
    }
}
$tests = upgrades(true);
if ($tests['suggested'] == true) {
    if (!$showupdatemsg) {
        print '<div id="updatewarning">';
    } else {
        print '<br/>';
    }
    $wikilink = 'https://github.com/digitalmethodsinitiative/dmi-tcat/wiki/Upgrading-TCAT#upgrading-database-tables';
    if ($tests['required'] == true) {
        print "Your database is out-of-date and needs to be upgraded to fix bugs. Follow the <a href='{$wikilink}' target='_blank'>documentation</a> and run the command-line script common/upgrade.php from your shell.<br/>";
    } else {
        print "Your database must be updated before some new TCAT features can be used. Follow the <a href='{$wikilink}' target='_blank'>documentation</a> and run the command-line script common/upgrade.php from your shell.<br/>";
    }
    $showupdatemsg = true;
}
if ($showupdatemsg) {
Example #2
0
                $aulevel = 1;
            } elseif ($argv[$a] == '--au2') {
                $aulevel = 2;
            } else {
                $single = $argv[$a];
            }
        }
    }
    if ($interactive) {
        logit("cli", "Running in interactive mode");
    } else {
        logit("cli", "Running in non-interactive mode");
        switch ($aulevel) {
            case 0:
                logit("cli", "Automatically executing upgrades with label: trivial");
                break;
            case 1:
                logit("cli", "Automatically executing upgrades with label: substantial");
                break;
            case 2:
                logit("cli", "Automatically executing upgrades with label: expensive");
                break;
        }
    }
    if (isset($single)) {
        logit("cli", "Restricting upgrade to bin {$single}");
    } else {
        logit("cli", "Executing global upgrade");
    }
    upgrades(false, $interactive, $aulevel, $single);
}