summaryrefslogtreecommitdiff
path: root/install.php
diff options
context:
space:
mode:
Diffstat (limited to 'install.php')
-rw-r--r--install.php43
1 files changed, 36 insertions, 7 deletions
diff --git a/install.php b/install.php
index 2881f628..db2e7885 100644
--- a/install.php
+++ b/install.php
@@ -1,7 +1,7 @@
<?php
// Installation/upgrade file
-define('VERSION', '4.5.2');
+define('VERSION', '4.9.91');
require 'inc/functions.php';
@@ -260,7 +260,7 @@ if (file_exists($config['has_installed'])) {
$_query->execute() or error(db_error($_query));
}
}
- case 'v0.9.6-dev-9':
+ case 'v0.9.6-dev-9':
case 'v0.9.6-dev-9 + <a href="https://github.com/vichan-devel/Tinyboard/">vichan-devel-4.0.3</a>':
case 'v0.9.6-dev-9 + <a href="https://github.com/vichan-devel/Tinyboard/">vichan-devel-4.0.4-gold</a>':
case 'v0.9.6-dev-9 + <a href="https://github.com/vichan-devel/Tinyboard/">vichan-devel-4.0.5-gold</a>':
@@ -506,12 +506,12 @@ if (file_exists($config['has_installed'])) {
case 'v0.9.6-dev-22 + <a href="https://int.vichan.net/devel/">vichan-devel-4.4.96</a>':
case 'v0.9.6-dev-22 + <a href="https://int.vichan.net/devel/">vichan-devel-4.4.97</a>':
case '4.4.97':
- if (!isset($_GET['confirm'])) {
+ if (!isset($_GET['confirm2'])) {
$page['title'] = 'License Change';
$page['body'] = '<p style="text-align:center">You are upgrading to a version which uses an amended license. The licenses included with vichan distributions prior to this version (4.4.98) are still valid for those versions, but no longer apply to this and newer versions.</p>' .
'<textarea style="width:700px;height:370px;margin:auto;display:block;background:white;color:black" disabled>' . htmlentities(file_get_contents('LICENSE.md')) . '</textarea>
<p style="text-align:center">
- <a href="?confirm=1">I have read and understood the agreement. Proceed to upgrading.</a>
+ <a href="?confirm2=1">I have read and understood the agreement. Proceed to upgrading.</a>
</p>';
file_write($config['has_installed'], '4.4.97');
@@ -524,6 +524,28 @@ if (file_exists($config['has_installed'])) {
case '4.4.98':
case '4.5.0':
case '4.5.1':
+ case '4.5.2':
+ if (!isset($_GET['confirm3'])) {
+ $page['title'] = 'Breaking change';
+ $page['body'] = '<p style="text-align:center">You are upgrading to the 5.0 branch of vichan. Please back up your database, because the process is irreversible. At the current time, if you want a very stable vichan experience, please use the 4.5 branch. This warning will be lifted as soon as we all agree that 5.0 branch is stable enough</p>
+ <p style="text-align:center">
+ <a href="?confirm3=1">I have read and understood the warning. Proceed to upgrading.</a>
+ </p>';
+
+ file_write($config['has_installed'], '4.5.2');
+
+ break;
+ }
+
+ foreach ($boards as &$board) {
+ query(sprintf('ALTER TABLE ``posts_%s`` ADD `files` text DEFAULT NULL AFTER `bump`;', $board['uri'])) or error(db_error());
+ query(sprintf('ALTER TABLE ``posts_%s`` ADD `num_files` int(11) DEFAULT 0 AFTER `files`;', $board['uri'])) or error(db_error());
+ query(sprintf('UPDATE ``posts_%s`` SET `files` = CONCAT(\'[{"file":"\',`file`,\'", "thumb":"\',`thumb`,\'", "filename":"\',`filename`,\'", "size":"\',`filesize`,\'", "width":"\',`filewidth`,\'","height":"\',`fileheight`,\'","thumbwidth":"\',`thumbwidth`,\'","thumbheight":"\',`thumbheight`,\'"}]\') WHERE `file` IS NOT NULL', $board['uri'], $board['uri'], $board['uri'])) or error(db_error());
+ query(sprintf('UPDATE ``posts_%s`` SET `num_files` = 1 WHERE `file` IS NOT NULL', $board['uri'])) or error(db_error());
+ query(sprintf('ALTER TABLE ``posts_%s`` DROP COLUMN `thumb`, DROP COLUMN `thumbwidth`, DROP COLUMN `thumbheight`, DROP COLUMN `file`, DROP COLUMN `fileheight`, DROP COLUMN `filesize`, DROP COLUMN `filewidth`, DROP COLUMN `filename`', $board['uri'])) or error(db_error());
+ query(sprintf('REPAIR TABLE ``posts_%s``', $board['uri']));
+ }
+ case '4.9.90':
case false:
// TODO: enhance Tinyboard -> vichan upgrade path.
query("CREATE TABLE IF NOT EXISTS ``search_queries`` ( `ip` varchar(39) NOT NULL, `time` int(11) NOT NULL, `query` text NOT NULL) ENGINE=MyISAM DEFAULT CHARSET=utf8;") or error(db_error());
@@ -589,7 +611,7 @@ if ($step == 0) {
'required' => false
)
);
-
+
$tests = array(
array(
'category' => 'PHP',
@@ -683,6 +705,13 @@ if ($step == 0) {
'message' => '(Optional) `gifsicle` was not found or executable; you may not use `convert+gifsicle` for better animated GIF thumbnailing.',
),
array(
+ 'category' => 'Image processing',
+ 'name' => '`md5sum` (quick file hashing)',
+ 'result' => $can_exec && shell_exec('echo "vichan" | md5sum') == "141225c362da02b5c359c45b665168de -\n",
+ 'required' => false,
+ 'message' => '(Optional) `md5sum` was not found or executable; file hashing for multiple images will be slower.',
+ ),
+ array(
'category' => 'File permissions',
'name' => getcwd(),
'result' => is_writable('.'),
@@ -836,9 +865,9 @@ if ($step == 0) {
}
file_write($config['has_installed'], VERSION);
- if (!file_unlink(__FILE__)) {
+ /*if (!file_unlink(__FILE__)) {
$page['body'] .= '<div class="ban"><h2>Delete install.php!</h2><p>I couldn\'t remove <strong>install.php</strong>. You will have to remove it manually.</p></div>';
- }
+ }*/
}
echo Element('page.html', $page);