diff options
author | rub <rub@piwigo.org> | 2008-05-16 18:59:37 +0000 |
---|---|---|
committer | rub <rub@piwigo.org> | 2008-05-16 18:59:37 +0000 |
commit | dc2adc5b614a43179eda505eb13d0de5f6fa10d2 (patch) | |
tree | b2a91f1734684f5e3286408892a6c5416f842dec /admin | |
parent | 3cffa07182c016d29d82666e03a1423fb6160bd8 (diff) |
Resolved issue 0000826: Required versions (Php & MySql)
git-svn-id: http://piwigo.org/svn/trunk@2343 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | admin/include/c13y_internal.class.php | 35 |
1 files changed, 33 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) |