From a079269166d120bcbcb33d34f4b1c8f60d102e32 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Thu, 20 Dec 2012 08:53:48 +0100 Subject: Fix version comparisons with -stable suffix (#1488876) --- installer/rcube_install.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'installer') diff --git a/installer/rcube_install.php b/installer/rcube_install.php index dfd63562d..530be3ebe 100644 --- a/installer/rcube_install.php +++ b/installer/rcube_install.php @@ -633,8 +633,8 @@ class rcube_install */ function update_db($DB, $version) { - $version = strtolower($version); - $engine = isset($this->db_map[$DB->db_provider]) ? $this->db_map[$DB->db_provider] : $DB->db_provider; + $version = version_parse(strtolower($version)); + $engine = isset($this->db_map[$DB->db_provider]) ? $this->db_map[$DB->db_provider] : $DB->db_provider; // read schema file from /SQL/* $fname = INSTALL_PATH . "SQL/$engine.update.sql"; @@ -643,7 +643,7 @@ class rcube_install foreach ($lines as $line) { $is_comment = preg_match('/^--/', $line); if (!$from && $is_comment && preg_match('/from version\s([0-9.]+[a-z-]*)/', $line, $m)) { - $v = strtolower($m[1]); + $v = version_parse(strtolower($m[1])); if ($v == $version || version_compare($version, $v, '<=')) $from = true; } -- cgit v1.2.3 From 73899662952a1ae91167c070d2a38136a0200c67 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Fri, 21 Dec 2012 10:32:59 +0100 Subject: Add notes about new requirements of the new mysql database driver, add check in installer (#1488875) --- INSTALL | 1 + UPGRADING | 3 ++- installer/check.php | 8 +++++++- 3 files changed, 10 insertions(+), 2 deletions(-) (limited to 'installer') diff --git a/INSTALL b/INSTALL index c099fc626..326ef889f 100644 --- a/INSTALL +++ b/INSTALL @@ -14,6 +14,7 @@ REQUIREMENTS * PHP Version 5.2.1 or greater including - PCRE, DOM, JSON, XML, Session, Sockets (required) - PHP Data Objects (PDO) with driver for either MySQL, PostgreSQL or SQLite (required) + Note: MySQL database driver requires PHP 5.3 or newer. - Libiconv, Zip (recommended) - Fileinfo, Mcrypt, mbstring (optional) * PEAR packages distributed with Roundcube or external: diff --git a/UPGRADING b/UPGRADING index babe168aa..67c1245ec 100644 --- a/UPGRADING +++ b/UPGRADING @@ -20,7 +20,7 @@ target location and check and update the configuration and database schema. After all is done, the temporary folder with the new Roundcube files can be removed again. -Please also see Post-Upgrade Activities section. +WARNING: See Post-Upgrade Activities section below. Updating manually @@ -53,3 +53,4 @@ Post-Upgrade Activities 3. When upgrading from version older than 0.6-beta you should make sure your folder settings contain namespace prefix. For example Courier users should add INBOX. prefix to folder names in main configuration file. +4. Check system requirements in INSTALL file. diff --git a/installer/check.php b/installer/check.php index d6c9f5c40..886200b84 100644 --- a/installer/check.php +++ b/installer/check.php @@ -130,7 +130,13 @@ foreach ($optional_php_exts as $name => $ext) { $prefix = (PHP_SHLIB_SUFFIX === 'dll') ? 'php_' : ''; foreach ($RCI->supported_dbs as $database => $ext) { if (extension_loaded($ext)) { - $RCI->pass($database); + // MySQL driver requires PHP >= 5.3 (#1488875) + if ($ext == 'pdo_mysql' && version_compare(PHP_VERSION, '5.3.0', '<')) { + $RCI->fail($database, 'PHP >= 5.3 required'); + } + else { + $RCI->pass($database); + } } else { $_ext = $ext_dir . '/' . $prefix . $ext . '.' . PHP_SHLIB_SUFFIX; -- cgit v1.2.3 From b2064d5fc05829657cb366a56f7045f797c31eea Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Fri, 4 Jan 2013 09:43:25 +0100 Subject: Remove program/ dir from installer include path --- installer/index.php | 1 - 1 file changed, 1 deletion(-) (limited to 'installer') diff --git a/installer/index.php b/installer/index.php index 7a78736b8..0e80b1cd6 100644 --- a/installer/index.php +++ b/installer/index.php @@ -44,7 +44,6 @@ define('RCUBE_INSTALL_PATH', INSTALL_PATH); define('RCUBE_CONFIG_DIR', INSTALL_PATH . 'config/'); $include_path = INSTALL_PATH . 'program/lib' . PATH_SEPARATOR; -$include_path .= INSTALL_PATH . 'program' . PATH_SEPARATOR; $include_path .= INSTALL_PATH . 'program/include' . PATH_SEPARATOR; $include_path .= ini_get('include_path'); -- cgit v1.2.3 From 64e218bd13b948712d79b60f6eae90cf393ec81f Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Wed, 9 Jan 2013 08:49:01 +0100 Subject: Add 0.9-beta to list of releases --- installer/rcube_install.php | 1 + 1 file changed, 1 insertion(+) (limited to 'installer') diff --git a/installer/rcube_install.php b/installer/rcube_install.php index 530be3ebe..6ef105bc7 100644 --- a/installer/rcube_install.php +++ b/installer/rcube_install.php @@ -452,6 +452,7 @@ class rcube_install '0.6-beta', '0.6', '0.7-beta', '0.7', '0.7.1', '0.7.2', '0.7.3', '0.8-beta', '0.8-rc', '0.8.0', '0.8.1', '0.8.2', '0.8.3', '0.8.4', + '0.9-beta', )); return $select; } -- cgit v1.2.3 From 619c320c0ee9ca39d0fada9113133724cc2a11fe Mon Sep 17 00:00:00 2001 From: Thomas Bruederli Date: Thu, 10 Jan 2013 09:41:12 +0100 Subject: Avoid direct execution of installer includes (#1488895) --- installer/check.php | 7 +++++++ installer/config.php | 7 +++++++ installer/test.php | 7 +++++++ 3 files changed, 21 insertions(+) (limited to 'installer') diff --git a/installer/check.php b/installer/check.php index 886200b84..14fc4f06e 100644 --- a/installer/check.php +++ b/installer/check.php @@ -1,3 +1,10 @@ +

Check config files

-- cgit v1.2.3 From 15a049c37c4615c864dfc69ea95d881b3ddfe552 Mon Sep 17 00:00:00 2001 From: Thomas Bruederli Date: Thu, 10 Jan 2013 09:41:30 +0100 Subject: Mark mime_magic option with old default value as obsolete --- installer/rcube_install.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'installer') diff --git a/installer/rcube_install.php b/installer/rcube_install.php index 6ef105bc7..e6fbc6251 100644 --- a/installer/rcube_install.php +++ b/installer/rcube_install.php @@ -261,6 +261,11 @@ class rcube_install } } + // the old default mime_magic reference is obsolete + if ($this->config['mime_magic'] == '/usr/share/misc/magic') { + $out['obsolete'][] = array('prop' => 'mime_magic', 'explain' => "Set value to null in order to use system default"); + } + // iterate over default config foreach ($defaults as $prop => $value) { if (!isset($seen[$prop]) && isset($required[$prop]) && !(is_bool($this->config[$prop]) || strlen($this->config[$prop]))) -- cgit v1.2.3 From 4490d03649e1ce1a90274a0dce56fe8e5d2859ae Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Thu, 10 Jan 2013 12:32:29 +0100 Subject: Attach updatedb.sh script to the installer interface --- installer/rcube_install.php | 40 ++++++---------------------------------- installer/test.php | 13 +++++-------- 2 files changed, 11 insertions(+), 42 deletions(-) (limited to 'installer') diff --git a/installer/rcube_install.php b/installer/rcube_install.php index 6ef105bc7..29c18d9a5 100644 --- a/installer/rcube_install.php +++ b/installer/rcube_install.php @@ -626,46 +626,18 @@ class rcube_install /** - * Update database with SQL statements from SQL/*.update.sql + * Update database schema * - * @param object rcube_db Database connection * @param string Version to update from + * * @return boolen True on success, False on error */ - function update_db($DB, $version) + function update_db($version) { - $version = version_parse(strtolower($version)); - $engine = isset($this->db_map[$DB->db_provider]) ? $this->db_map[$DB->db_provider] : $DB->db_provider; - - // read schema file from /SQL/* - $fname = INSTALL_PATH . "SQL/$engine.update.sql"; - if ($lines = @file($fname, FILE_SKIP_EMPTY_LINES)) { - $from = false; $sql = ''; - foreach ($lines as $line) { - $is_comment = preg_match('/^--/', $line); - if (!$from && $is_comment && preg_match('/from version\s([0-9.]+[a-z-]*)/', $line, $m)) { - $v = version_parse(strtolower($m[1])); - if ($v == $version || version_compare($version, $v, '<=')) - $from = true; - } - if ($from && !$is_comment) - $sql .= $line. "\n"; - } - - if ($sql) - $this->exec_sql($sql, $DB); - } - else { - $this->fail('DB Schema', "Cannot read the update file: $fname"); - return false; - } - - if ($err = $this->get_error()) { - $this->fail('DB Schema', "Error updating database: $err"); - return false; - } + system(INSTALL_PATH . "bin/updatedb.sh --label=roundcube --version=" . $version + . " --dir=" . INSTALL_PATH . "SQL", $result); - return true; + return !$result; } diff --git a/installer/test.php b/installer/test.php index e266bf05f..2cd9b5374 100644 --- a/installer/test.php +++ b/installer/test.php @@ -157,11 +157,9 @@ if ($db_working && $_POST['initdb']) { } else if ($db_working && $_POST['updatedb']) { - if (!($success = $RCI->update_db($DB, $_POST['version']))) { - $updatefile = INSTALL_PATH . 'SQL/' . (isset($RCI->db_map[$DB->db_provider]) ? $RCI->db_map[$DB->db_provider] : $DB->db_provider) . '.update.sql'; - echo '

