[geeklog-cvs] geeklog: Use constants to define the minimum PHP and MySQL versions
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Sun Sep 6 05:01:44 EDT 2009
details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/5f9005f9c657
changeset: 7286:5f9005f9c657
user: Dirk Haun <dirk at haun-online.de>
date: Sun Sep 06 11:00:27 2009 +0200
description:
Use constants to define the minimum PHP and MySQL versions
diffstat:
public_html/admin/install/index.php | 10 +++--
public_html/admin/install/install-plugins.php | 4 +-
public_html/admin/install/language/chinese_simplified_utf-8.php | 8 ++--
public_html/admin/install/language/chinese_traditional_utf-8.php | 8 ++--
public_html/admin/install/language/english.php | 8 ++--
public_html/admin/install/language/german.php | 8 ++--
public_html/admin/install/language/hebrew_utf-8.php | 8 ++--
public_html/admin/install/language/japanese_utf-8.php | 8 ++--
public_html/admin/install/language/polish.php | 8 ++--
public_html/admin/install/lib-install.php | 15 ++++++-
public_html/admin/install/migrate.php | 7 ++-
11 files changed, 52 insertions(+), 40 deletions(-)
diffs (277 lines):
diff -r 0021451d31d4 -r 5f9005f9c657 public_html/admin/install/index.php
--- a/public_html/admin/install/index.php Sun Sep 06 10:23:14 2009 +0200
+++ b/public_html/admin/install/index.php Sun Sep 06 11:00:27 2009 +0200
@@ -227,8 +227,10 @@
// Check if the user's version of MySQL is out of date
} else if (INST_mysqlOutOfDate($DB)) {
- $display .= '<h1>' . $LANG_INSTALL[51] . '</h1>' . LB;
- $display .= '<p>' . $LANG_INSTALL[52]
+ $myv = mysql_v($DB['host'], $DB['user'], $DB['pass']);
+ $display .= '<h1>' . sprintf($LANG_INSTALL[51], SUPPORTED_MYSQL_VER)
+ . '</h1>' . LB;
+ $display .= '<p>' . sprintf($LANG_INSTALL[52], SUPPORTED_MYSQL_VER)
. $myv[0] . '.' . $myv[1] . '.' . $myv[2]
. $LANG_INSTALL[53] . '</p>' . LB;
@@ -952,8 +954,8 @@
if (INST_phpOutOfDate()) {
// If their version of PHP is not supported, print an error:
- $display .= '<h1 class="heading">' . str_replace('4.1.0', SUPPORTED_PHP_VER, $LANG_INSTALL[4]) . '</h1>' . LB;
- $display .= '<p>' . str_replace('4.1.0', SUPPORTED_PHP_VER, $LANG_INSTALL[5]) . phpversion() . $LANG_INSTALL[6] . '</p>' . LB;
+ $display .= '<h1 class="heading">' . sprintf($LANG_INSTALL[4], SUPPORTED_PHP_VER) . '</h1>' . LB;
+ $display .= '<p>' . sprintf($LANG_INSTALL[5], SUPPORTED_PHP_VER) . phpversion() . $LANG_INSTALL[6] . '</p>' . LB;
} else {
diff -r 0021451d31d4 -r 5f9005f9c657 public_html/admin/install/install-plugins.php
--- a/public_html/admin/install/install-plugins.php Sun Sep 06 10:23:14 2009 +0200
+++ b/public_html/admin/install/install-plugins.php Sun Sep 06 11:00:27 2009 +0200
@@ -74,8 +74,8 @@
if (INST_phpOutOfDate()) {
// If their version of PHP is not supported, print an error:
- $display .= '<h1>' . $LANG_INSTALL[4] . '</h1>' . LB;
- $display .= '<p>' . $LANG_INSTALL[5] . $phpv[0] . '.' . $phpv[1] . '.' . (int) $phpv[2] . $LANG_INSTALL[6] . '</p>' . LB;
+ $display .= '<h1>' . sprintf($LANG_INSTALL[4], SUPPORTED_PHP_VER) . '</h1>' . LB;
+ $display .= '<p>' . sprintf($LANG_INSTALL[5], SUPPORTED_PHP_VER) . $phpv[0] . '.' . $phpv[1] . '.' . (int) $phpv[2] . $LANG_INSTALL[6] . '</p>' . LB;
} else {
diff -r 0021451d31d4 -r 5f9005f9c657 public_html/admin/install/language/chinese_simplified_utf-8.php
--- a/public_html/admin/install/language/chinese_simplified_utf-8.php Sun Sep 06 10:23:14 2009 +0200
+++ b/public_html/admin/install/language/chinese_simplified_utf-8.php Sun Sep 06 11:00:27 2009 +0200
@@ -54,8 +54,8 @@
1 => 'å®è£
æ¯å©',
2 => 'ç»æç½å¿ç³»ç»',
3 => 'å¿ä¹å®è£
',
- 4 => 'éè¦PHP 4.3.0',
- 5 => 'æ±æ, å¿ä¹è¦æ±æå° PHP 4.3.0 æ¥æä½(ä½ æçæ¯',
+ 4 => 'éè¦PHP %s',
+ 5 => 'æ±æ, å¿ä¹è¦æ±æå° PHP %s æ¥æä½(ä½ æçæ¯',
6 => '). 请 <a href="http://www.php.net/downloads.php">å级PHP</a> å®è£
æè¯·ä½ çç½ç«æå¡åå¸®ä½ å®è£
.',
7 => 'æ¾ä¸å°å¿ä¹æ¡£æ¡',
8 => 'å®è£
ç³»ç»æ æ³æ¾å°å
³é®çå¿ä¹æ¡£æ¡. ä¹è®¸ä½ å°å®ä»¬æ¬ç§»è¿. 请æå®æéæ¡£æ¡åç®å½çè·¯å¾:',
@@ -101,8 +101,8 @@
48 => 'ç½ç«çµé®',
49 => 'ç½ç«ç ä¸å¯åä¿¡ççµé®',
50 => 'å®è£
',
- 51 => 'éè¦ MySQL 3.23.2',
- 52 => 'æ±æ, å¿ä¹éè¦æå° MySQL 3.23.2 æ¥æä½ (ä½ æçæ¯ ',
+ 51 => 'éè¦ MySQL %s',
+ 52 => 'æ±æ, å¿ä¹éè¦æå° MySQL %s æ¥æä½ (ä½ æçæ¯ ',
53 => '). 请 <a href="http://dev.mysql.com/downloads/mysql/">åçº§ä½ çMySQL</a> å®è£
æè¯·ä½ çç½ç«ä¸»æºæå¡åå¸®ä½ å级.',
54 => 'é误çæ°æ®åºèµæ',
55 => 'æ±æ, æ°æ®åºèµæ好åä¸åç¡®. 请åå»åè¯ä¸æ¬¡.',
diff -r 0021451d31d4 -r 5f9005f9c657 public_html/admin/install/language/chinese_traditional_utf-8.php
--- a/public_html/admin/install/language/chinese_traditional_utf-8.php Sun Sep 06 10:23:14 2009 +0200
+++ b/public_html/admin/install/language/chinese_traditional_utf-8.php Sun Sep 06 11:00:27 2009 +0200
@@ -54,8 +54,8 @@
1 => 'å®è£æ¯å©',
2 => 'çµæ¥µç¶²å¿ç³»çµ±',
3 => 'å¿æ¨å®è£',
- 4 => 'éè¦PHP 4.3.0',
- 5 => 'æ±æ, å¿æ¨è¦æ±æå° PHP 4.3.0 ä¾æä½(ä½ æçæ¯',
+ 4 => 'éè¦PHP %s',
+ 5 => 'æ±æ, å¿æ¨è¦æ±æå° PHP %s ä¾æä½(ä½ æçæ¯',
6 => '). è« <a href="http://www.php.net/downloads.php">åç´PHP</a> å®è£ æè«ä½ ç網ç«æåå¡å¹«ä½ å®è£.',
7 => 'æ¾ä¸å°å¿æ¨æªæ¡',
8 => 'å®è£ç³»çµ±ç¡æ³æ¾å°ééµçå¿æ¨æªæ¡. ä¹è¨±ä½ å°å®åæ¬ç§»é. è«æå®æéæªæ¡åç®éçè·¯å¾:',
@@ -101,8 +101,8 @@
48 => '網ç«é»éµ',
49 => '網ç«ç ä¸å¯åä¿¡çé»éµ',
50 => 'å®è£',
- 51 => 'éè¦ MySQL 3.23.2',
- 52 => 'æ±æ, å¿æ¨éè¦æå° MySQL 3.23.2 ä¾æä½ (ä½ æçæ¯ ',
+ 51 => 'éè¦ MySQL %s',
+ 52 => 'æ±æ, å¿æ¨éè¦æå° MySQL %s ä¾æä½ (ä½ æçæ¯ ',
53 => '). è« <a href="http://dev.mysql.com/downloads/mysql/">åç´ä½ çMySQL</a> å®è£ æè«ä½ ç網ç«ä¸»æ©æåå¡å¹«ä½ åç´.',
54 => 'é¯èª¤çè³æ庫è³æ',
55 => 'æ±æ, è³æ庫è³æ好åä¸æºç¢º. è«åå»å試ä¸æ¬¡.',
diff -r 0021451d31d4 -r 5f9005f9c657 public_html/admin/install/language/english.php
--- a/public_html/admin/install/language/english.php Sun Sep 06 10:23:14 2009 +0200
+++ b/public_html/admin/install/language/english.php Sun Sep 06 11:00:27 2009 +0200
@@ -53,8 +53,8 @@
1 => 'Installation Support',
2 => 'The Ultimate Weblog System',
3 => 'Geeklog Installation',
- 4 => 'PHP 4.3.0 required',
- 5 => 'Sorry, but Geeklog requires at least PHP 4.3.0 to run (you have version ',
+ 4 => 'PHP %s required',
+ 5 => 'Sorry, but Geeklog requires at least PHP %s to run (you have version ',
6 => '). Please <a href="http://www.php.net/downloads.php">upgrade your PHP</a> install or ask your hosting service to do it for you.',
7 => 'Unable to locate Geeklog files',
8 => 'The installer was unable to locate critical Geeklog files. This is probably because you have moved them from their default location. Please specify the paths to the files and directories below:',
@@ -100,8 +100,8 @@
48 => 'Site Email',
49 => 'Site No-Reply Email',
50 => 'Install',
- 51 => 'MySQL 3.23.2 or newer required',
- 52 => 'Sorry, but Geeklog requires at least MySQL 3.23.2 to run (you have version ',
+ 51 => 'MySQL %s or newer required',
+ 52 => 'Sorry, but Geeklog requires at least MySQL %s to run (you have version ',
53 => '). Please <a href="http://dev.mysql.com/downloads/mysql/">upgrade your MySQL</a> install or ask your hosting service to do it for you.',
54 => 'Incorrect database information',
55 => 'Sorry, but the database information you entered does not appear to be correct. Please go back and try again.',
diff -r 0021451d31d4 -r 5f9005f9c657 public_html/admin/install/language/german.php
--- a/public_html/admin/install/language/german.php Sun Sep 06 10:23:14 2009 +0200
+++ b/public_html/admin/install/language/german.php Sun Sep 06 11:00:27 2009 +0200
@@ -53,8 +53,8 @@
1 => 'Hilfe zur Installation',
2 => 'Zuverlässigkeit eingebaut',
3 => 'Geeklog-Installation',
- 4 => 'PHP 4.3.0 benötigt',
- 5 => 'Sorry, Geeklog benötigt mindestens PHP 4.3.0 (Du hast Version ',
+ 4 => 'PHP %s benötigt',
+ 5 => 'Sorry, Geeklog benötigt mindestens PHP %s (Du hast Version ',
6 => '). Bitte <a href="http://www.php.net/downloads.php">aktualisiere Deine PHP-Installation</a> oder bitte Deinen Hosting-Provider darum.',
7 => 'Geeklog-Dateien nicht gefunden',
8 => 'Das Installations-Skript hat einige wichtige Geeklog-Dateien nicht gefunden. Wahrscheinlich hast Du diese in andere Verzeichnisse verschoben. Bitte gib hier die Pfade zu den Dateien und Verzeichnissen an:',
@@ -100,8 +100,8 @@
48 => 'Website-Email-Adresse',
49 => '"No Reply"-Email-Adresse',
50 => 'Installieren',
- 51 => 'MySQL 3.23.2 benötigt',
- 52 => 'Sorry, aber Geeklog setzt mindestens MySQL 3.23.2 voraus (Du hast Version ',
+ 51 => 'MySQL %s benötigt',
+ 52 => 'Sorry, aber Geeklog setzt mindestens MySQL %s voraus (Du hast Version ',
53 => '). Bitte <a href="http://dev.mysql.com/downloads/mysql/">aktualisiere Deine MySQL-Version</a> oder bitte Deinen Website-Hoster, es für Dich zu erledigen.',
54 => 'Datenbank-Informationen unvollständig oder nicht korrekt.',
55 => 'Sorry, aber die Datenbank-Informationen, die Du eingegeben hast, scheinen nicht korrekt zu sein. Bitte klicke auf "Zurück" und versuche es noch einmal.',
diff -r 0021451d31d4 -r 5f9005f9c657 public_html/admin/install/language/hebrew_utf-8.php
--- a/public_html/admin/install/language/hebrew_utf-8.php Sun Sep 06 10:23:14 2009 +0200
+++ b/public_html/admin/install/language/hebrew_utf-8.php Sun Sep 06 11:00:27 2009 +0200
@@ -49,8 +49,8 @@
1 => 'ת×××ת ××ª×§× ×',
2 => 'The Ultimate Weblog System',
3 => '××ª×§× ×ª Geeklog',
- 4 => '×ר×ש PHP 4.3.0',
- 5 => '×צ×ער××, ××× Geeklog ××רש ×פ××ת PHP 4.3.0 ×ש××× ×ר××¥ (××× ×ש ×××¨×¡× ',
+ 4 => '×ר×ש PHP %s',
+ 5 => '×צ×ער××, ××× Geeklog ××רש ×פ××ת PHP %s ×ש××× ×ר××¥ (××× ×ש ×××¨×¡× ',
6 => '). ×× × <a href="http://www.php.net/downloads.php">ש×ר×× ×ת ××רסת ×-PHP ש×××</a> ×× ××§×©× ×××ר×× ×שרת ש××× ×עש×ת ××ת ×ש×××××.',
7 => '×× ×××ª×¨× ×ק×צ×× ×©× Geeklog',
8 => '×××ª×§× × ×× ×צ×××× ××תר ×ת ×ק×צ×× ××ש×××× ×©× Geeklog. ×× ×× ×¨×× ××¤× × ×©×××××ª× ×××ª× ×××ק×× ×ר×רת ××××× ×©×××. ×× × ×¦××× × ×ת ×× ×ª×××× ×ק×צ×× ××ספר××ת ××××:',
@@ -96,8 +96,8 @@
48 => '×ת××ת ××××××× ×©× ××תר',
49 => '×ת××ת ××××××× ×©× No-Reply',
50 => '××ª×§× ×',
- 51 => '× ×רש MySQL 3.23.2 ×× ××תר ××ש',
- 52 => '×צ×ער××, ×× Geeklog ××רש ×פ××ת MySQL 3.23.2 ××× ×ר××¥ (××× ×ש ×××¨×¡× ',
+ 51 => '× ×רש MySQL %s ×× ××תר ××ש',
+ 52 => '×צ×ער××, ×× Geeklog ××רש ×פ××ת MySQL %s ××× ×ר××¥ (××× ×ש ×××¨×¡× ',
53 => '). ×× × <a href="http://dev.mysql.com/downloads/mysql/">ש×ר×× ×ת ××רסת ×-MySQL ש×××</a> ×× ××§×©× ×××ר×× ×שרת ש××× ×עש×ת ××ת ×ש×××××.',
54 => '××××¢ ×××ר ×××××¢ ××× × × ×××',
55 => '×צ×ער××, ×× ××××¢ ×××ר ×××××¢ שצ××× ×ª× × ×¨×× ×©×××. ×× × ××××¨× ×× ×¡× ×©××.',
diff -r 0021451d31d4 -r 5f9005f9c657 public_html/admin/install/language/japanese_utf-8.php
--- a/public_html/admin/install/language/japanese_utf-8.php Sun Sep 06 10:23:14 2009 +0200
+++ b/public_html/admin/install/language/japanese_utf-8.php Sun Sep 06 11:00:27 2009 +0200
@@ -55,8 +55,8 @@
1 => 'ã¤ã³ã¹ãã¼ã«ã§å°ã£ããããã¡ãã®ãµã¤ãã¸',
2 => 'The Ultimate Weblog System',
3 => 'Geeklogãã¤ã³ã¹ãã¼ã«ãã',
- 4 => 'PHP 4.3.0以ä¸ãå¿
è¦ã§ã',
- 5 => 'æ®å¿µãªããGeeklogãã¤ã³ã¹ãã¼ã«ããã«ã¯æä½ã§ãPHP 4.3.0ãå¿
è¦ã§ã(ç¾å¨ã®ãã¼ã¸ã§ã³ã¯ ',
+ 4 => 'PHP %s以ä¸ãå¿
è¦ã§ã',
+ 5 => 'æ®å¿µãªããGeeklogãã¤ã³ã¹ãã¼ã«ããã«ã¯æä½ã§ãPHP %sãå¿
è¦ã§ã(ç¾å¨ã®ãã¼ã¸ã§ã³ã¯ ',
6 => ')ãèªåã§<a href="http://www.php.net/downloads.php">PHPããã¼ã¸ã§ã³ã¢ãããã</a>ãããã¹ãã£ã³ã°ä¼ç¤¾ã«ä¾é ¼ãã¦ãã ããã',
7 => 'Geeklogãã¡ã¤ã«ãè¦ã¤ããã¾ãã',
8 => 'Geeklogã®éè¦ãªãã¡ã¤ã«ãè¦ã¤ããã¾ãããããã©ã«ãã®ä½ç½®ãã移åããã¦ããã¨æããã¾ããä¸ã®ããã¹ãããã¯ã¹ã«ãã¡ã¤ã«ã®ãã¹ãå
¥åãã¦ãã ããã:',
@@ -102,8 +102,8 @@
48 => 'ãµã¤ãã®Email',
49 => 'ãµã¤ãã®No-Reply Email',
50 => 'ã¤ã³ã¹ãã¼ã«',
- 51 => 'å°ãªãã¨ãMySQL 3.23.2ãå¿
è¦ã§ã',
- 52 => 'æ®å¿µãªããGeeklogãã¤ã³ã¹ãã¼ã«ããã«ã¯æä½ã§ãMySQL 3.23.2ãå¿
è¦ã§ã(ç¾å¨ã®ãã¼ã¸ã§ã³ã¯ ',
+ 51 => 'å°ãªãã¨ãMySQL %sãå¿
è¦ã§ã',
+ 52 => 'æ®å¿µãªããGeeklogãã¤ã³ã¹ãã¼ã«ããã«ã¯æä½ã§ãMySQL %sãå¿
è¦ã§ã(ç¾å¨ã®ãã¼ã¸ã§ã³ã¯ ',
53 => ')ãèªåã§<a href="http://dev.mysql.com/downloads/mysql/">MySQLãã¢ããã°ã¬ã¼ããã</a>ãããã¹ãã£ã³ã°ä¼ç¤¾ã«ä¾é ¼ãã¦ãã ããã',
54 => 'ãã¼ã¿ãã¼ã¹æ
å ±ãä¸æ£ç¢ºã§ã',
55 => 'æ®å¿µãªããå
¥åãããã¼ã¿ãã¼ã¹æ
å ±ãä¸æ£ç¢ºã§ããæ»ã£ã¦ããç´ãã¦ãã ããã',
diff -r 0021451d31d4 -r 5f9005f9c657 public_html/admin/install/language/polish.php
--- a/public_html/admin/install/language/polish.php Sun Sep 06 10:23:14 2009 +0200
+++ b/public_html/admin/install/language/polish.php Sun Sep 06 11:00:27 2009 +0200
@@ -53,8 +53,8 @@
1 => 'Instalacja Pomoc',
2 => 'The Ultimate Weblog System',
3 => 'Geeklog - Instalacja',
- 4 => 'Wymagane PHP 4.3.0',
- 5 => 'Sorry, ale Geeklog wymaga do uruchomienia co najmniej PHP 4.3.0 (wersja zainstalowana to ',
+ 4 => 'Wymagane PHP %s',
+ 5 => 'Sorry, ale Geeklog wymaga do uruchomienia co najmniej PHP %s (wersja zainstalowana to ',
6 => '). Proszê <a href="http://www.php.net/downloads.php">uaktualniæ wersjê PHP</a> lub zg³osiæ to do swojego providera hostingu.',
7 => 'Nie mo¿na zlokalizowaæ plików Geeklog-a',
8 => 'The installation script was unable to locate critical Geeklog files. This is probably because you have moved them from their default location. Please specify the paths to the files and directories below:',
@@ -100,8 +100,8 @@
48 => 'Adres email strony',
49 => 'Bezzwrotny adres email strony',
50 => 'Instaluj',
- 51 => 'Wymagana baza MySQL 3.23.2',
- 52 => 'Sorry, but Geeklog requires at least MySQL 3.23.2 to run (you have version ',
+ 51 => 'Wymagana baza MySQL %s',
+ 52 => 'Sorry, but Geeklog requires at least MySQL %s to run (you have version ',
53 => '). Please <a href="http://dev.mysql.com/downloads/mysql/">upgrade your MySQL</a> install or ask your hosting service to do it for you.',
54 => 'Ba³êdne informacje o bazie danych',
55 => 'Sorry, but the database information you entered does not appear to be correct. Please go back and try again.',
diff -r 0021451d31d4 -r 5f9005f9c657 public_html/admin/install/lib-install.php
--- a/public_html/admin/install/lib-install.php Sun Sep 06 10:23:14 2009 +0200
+++ b/public_html/admin/install/lib-install.php Sun Sep 06 11:00:27 2009 +0200
@@ -64,6 +64,9 @@
if (!defined('SUPPORTED_PHP_VER')) {
define('SUPPORTED_PHP_VER', '4.3.0');
}
+if (!defined('SUPPORTED_MYSQL_VER')) {
+ define('SUPPORTED_MYSQL_VER', '3.23.2');
+}
$_REQUEST = array_merge($_GET, $_POST);
@@ -273,14 +276,20 @@
*/
function INST_mysqlOutOfDate($db)
{
+ $minv = explode('.', SUPPORTED_MYSQL_VER);
+
if ($db['type'] == 'mysql' || $db['type'] == 'mysql-innodb') {
$myv = mysql_v($db['host'], $db['user'], $db['pass']);
- if (($myv[0] < 3) || (($myv[0] == 3) && ($myv[1] < 23)) ||
- (($myv[0] == 3) && ($myv[1] == 23) && ($myv[2] < 2))) {
+
+ if (($myv[0] < $minv[0]) ||
+ (($myv[0] == $minv[0]) && ($myv[1] < $minv[1])) ||
+ (($myv[0] == $minv[0]) && ($myv[1] == $minv[1]) && ($myv[2] < $minv[2]))) {
+
return true;
}
- return false;
}
+
+ return false;
}
/**
diff -r 0021451d31d4 -r 5f9005f9c657 public_html/admin/install/migrate.php
--- a/public_html/admin/install/migrate.php Sun Sep 06 10:23:14 2009 +0200
+++ b/public_html/admin/install/migrate.php Sun Sep 06 11:00:27 2009 +0200
@@ -258,8 +258,8 @@
if (INST_phpOutOfDate()) {
// If their version of PHP is not supported, print an error:
- $display .= '<h1>' . $LANG_INSTALL[4] . '</h1>' . LB;
- $display .= '<p>' . $LANG_INSTALL[5] . $phpv[0] . '.' . $phpv[1] . '.' . (int) $phpv[2] . $LANG_INSTALL[6] . '</p>' . LB;
+ $display .= '<h1>' . sprintf($LANG_INSTALL[4], SUPPORTED_PHP_VER) . '</h1>' . LB;
+ $display .= '<p>' . sprintf($LANG_INSTALL[5], SUPPORTED_PHP_VER) . $phpv[0] . '.' . $phpv[1] . '.' . (int) $phpv[2] . $LANG_INSTALL[6] . '</p>' . LB;
} else {
@@ -483,7 +483,8 @@
// (needs to connect to MySQL in order to check)
if (INST_mysqlOutOfDate($DB)) {
- $display .= INST_getAlertMsg($LANG_INSTALL[51]);
+ $display .= INST_getAlertMsg(sprintf($LANG_INSTALL[51],
+ SUPPORTED_MYSQL_VER));
$import_errors++;
}
More information about the geeklog-cvs
mailing list