From d2534c63f2c0b640a39fce2a71b14a5dcda6e7fd Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Tue, 18 Dec 2012 09:07:00 +0100 Subject: Cleanup, remove file paths from doc --- program/lib/Roundcube/bootstrap.php | 3 --- 1 file changed, 3 deletions(-) (limited to 'program/lib/Roundcube/bootstrap.php') diff --git a/program/lib/Roundcube/bootstrap.php b/program/lib/Roundcube/bootstrap.php index eed7db8c1..18c07ddab 100644 --- a/program/lib/Roundcube/bootstrap.php +++ b/program/lib/Roundcube/bootstrap.php @@ -2,8 +2,6 @@ /* +-----------------------------------------------------------------------+ - | program/include/bootstrap.php | - | | | This file is part of the Roundcube PHP suite | | Copyright (C) 2005-2012, The Roundcube Dev Team | | | @@ -13,7 +11,6 @@ | | | CONTENTS: | | Roundcube Framework Initialization | - | | +-----------------------------------------------------------------------+ | Author: Thomas Bruederli | | Author: Aleksander Machniak | -- cgit v1.2.3 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) --- CHANGELOG | 1 + bin/installto.sh | 2 +- bin/update.sh | 4 ++-- installer/rcube_install.php | 6 +++--- program/lib/Roundcube/bootstrap.php | 16 ++++++++++++++++ tests/Framework/Bootstrap.php | 8 ++++++++ 6 files changed, 31 insertions(+), 6 deletions(-) (limited to 'program/lib/Roundcube/bootstrap.php') diff --git a/CHANGELOG b/CHANGELOG index c4e63aaeb..02e20455c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,6 +1,7 @@ CHANGELOG Roundcube Webmail =========================== +- Fix version comparisons with -stable suffix (#1488876) - Add unsupported alternative parts to attachments list (#1488870) - Add Compose button on message view page (#1488747) - Display 'Sender' header in message preview diff --git a/bin/installto.sh b/bin/installto.sh index de96bf004..e6cf79d7d 100755 --- a/bin/installto.sh +++ b/bin/installto.sh @@ -35,7 +35,7 @@ if (!preg_match('/define\(.RCMAIL_VERSION.,\s*.([0-9.]+[a-z-]*)/', $iniset, $m)) $oldversion = $m[1]; -if (version_compare($oldversion, RCMAIL_VERSION, '>=')) +if (version_compare(version_parse($oldversion), version_parse(RCMAIL_VERSION), '>=')) die("Installation at target location is up-to-date!\n"); echo "Upgrading from $oldversion. Do you want to continue? (y/N)\n"; diff --git a/bin/update.sh b/bin/update.sh index 59aa596dd..2015aa904 100755 --- a/bin/update.sh +++ b/bin/update.sh @@ -34,7 +34,7 @@ if (!$opts['version']) { $opts['version'] = $input; } -if ($opts['version'] && version_compare($opts['version'], RCMAIL_VERSION, '>')) +if ($opts['version'] && version_compare(version_parse($opts['version']), version_parse(RCMAIL_VERSION), '>')) die("Nothing to be done here. Bye!\n"); @@ -169,7 +169,7 @@ if ($RCI->configured) { } // index contacts for fulltext searching - if (version_compare($opts['version'], '0.6', '<')) { + if (version_compare(version_parse($opts['version']), '0.6.0', '<')) { system(INSTALL_PATH . 'bin/indexcontacts.sh'); } 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; } diff --git a/program/lib/Roundcube/bootstrap.php b/program/lib/Roundcube/bootstrap.php index 18c07ddab..530a7f855 100644 --- a/program/lib/Roundcube/bootstrap.php +++ b/program/lib/Roundcube/bootstrap.php @@ -357,6 +357,22 @@ function format_email($email) } +/** + * Fix version number so it can be used correctly in version_compare() + * + * @param string $version Version number string + * + * @param return Version number string + */ +function version_parse($version) +{ + return str_replace( + array('-stable', '-git'), + array('.0', '.99'), + $version); +} + + /** * mbstring replacement functions */ diff --git a/tests/Framework/Bootstrap.php b/tests/Framework/Bootstrap.php index d18fd371b..904be7e3b 100644 --- a/tests/Framework/Bootstrap.php +++ b/tests/Framework/Bootstrap.php @@ -207,4 +207,12 @@ class Framework_Bootstrap extends PHPUnit_Framework_TestCase $this->assertFalse($result, "Invalid ASCII (UTF-8 character [2])"); } + /** + * bootstrap.php: version_parse() + */ + function test_version_parse() + { + $this->assertEquals('0.9.0', version_parse('0.9-stable')); + $this->assertEquals('0.9.99', version_parse('0.9-git')); + } } -- cgit v1.2.3 From 18e23ab763bab2875d4c8fb70034e218ec7c6d14 Mon Sep 17 00:00:00 2001 From: Thomas Bruederli Date: Wed, 9 Jan 2013 17:50:51 +0100 Subject: Welcome to 2013 --- index.php | 2 +- program/include/iniset.php | 2 +- program/lib/Roundcube/bootstrap.php | 2 +- skins/larry/templates/about.html | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) (limited to 'program/lib/Roundcube/bootstrap.php') diff --git a/index.php b/index.php index aee94e971..3e398c00d 100644 --- a/index.php +++ b/index.php @@ -4,7 +4,7 @@ | Roundcube Webmail IMAP Client | | Version 0.9-git | | | - | Copyright (C) 2005-2012, The Roundcube Dev Team | + | Copyright (C) 2005-2013, The Roundcube Dev Team | | | | This program is free software: you can redistribute it and/or modify | | it under the terms of the GNU General Public License (with exceptions | diff --git a/program/include/iniset.php b/program/include/iniset.php index be71fc084..35b5522fc 100644 --- a/program/include/iniset.php +++ b/program/include/iniset.php @@ -5,7 +5,7 @@ | program/include/iniset.php | | | | This file is part of the Roundcube Webmail client | - | Copyright (C) 2008-2012, The Roundcube Dev Team | + | Copyright (C) 2008-2013, The Roundcube Dev Team | | | | Licensed under the GNU General Public License version 3 or | | any later version with exceptions for skins & plugins. | diff --git a/program/lib/Roundcube/bootstrap.php b/program/lib/Roundcube/bootstrap.php index 530a7f855..8cea48122 100644 --- a/program/lib/Roundcube/bootstrap.php +++ b/program/lib/Roundcube/bootstrap.php @@ -3,7 +3,7 @@ /* +-----------------------------------------------------------------------+ | This file is part of the Roundcube PHP suite | - | Copyright (C) 2005-2012, The Roundcube Dev Team | + | Copyright (C) 2005-2013, The Roundcube Dev Team | | | | Licensed under the GNU General Public License version 3 or | | any later version with exceptions for skins & plugins. | diff --git a/skins/larry/templates/about.html b/skins/larry/templates/about.html index 2c18e8889..301c301a9 100644 --- a/skins/larry/templates/about.html +++ b/skins/larry/templates/about.html @@ -10,7 +10,7 @@

Roundcube Webmail

- +

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
-- cgit v1.2.3 From e4394c95e0a39607f4fdbd427b249b1e611ca0ff Mon Sep 17 00:00:00 2001 From: Thomas Bruederli Date: Mon, 18 Feb 2013 08:31:09 +0100 Subject: Make autoloading of the framework classes work from any location --- program/lib/Roundcube/bootstrap.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'program/lib/Roundcube/bootstrap.php') diff --git a/program/lib/Roundcube/bootstrap.php b/program/lib/Roundcube/bootstrap.php index 8cea48122..ef221e34a 100644 --- a/program/lib/Roundcube/bootstrap.php +++ b/program/lib/Roundcube/bootstrap.php @@ -470,17 +470,17 @@ function rcube_autoload($classname) '/Mail_(.+)/', '/Net_(.+)/', '/Auth_(.+)/', + '/^utf8$/', '/^html_.+/', '/^rcube(.*)/', - '/^utf8$/', ), array( 'Mail/\\1', 'Net/\\1', 'Auth/\\1', - 'Roundcube/html', - 'Roundcube/rcube\\1', 'utf8.class', + RCUBE_LIB_DIR . '/html', + RCUBE_LIB_DIR . '/rcube\\1', ), $classname ); -- cgit v1.2.3 From 2187b2b7d845f6c5b50e380447c034c830454e75 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Tue, 19 Feb 2013 09:08:33 +0100 Subject: Revert "Make autoloading of the framework classes work from any location". Allow loading rcube_* classes from other locations (for e.g. managesieve plugin). This reverts commit e4394c95e0a39607f4fdbd427b249b1e611ca0ff. --- program/lib/Roundcube/bootstrap.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'program/lib/Roundcube/bootstrap.php') diff --git a/program/lib/Roundcube/bootstrap.php b/program/lib/Roundcube/bootstrap.php index ef221e34a..8cea48122 100644 --- a/program/lib/Roundcube/bootstrap.php +++ b/program/lib/Roundcube/bootstrap.php @@ -470,17 +470,17 @@ function rcube_autoload($classname) '/Mail_(.+)/', '/Net_(.+)/', '/Auth_(.+)/', - '/^utf8$/', '/^html_.+/', '/^rcube(.*)/', + '/^utf8$/', ), array( 'Mail/\\1', 'Net/\\1', 'Auth/\\1', + 'Roundcube/html', + 'Roundcube/rcube\\1', 'utf8.class', - RCUBE_LIB_DIR . '/html', - RCUBE_LIB_DIR . '/rcube\\1', ), $classname ); -- cgit v1.2.3 From 3d525ffaf5b36fc74c5a9fa9ed317bcfdd32e19a Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Fri, 22 Mar 2013 11:34:24 +0100 Subject: Bump up also RCUBE_VERSION --- program/lib/Roundcube/bootstrap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'program/lib/Roundcube/bootstrap.php') diff --git a/program/lib/Roundcube/bootstrap.php b/program/lib/Roundcube/bootstrap.php index 8cea48122..0640a9448 100644 --- a/program/lib/Roundcube/bootstrap.php +++ b/program/lib/Roundcube/bootstrap.php @@ -45,7 +45,7 @@ foreach ($config as $optname => $optval) { } // framework constants -define('RCUBE_VERSION', '0.9-git'); +define('RCUBE_VERSION', '1.0-git'); define('RCUBE_CHARSET', 'UTF-8'); if (!defined('RCUBE_LIB_DIR')) { -- cgit v1.2.3 From 589083a94c2e5d50914fba99c80c18d730af697a Mon Sep 17 00:00:00 2001 From: Thomas Bruederli Date: Thu, 28 Mar 2013 17:35:04 +0100 Subject: Skip some irrelevant ini checks in CLI mode --- program/lib/Roundcube/bootstrap.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'program/lib/Roundcube/bootstrap.php') diff --git a/program/lib/Roundcube/bootstrap.php b/program/lib/Roundcube/bootstrap.php index 0640a9448..929a4ff79 100644 --- a/program/lib/Roundcube/bootstrap.php +++ b/program/lib/Roundcube/bootstrap.php @@ -31,12 +31,19 @@ $config = array( // critical PHP settings here. Only these, which doesn't provide // an error/warning in the logs later. See (#1486307). 'mbstring.func_overload' => 0, - 'suhosin.session.encrypt' => 0, - 'session.auto_start' => 0, - 'file_uploads' => 1, 'magic_quotes_runtime' => 0, 'magic_quotes_sybase' => 0, // #1488506 ); + +// check these additional ini settings if not called via CLI +if (php_sapi_name() != 'cli') { + $config += array( + 'suhosin.session.encrypt' => 0, + 'session.auto_start' => 0, + 'file_uploads' => 1, + ); +} + foreach ($config as $optname => $optval) { if ($optval != ini_get($optname) && @ini_set($optname, $optval) === false) { die("ERROR: Wrong '$optname' option value and it wasn't possible to set it to required value ($optval).\n" -- cgit v1.2.3