Please manually execute the SQL statements from '.$updatefile.' on your database.
'; - echo 'See comments in the file and execute queries below the comment with the currently installed version number.

'; - } + if (!($success = $RCI->update_db($_POST['version']))) { + echo '

Database schema update failed.

'; + } } // test database @@ -176,9 +174,8 @@ if ($db_working) { $RCI->fail('DB Schema', "Database schema differs"); echo '
  • ' . join("
  • \n
  • ", $err) . "
"; $select = $RCI->versions_select(array('name' => 'version')); - echo '

You should run the update queries to get the schmea fixed.

Version to update from: ' . $select->show() . ' 

'; -// echo '

Please manually execute the SQL statements from '.$updatefile.' on your database.
'; -// echo 'See comments in the file and execute queries that are superscribed with the currently installed version number.

'; + $select->add('0.9 or newer', ''); + echo '

You should run the update queries to get the schema fixed.

Version to update from: ' . $select->show() . ' 

'; $db_working = false; } else { -- cgit v1.2.3 From ff54e9ae867fa7bfe6280cc33d42d2d9829da6cc Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Mon, 14 Jan 2013 09:15:39 +0100 Subject: Remove unneeded $db_map --- installer/rcube_install.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'installer') diff --git a/installer/rcube_install.php b/installer/rcube_install.php index 29c18d9a5..bbb225bc7 100644 --- a/installer/rcube_install.php +++ b/installer/rcube_install.php @@ -29,7 +29,6 @@ class rcube_install var $config = array(); var $configured = false; var $last_error = null; - var $db_map = array('pgsql' => 'postgres', 'mysqli' => 'mysql', 'sqlsrv' => 'mssql'); var $email_pattern = '([a-z0-9][a-z0-9\-\.\+\_]*@[a-z0-9]([a-z0-9\-][.]?)*[a-z0-9])'; var $bool_config_props = array(); @@ -604,7 +603,7 @@ class rcube_install */ function init_db($DB) { - $engine = isset($this->db_map[$DB->db_provider]) ? $this->db_map[$DB->db_provider] : $DB->db_provider; + $engine = $DB->db_provider; // read schema file from /SQL/* $fname = INSTALL_PATH . "SQL/$engine.initial.sql"; -- cgit v1.2.3 From 9e329c0a275cc0a0ce02d86593c2ee558d846239 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Wed, 16 Jan 2013 12:24:05 +0100 Subject: Renamed option updatedb.sh --label to --package --- bin/update.sh | 2 +- bin/updatedb.sh | 16 ++++++++-------- installer/rcube_install.php | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) (limited to 'installer') diff --git a/bin/update.sh b/bin/update.sh index e1beef053..536bad9ba 100755 --- a/bin/update.sh +++ b/bin/update.sh @@ -144,7 +144,7 @@ if ($RCI->configured) { // check database schema if ($RCI->config['db_dsnw']) { echo "Executing database schema update.\n"; - system(INSTALL_PATH . "bin/updatedb.sh --label=roundcube --version=" . $ops['version'] + system(INSTALL_PATH . "bin/updatedb.sh --package=roundcube --version=" . $ops['version'] . " --dir=" . INSTALL_PATH . DIRECTORY_SEPARATOR . "SQL", $res); $success = !$res; diff --git a/bin/updatedb.sh b/bin/updatedb.sh index 9f2aef1bf..017c14913 100755 --- a/bin/updatedb.sh +++ b/bin/updatedb.sh @@ -27,15 +27,15 @@ require_once INSTALL_PATH . 'program/include/clisetup.php'; $opts = rcube_utils::get_opt(array( 'v' => 'version', 'd' => 'dir', - 'l' => 'label', + 'p' => 'package', )); if (empty($opts['dir'])) { echo "ERROR: Database schema directory not specified (--dir).\n"; exit(1); } -if (empty($opts['label'])) { - echo "ERROR: Database schema label not specified (--label).\n"; +if (empty($opts['package'])) { + echo "ERROR: Database schema package name not specified (--package).\n"; exit(1); } @@ -60,7 +60,7 @@ if (in_array('system', (array)$DB->list_tables())) { $DB->query("SELECT " . $DB->quote_identifier('value') ." FROM " . $DB->quote_identifier('system') ." WHERE " . $DB->quote_identifier('name') ." = ?", - $opts['label'] . '-version'); + $opts['package'] . '-version'); $row = $DB->fetch_array(); $version = $row[0]; @@ -126,7 +126,7 @@ sort($result, SORT_NUMERIC); foreach ($result as $v) { echo "Updating database schema ($v)... "; - $error = update_db_schema($opts['label'], $v, $dir . DIRECTORY_SEPARATOR . "$v.sql"); + $error = update_db_schema($opts['package'], $v, $dir . DIRECTORY_SEPARATOR . "$v.sql"); if ($error) { echo "\nError in DDL upgrade $v: $error\n"; @@ -137,7 +137,7 @@ foreach ($result as $v) { exit(0); -function update_db_schema($label, $version, $file) +function update_db_schema($package, $version, $file) { global $DB; @@ -167,13 +167,13 @@ function update_db_schema($label, $version, $file) $DB->query("UPDATE " . $DB->quote_identifier('system') ." SET " . $DB->quote_identifier('value') . " = ?" ." WHERE " . $DB->quote_identifier('name') . " = ?", - $version, $label . '-version'); + $version, $package . '-version'); if (!$DB->is_error() && !$DB->affected_rows()) { $DB->query("INSERT INTO " . $DB->quote_identifier('system') ." (" . $DB->quote_identifier('name') . ", " . $DB->quote_identifier('value') . ")" ." VALUES (?, ?)", - $label . '-version', $version); + $package . '-version', $version); } return $DB->is_error(); diff --git a/installer/rcube_install.php b/installer/rcube_install.php index bbb225bc7..a800dfdbe 100644 --- a/installer/rcube_install.php +++ b/installer/rcube_install.php @@ -633,7 +633,7 @@ class rcube_install */ function update_db($version) { - system(INSTALL_PATH . "bin/updatedb.sh --label=roundcube --version=" . $version + system(INSTALL_PATH . "bin/updatedb.sh --package=roundcube --version=" . $version . " --dir=" . INSTALL_PATH . "SQL", $result); return !$result; -- cgit v1.2.3 From 66d30994853ba9282c1d8f9cc189a195e79e8b9a Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Mon, 28 Jan 2013 11:11:33 +0100 Subject: Make get_instance() a static method --- installer/rcube_install.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'installer') diff --git a/installer/rcube_install.php b/installer/rcube_install.php index 33fd4c675..2805dc77e 100644 --- a/installer/rcube_install.php +++ b/installer/rcube_install.php @@ -64,7 +64,7 @@ class rcube_install /** * Constructor */ - function rcube_install() + function __construct() { $this->step = intval($_REQUEST['_step']); $this->is_post = $_SERVER['REQUEST_METHOD'] == 'POST'; @@ -73,7 +73,7 @@ class rcube_install /** * Singleton getter */ - function get_instance() + static function get_instance() { static $inst; -- cgit v1.2.3 From 6befeab7124424c550677838970321764a7bafd5 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Thu, 7 Feb 2013 09:26:05 +0100 Subject: Add 0.8.5 to releases list --- installer/rcube_install.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'installer') diff --git a/installer/rcube_install.php b/installer/rcube_install.php index 2805dc77e..7522b3b98 100644 --- a/installer/rcube_install.php +++ b/installer/rcube_install.php @@ -455,7 +455,7 @@ class rcube_install '0.5-beta', '0.5', '0.5.1', '0.6-beta', '0.6', '0.7-beta', '0.7', '0.7.1', '0.7.2', '0.7.3', - '0.8-beta', '0.8-rc', '0.8.0', '0.8.1', '0.8.2', '0.8.3', '0.8.4', + '0.8-beta', '0.8-rc', '0.8.0', '0.8.1', '0.8.2', '0.8.3', '0.8.4', '0.8.5', '0.9-beta', )); return $select; -- cgit v1.2.3 From a6ceb4ea49cd50b2872f6031d83f54d174d7792a Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Thu, 7 Mar 2013 09:19:59 +0100 Subject: Add 0.9-rc to releases list --- installer/rcube_install.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'installer') diff --git a/installer/rcube_install.php b/installer/rcube_install.php index 7522b3b98..d5811ded1 100644 --- a/installer/rcube_install.php +++ b/installer/rcube_install.php @@ -456,7 +456,7 @@ class rcube_install '0.6-beta', '0.6', '0.7-beta', '0.7', '0.7.1', '0.7.2', '0.7.3', '0.8-beta', '0.8-rc', '0.8.0', '0.8.1', '0.8.2', '0.8.3', '0.8.4', '0.8.5', - '0.9-beta', + '0.9-beta', '0.9-rc', )); return $select; } -- cgit v1.2.3 From c2c1bba9a240c7e8c59893c4fe667246e7fe01f9 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Fri, 29 Mar 2013 08:51:42 +0100 Subject: Update releases list --- bin/updatedb.sh | 3 +++ installer/rcube_install.php | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'installer') diff --git a/bin/updatedb.sh b/bin/updatedb.sh index 1c7e1c7a1..7fa8cceb9 100755 --- a/bin/updatedb.sh +++ b/bin/updatedb.sh @@ -90,6 +90,7 @@ if (!$version && $opts['version']) { '0.7.1' => 2011111600, '0.7.2' => 2011111600, '0.7.3' => 2011111600, + '0.7.4' => 2011111600, '0.8-beta' => 2011121400, '0.8-rc' => 2011121400, '0.8.0' => 2011121400, @@ -97,6 +98,8 @@ if (!$version && $opts['version']) { '0.8.2' => 2011121400, '0.8.3' => 2011121400, '0.8.4' => 2011121400, + '0.8.5' => 2011121400, + '0.8.6' => 2011121400, '0.9-beta' => 2012080700, ); diff --git a/installer/rcube_install.php b/installer/rcube_install.php index d5811ded1..08761ce6d 100644 --- a/installer/rcube_install.php +++ b/installer/rcube_install.php @@ -452,11 +452,11 @@ class rcube_install '0.2-alpha', '0.2-beta', '0.2-stable', '0.3-stable', '0.3.1', '0.4-beta', '0.4.2', - '0.5-beta', '0.5', '0.5.1', + '0.5-beta', '0.5', '0.5.1', '0.5.2', '0.5.3', '0.5.4', '0.6-beta', '0.6', - '0.7-beta', '0.7', '0.7.1', '0.7.2', '0.7.3', - '0.8-beta', '0.8-rc', '0.8.0', '0.8.1', '0.8.2', '0.8.3', '0.8.4', '0.8.5', - '0.9-beta', '0.9-rc', + '0.7-beta', '0.7', '0.7.1', '0.7.2', '0.7.3', '0.7.4', + '0.8-beta', '0.8-rc', '0.8.0', '0.8.1', '0.8.2', '0.8.3', '0.8.4', '0.8.5', '0.8.6', + '0.9-beta', '0.9-rc', '0.9-rc2', )); return $select; } -- cgit v1.2.3