diff --git a/setup/upgrade.php b/setup/upgrade.php index b8fe241..6350259 100644 --- a/setup/upgrade.php +++ b/setup/upgrade.php @@ -26,8 +26,17 @@ function generateUpgradeTable () { function showResult($res) { if (PEAR::isError($res)) { + if (is_a($res, 'Upgrade_Already_Applied')) { + return "Already applied"; + } return $res->toString(); } + if ($res === true) { + return "Success"; + } + if ($res === false) { + return "Failure"; + } return $res; } @@ -37,21 +46,26 @@ function performAllUpgrades () { $lastVersion = DBUtil::getOneResultKey($query, 'value'); $currentVersion = $default->systemVersion; - $upgrades = performUpgrade($lastVersion, $currentVersion); + $upgrades = describeUpgrade($lastVersion, $currentVersion); - $ret = "
| Code | Description |
|---|
| Description | Result | |
|---|---|---|
| %s | %s | %s |
| %s | %s |
The table below describes the upgrades that need to occur to + upgrade your KnowledgeTree installation to $default->systemVersion. + Click on the button below the table to perform the upgrades.
+ "; + } else { + print " +The table below describes the upgrades that have occurred to + upgrade your KnowledgeTree installation to $default->systemVersion. + "; + } print $upgradeTable; - print '
'; + if (!$performingUpgrade) { + print ''; + } else { + print ''; + } } else { }