Skip to content

Commit

Permalink
Resolved issue 0000826: Required versions (Php & MySql)
Browse files Browse the repository at this point in the history
git-svn-id: http://piwigo.org/svn/trunk@2343 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
rub committed May 16, 2008
1 parent 3cffa07 commit dc2adc5
Show file tree
Hide file tree
Showing 6 changed files with 46 additions and 2 deletions.
35 changes: 33 additions & 2 deletions admin/include/c13y_internal.class.php
Expand Up @@ -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)
Expand All @@ -57,7 +88,7 @@ function c13y_exif($c13y)
/**
* Check user
*
* @param void
* @param c13y object
* @return void
*/
function c13y_user($c13y)
Expand Down
4 changes: 4 additions & 0 deletions include/constants.php
Expand Up @@ -29,6 +29,10 @@
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);
Expand Down
3 changes: 3 additions & 0 deletions language/en_UK/admin.lang.php
Expand Up @@ -643,4 +643,7 @@
$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';

?>
2 changes: 2 additions & 0 deletions language/es_ES/admin.lang.php
Expand Up @@ -649,5 +649,7 @@
$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';

?>
2 changes: 2 additions & 0 deletions language/fr_FR/admin.lang.php
Expand Up @@ -643,5 +643,7 @@
$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';

?>
2 changes: 2 additions & 0 deletions language/nl_NL/admin.lang.php
Expand Up @@ -649,5 +649,7 @@
$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';

?>

0 comments on commit dc2adc5

Please sign in to comment.