aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrub <rub@piwigo.org>2008-05-16 18:59:37 +0000
committerrub <rub@piwigo.org>2008-05-16 18:59:37 +0000
commitdc2adc5b614a43179eda505eb13d0de5f6fa10d2 (patch)
treeb2a91f1734684f5e3286408892a6c5416f842dec
parent3cffa07182c016d29d82666e03a1423fb6160bd8 (diff)
Resolved issue 0000826: Required versions (Php & MySql)
git-svn-id: http://piwigo.org/svn/trunk@2343 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r--admin/include/c13y_internal.class.php35
-rw-r--r--include/constants.php4
-rw-r--r--language/en_UK/admin.lang.php3
-rw-r--r--language/es_ES/admin.lang.php2
-rw-r--r--language/fr_FR/admin.lang.php2
-rw-r--r--language/nl_NL/admin.lang.php2
6 files changed, 46 insertions, 2 deletions
diff --git a/admin/include/c13y_internal.class.php b/admin/include/c13y_internal.class.php
index 747c40923..2e2c309b5 100644
--- a/admin/include/c13y_internal.class.php
+++ b/admin/include/c13y_internal.class.php
@@ -25,14 +25,45 @@ class c13y_internal
{
function c13y_internal()
{
+ add_event_handler('list_check_integrity', array(&$this, 'c13y_version'));
add_event_handler('list_check_integrity', array(&$this, 'c13y_exif'));
add_event_handler('list_check_integrity', array(&$this, 'c13y_user'));
}
/**
+ * Check version
+ *
+ * @param c13y object
+ * @return void
+ */
+ function c13y_version($c13y)
+ {
+ $check_list = array();
+
+ $check_list[] = array('type' => 'PHP', 'current' => phpversion(), 'required' => REQUIRED_PHP_VERSION);
+
+ list($mysql_version) = mysql_fetch_row(pwg_query('SELECT VERSION();'));
+ $check_list[] = array('type' => 'MySQL', 'current' => $mysql_version, 'required' => REQUIRED_MYSQL_VERSION);
+
+ foreach ($check_list as $elem)
+ {
+ if (version_compare($elem['current'], $elem['required'], '<'))
+ {
+ $c13y->add_anomaly(
+ sprintf(l10n('c13y_version_anomaly'), $elem['type'], $elem['current'], $elem['required']),
+ null,
+ null,
+ l10n('c13y_version_correction')
+ .'<BR />'.
+ $c13y->get_htlm_links_more_info());
+ }
+ }
+ }
+
+ /**
* Check exif
*
- * @param void
+ * @param c13y object
* @return void
*/
function c13y_exif($c13y)
@@ -57,7 +88,7 @@ class c13y_internal
/**
* Check user
*
- * @param void
+ * @param c13y object
* @return void
*/
function c13y_user($c13y)
diff --git a/include/constants.php b/include/constants.php
index 6b05d683a..42854a9d4 100644
--- a/include/constants.php
+++ b/include/constants.php
@@ -29,6 +29,10 @@ define('PEM_URL', 'http://' . PHPWG_DOMAIN . '/ext');
define('PHPWG_DEFAULT_LANGUAGE', 'en_UK');
define('PHPWG_DEFAULT_TEMPLATE', 'yoga/clear');
+// Required versions
+define('REQUIRED_PHP_VERSION', '5.0.0');
+define('REQUIRED_MYSQL_VERSION', '4.1.22');
+
// Error codes
define('GENERAL_MESSAGE', 200);
define('GENERAL_ERROR', 202);
diff --git a/language/en_UK/admin.lang.php b/language/en_UK/admin.lang.php
index 58c0f078f..bf2354185 100644
--- a/language/en_UK/admin.lang.php
+++ b/language/en_UK/admin.lang.php
@@ -643,4 +643,7 @@ $lang['A new version of Piwigo is available.'] = 'A new version of Piwigo is ava
$lang['Piwigo Administration'] = 'Piwigo Administration';
$lang['Piwigo version'] = 'Piwigo version';
$lang['You are running the latest version of Piwigo.'] = 'You are running the latest version of Piwigo.';
+$lang['c13y_version_anomaly'] = 'The version of %s [%s] installed is not compatible with the version required [%s]';
+$lang['c13y_version_correction'] = 'You need to upgrade your system to take full advantage of the application else the application will not work correctly see not at all';
+
?>
diff --git a/language/es_ES/admin.lang.php b/language/es_ES/admin.lang.php
index 9d9d78807..f671257e6 100644
--- a/language/es_ES/admin.lang.php
+++ b/language/es_ES/admin.lang.php
@@ -649,5 +649,7 @@ $lang['A new version of Piwigo is available.'] = 'Una nueva versión de Piwigo e
$lang['Piwigo Administration'] = 'Administración de Piwigo';
$lang['Piwigo version'] = 'Versión de Piwigo';
$lang['You are running the latest version of Piwigo.'] = 'Usted utiliza la última versión de Piwigo.';
+/* TODO */ $lang['c13y_version_anomaly'] = 'The version of %s [%s] installed is not compatible with the version required [%s]';
+/* TODO */ $lang['c13y_version_correction'] = 'You need to upgrade your system to take full advantage of the application else the application will not work correctly see not at all';
?>
diff --git a/language/fr_FR/admin.lang.php b/language/fr_FR/admin.lang.php
index 85006f6c2..2ac12d560 100644
--- a/language/fr_FR/admin.lang.php
+++ b/language/fr_FR/admin.lang.php
@@ -643,5 +643,7 @@ $lang['A new version of Piwigo is available.'] = 'Une nouvelle version de Piwigo
$lang['Piwigo Administration'] = 'Administration de Piwigo';
$lang['Piwigo version'] = 'Version de Piwigo';
$lang['You are running the latest version of Piwigo.'] = 'Vous utilisez la dernière version de Piwigo.';
+$lang['c13y_version_anomaly'] = 'La version de %s [%s] installée n\'est pas compatible avec la version requise [%s]';
+$lang['c13y_version_correction'] = 'Vous devez mettre à jour votre système pour profiter pleinement de l\'application sinon l\'application ne fonctionnera pas correctement voir pas du tout';
?>
diff --git a/language/nl_NL/admin.lang.php b/language/nl_NL/admin.lang.php
index 6c095c45d..069abdbe8 100644
--- a/language/nl_NL/admin.lang.php
+++ b/language/nl_NL/admin.lang.php
@@ -649,5 +649,7 @@ $lang['A new version of Piwigo is available.'] = 'Een nieuwere versie van Piwigo
$lang['Piwigo Administration'] = 'Piwigo Beheer';
$lang['Piwigo version'] = 'Piwigo versie';
$lang['You are running the latest version of Piwigo.'] = 'Je hebt de laatste versie van Piwigo.';
+/* TODO */ $lang['c13y_version_anomaly'] = 'The version of %s [%s] installed is not compatible with the version required [%s]';
+/* TODO */ $lang['c13y_version_correction'] = 'You need to upgrade your system to take full advantage of the application else the application will not work correctly see not at all';
?>