[geeklog-cvs] geeklog: Minor code cleanup
geeklog-cvs at lists.geeklog.net
geeklog-cvs at lists.geeklog.net
Sun Oct 5 12:24:20 EDT 2008
details: http://project.geeklog.net/cgi-bin/hgweb.cgi/rev/f41761b1c244
changeset: 6429:f41761b1c244
user: Dirk Haun <dirk at haun-online.de>
date: Sun Oct 05 18:24:06 2008 +0200
description:
Minor code cleanup
diffstat:
1 file changed, 7 insertions(+), 13 deletions(-)
public_html/admin/install/index.php | 20 +++++++-------------
diffs (48 lines):
diff -r 740473084c93 -r f41761b1c244 public_html/admin/install/index.php
--- a/public_html/admin/install/index.php Sun Oct 05 16:54:06 2008 +0200
+++ b/public_html/admin/install/index.php Sun Oct 05 18:24:06 2008 +0200
@@ -82,17 +82,11 @@
if (@mysql_connect($_DB_host, $_DB_user, $_DB_pass) === false) {
return false;
}
- $mysqlv = '';
- // mysql_get_server_info() is only available as of PHP 4.0.5
- $phpv = php_v ();
- if (($phpv[0] > 4) || (($phpv[0] == 4) && ($phpv[1] > 0)) ||
- (($phpv[0] == 4) && ($phpv[1] == 0) && ($phpv[2] > 4))) {
- $mysqlv = @mysql_get_server_info();
- }
+ $mysqlv = @mysql_get_server_info();
- if (!empty ($mysqlv)) {
- preg_match ('/^([0-9]+).([0-9]+).([0-9]+)/', $mysqlv, $match);
+ if (!empty($mysqlv)) {
+ preg_match('/^([0-9]+).([0-9]+).([0-9]+)/', $mysqlv, $match);
$mysqlmajorv = $match[1];
$mysqlminorv = $match[2];
$mysqlrev = $match[3];
@@ -101,9 +95,9 @@
$mysqlminorv = 0;
$mysqlrev = 0;
}
- @mysql_close ();
+ @mysql_close();
- return array ($mysqlmajorv, $mysqlminorv, $mysqlrev);
+ return array($mysqlmajorv, $mysqlminorv, $mysqlrev);
}
@@ -202,9 +196,9 @@
}
if (!empty($version) && ($version != VERSION) &&
- (substr($version, 0, 4) == '1.5.')) {
+ (version_compare($version, '1.5.0') >= 0)) {
- // this is a 1.5.x version, so upgrade directly
+ // current version is at least 1.5.0, so upgrade directly
$req_string = 'index.php?mode=upgrade&step=3'
. '&dbconfig_path=' . $dbconfig_path
. '&version=' . $version;
More information about the geeklog-cvs
mailing list