summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSavetheinternet <savetheinternet@tinyboard.org>2011-04-30 18:26:22 +1000
committerSavetheinternet <savetheinternet@tinyboard.org>2011-04-30 18:26:22 +1000
commit1873c82aa9bcb71a1df7fcb0b44950fd5bf57b5c (patch)
treecb7744ccbbb2f89608e0457c04881c99e891a7aa
parent2e2ae4d06d5e92276d0912bba44249e963382746 (diff)
fixed a few major bugs with install.php
-rw-r--r--install.php10
1 files changed, 6 insertions, 4 deletions
diff --git a/install.php b/install.php
index 48a5a166..8ac66a5d 100644
--- a/install.php
+++ b/install.php
@@ -19,12 +19,11 @@
sql_open();
// Check the version number
- $version = file_get_contents($config['has_installed']);
+ $version = trim(file_get_contents($config['has_installed']));
if(empty($version))
$version = 'v0.9.1';
switch($version) {
- case '':
case 'v0.9':
case 'v0.9.1':
// Upgrade to v0.9.2-dev
@@ -62,18 +61,21 @@
query(sprintf("ALTER TABLE `posts_%s` CHANGE `name` `name` VARCHAR( 35 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL", $board['uri'])) or error(db_error());
}
+ // Update version number
+ file_put_contents($config['has_installed'], VERSION);
+
$page['title'] = 'Upgraded';
$page['body'] = '<p style="text-align:center">Successfully upgraded from ' . $version . ' to <strong>' . VERSION . '</strong>.</p>';
break;
default:
$page['title'] = 'Unknown version';
$page['body'] = '<p style="text-align:center">Tinyboard was unable to determine what version is currently installed.</p>';
+ break;
case VERSION:
$page['title'] = 'Already installed';
- $page['body'] = '<p style="text-align:center">It appears that Tinyboard is already installed! Delete <strong>' . $config['has_installed'] . '</strong> to reinstall.</p>';
+ $page['body'] = '<p style="text-align:center">It appears that Tinyboard is already installed (' . $version . ') and there is nothing to upgrade! Delete <strong>' . $config['has_installed'] . '</strong> to reinstall.</p>';
break;
}
- file_put_contents($config['has_installed'], VERSION);
sql_close();