aboutsummaryrefslogtreecommitdiffstats
path: root/admin/intro.php
diff options
context:
space:
mode:
authornikrou <nikrou@piwigo.org>2009-11-20 14:17:04 +0000
committernikrou <nikrou@piwigo.org>2009-11-20 14:17:04 +0000
commit924dd262ec3778277cf1efedee92fa5dd4fb2d32 (patch)
tree05176413aa5b4762dd72477099644c732389f971 /admin/intro.php
parentc020cd0d7cb7710a6ffe04fc8b6d6ccfecb2c466 (diff)
Feature 1244 resolved
Replace all mysql functions in core code by ones independant of database engine Fix small php code synxtax : hash must be accessed with [ ] and not { }. git-svn-id: http://piwigo.org/svn/trunk@4325 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--admin/intro.php46
1 files changed, 24 insertions, 22 deletions
diff --git a/admin/intro.php b/admin/intro.php
index d2549b5db..c081e8918 100644
--- a/admin/intro.php
+++ b/admin/intro.php
@@ -53,24 +53,24 @@ if (isset($_GET['action']) and 'check_upgrade' == $_GET['action'])
// if the current version is a BSF (development branch) build, we check
// the first line, for stable versions, we check the second line
- if (preg_match('/^BSF/', $versions{'current'}))
+ if (preg_match('/^BSF/', $versions['current']))
{
- $versions{'latest'} = trim($lines[0]);
+ $versions['latest'] = trim($lines[0]);
// because integer are limited to 4,294,967,296 we need to split BSF
// versions in date.time
foreach ($versions as $key => $value)
{
- $versions{$key} =
+ $versions[$key] =
preg_replace('/BSF_(\d{8})(\d{4})/', '$1.$2', $value);
}
}
else
{
- $versions{'latest'} = trim($lines[1]);
+ $versions['latest'] = trim($lines[1]);
}
- if ('' == $versions{'latest'})
+ if ('' == $versions['latest'])
{
array_push(
$page['errors'],
@@ -79,14 +79,14 @@ if (isset($_GET['action']) and 'check_upgrade' == $_GET['action'])
}
// concatenation needed to avoid automatic transformation by release
// script generator
- else if ('%'.'PWGVERSION'.'%' == $versions{'current'})
+ else if ('%'.'PWGVERSION'.'%' == $versions['current'])
{
array_push(
$page['infos'],
l10n('You are running on development sources, no check possible.')
);
}
- else if (version_compare($versions{'current'}, $versions{'latest'}) < 0)
+ else if (version_compare($versions['current'], $versions['latest']) < 0)
{
array_push(
$page['infos'],
@@ -125,69 +125,70 @@ if ($conf['show_newsletter_subscription']) {
}
$php_current_timestamp = date("Y-m-d H:i:s");
-list($mysql_version, $db_current_timestamp) = mysql_fetch_row(pwg_query('SELECT VERSION(), CURRENT_TIMESTAMP;'));
+$db_version = pwg_get_db_version();
+list($db_current_timestamp) = pwg_db_fetch_row(pwg_query('SELECT CURRENT_TIMESTAMP;'));
$query = '
SELECT COUNT(*)
FROM '.IMAGES_TABLE.'
;';
-list($nb_elements) = mysql_fetch_row(pwg_query($query));
+list($nb_elements) = pwg_db_fetch_row(pwg_query($query));
$query = '
SELECT COUNT(*)
FROM '.CATEGORIES_TABLE.'
;';
-list($nb_categories) = mysql_fetch_row(pwg_query($query));
+list($nb_categories) = pwg_db_fetch_row(pwg_query($query));
$query = '
SELECT COUNT(*)
FROM '.CATEGORIES_TABLE.'
WHERE dir IS NULL
;';
-list($nb_virtual) = mysql_fetch_row(pwg_query($query));
+list($nb_virtual) = pwg_db_fetch_row(pwg_query($query));
$query = '
SELECT COUNT(*)
FROM '.CATEGORIES_TABLE.'
WHERE dir IS NOT NULL
;';
-list($nb_physical) = mysql_fetch_row(pwg_query($query));
+list($nb_physical) = pwg_db_fetch_row(pwg_query($query));
$query = '
SELECT COUNT(*)
FROM '.IMAGE_CATEGORY_TABLE.'
;';
-list($nb_image_category) = mysql_fetch_row(pwg_query($query));
+list($nb_image_category) = pwg_db_fetch_row(pwg_query($query));
$query = '
SELECT COUNT(*)
FROM '.TAGS_TABLE.'
;';
-list($nb_tags) = mysql_fetch_row(pwg_query($query));
+list($nb_tags) = pwg_db_fetch_row(pwg_query($query));
$query = '
SELECT COUNT(*)
FROM '.IMAGE_TAG_TABLE.'
;';
-list($nb_image_tag) = mysql_fetch_row(pwg_query($query));
+list($nb_image_tag) = pwg_db_fetch_row(pwg_query($query));
$query = '
SELECT COUNT(*)
FROM '.USERS_TABLE.'
;';
-list($nb_users) = mysql_fetch_row(pwg_query($query));
+list($nb_users) = pwg_db_fetch_row(pwg_query($query));
$query = '
SELECT COUNT(*)
FROM '.GROUPS_TABLE.'
;';
-list($nb_groups) = mysql_fetch_row(pwg_query($query));
+list($nb_groups) = pwg_db_fetch_row(pwg_query($query));
$query = '
SELECT COUNT(*)
FROM '.COMMENTS_TABLE.'
;';
-list($nb_comments) = mysql_fetch_row(pwg_query($query));
+list($nb_comments) = pwg_db_fetch_row(pwg_query($query));
$template->assign(
array(
@@ -195,7 +196,8 @@ $template->assign(
'PWG_VERSION' => PHPWG_VERSION,
'OS' => PHP_OS,
'PHP_VERSION' => phpversion(),
- 'MYSQL_VERSION' => $mysql_version,
+ 'DB_ENGINE' => 'MySQL',
+ 'DB_VERSION' => $db_version,
'DB_ELEMENTS' => l10n_dec('%d element', '%d elements', $nb_elements),
'DB_CATEGORIES' =>
l10n_dec('cat_inclu_part1_S', 'cat_inclu_part1_P',
@@ -223,7 +225,7 @@ if ($nb_elements > 0)
SELECT MIN(date_available)
FROM '.IMAGES_TABLE.'
;';
- list($first_date) = mysql_fetch_row(pwg_query($query));
+ list($first_date) = pwg_db_fetch_row(pwg_query($query));
$template->assign(
'first_added',
@@ -243,7 +245,7 @@ SELECT COUNT(*)
FROM '.WAITING_TABLE.'
WHERE validated=\'false\'
;';
-list($nb_waiting) = mysql_fetch_row(pwg_query($query));
+list($nb_waiting) = pwg_db_fetch_row(pwg_query($query));
if ($nb_waiting > 0)
{
@@ -262,7 +264,7 @@ SELECT COUNT(*)
FROM '.COMMENTS_TABLE.'
WHERE validated=\'false\'
;';
-list($nb_comments) = mysql_fetch_row(pwg_query($query));
+list($nb_comments) = pwg_db_fetch_row(pwg_query($query));
if ($nb_comments > 0)
{