From e3a6f025cfb72e64bb4f1f3d1b3ef8f47e9ed01a Mon Sep 17 00:00:00 2001
From: nbm
Date: Tue, 8 Aug 2006 12:05:14 +0000
Subject: [PATCH] KTS-1057: Put a nice "click here to go to KnowledgeTree" after the upgrade succeeds.
---
setup/upgrade.php | 52 +++++++++++++++++++++++++++++++++++++++-------------
1 file changed, 39 insertions(+), 13 deletions(-)
diff --git a/setup/upgrade.php b/setup/upgrade.php
index cdde9c7..1761dbc 100644
--- a/setup/upgrade.php
+++ b/setup/upgrade.php
@@ -95,14 +95,36 @@ function performAllUpgrades () {
if (PEAR::isError($res)) {
if (!is_a($res, 'Upgrade_Already_Applied')) {
break;
+ } else {
+ $res = true;
}
}
if ($res === false) {
+ $res = PEAR::raiseError("Upgrade returned false");
break;
}
-
}
- return $ret;
+ return $res;
+}
+
+function failWritablePath($name, $path) {
+ if (!is_writable($path)) {
+ sprintf("The path for setting %s, which is set to %s, can not be written to. Correct this situation before continuing.", $name, $path);
+ exit(1);
+ }
+}
+
+failWritablePath('Log directory', $default->logDirectory);
+failWritablePath('Document directory', $default->documentRoot);
+
+if (PEAR::isError($loggingSupport)) {
+ print 'Logging support is not currently working. Check post-installation checkup.
';
+ exit(1);
+}
+
+if (PEAR::isError($dbSupport)) {
+ print 'Database support is not currently working. Check post-installation checkup.
';
+ exit(1);
}
if ($_REQUEST["go"] === "Upgrade") {
@@ -136,22 +158,26 @@ td { vertical-align: top; }
upgrade your KnowledgeTree installation to $default->systemVersion.
Click on the button below the table to perform the upgrades.
";
+ $upgradeTable = generateUpgradeTable();
+ print $upgradeTable;
+ print '';
+ print '