Changeset 2343


Ignore:
Timestamp:
May 16, 2008, 8:59:37 PM (16 years ago)
Author:
rub
Message:

Resolved issue 0000826: Required versions (Php & MySql)

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/admin/include/c13y_internal.class.php

    r2299 r2343  
    2626  function c13y_internal()
    2727  {
     28    add_event_handler('list_check_integrity', array(&$this, 'c13y_version'));
    2829    add_event_handler('list_check_integrity', array(&$this, 'c13y_exif'));
    2930    add_event_handler('list_check_integrity', array(&$this, 'c13y_user'));
     
    3132
    3233  /**
     34   * Check version
     35   *
     36   * @param c13y object
     37   * @return void
     38   */
     39  function c13y_version($c13y)
     40  {
     41    $check_list = array();
     42
     43    $check_list[] = array('type' => 'PHP', 'current' => phpversion(), 'required' => REQUIRED_PHP_VERSION);
     44
     45    list($mysql_version) = mysql_fetch_row(pwg_query('SELECT VERSION();'));
     46    $check_list[] = array('type' => 'MySQL', 'current' => $mysql_version, 'required' => REQUIRED_MYSQL_VERSION);
     47
     48    foreach ($check_list as $elem)
     49    {
     50      if (version_compare($elem['current'], $elem['required'], '<'))
     51      {
     52        $c13y->add_anomaly(
     53          sprintf(l10n('c13y_version_anomaly'), $elem['type'], $elem['current'], $elem['required']),
     54          null,
     55          null,
     56          l10n('c13y_version_correction')
     57          .'<BR />'.
     58          $c13y->get_htlm_links_more_info());
     59      }
     60    }
     61  }
     62
     63  /**
    3364   * Check exif
    3465   *
    35    * @param void
     66   * @param c13y object
    3667   * @return void
    3768   */
     
    5889   * Check user
    5990   *
    60    * @param void
     91   * @param c13y object
    6192   * @return void
    6293   */
  • trunk/include/constants.php

    r2325 r2343  
    2929define('PHPWG_DEFAULT_LANGUAGE', 'en_UK');
    3030define('PHPWG_DEFAULT_TEMPLATE', 'yoga/clear');
     31
     32// Required versions
     33define('REQUIRED_PHP_VERSION', '5.0.0');
     34define('REQUIRED_MYSQL_VERSION', '4.1.22');
    3135
    3236// Error codes
  • trunk/language/en_UK/admin.lang.php

    r2342 r2343  
    644644$lang['Piwigo version'] = 'Piwigo version';
    645645$lang['You are running the latest version of Piwigo.'] = 'You are running the latest version of Piwigo.';
     646$lang['c13y_version_anomaly'] = 'The version of %s [%s] installed is not compatible with the version required [%s]';
     647$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';
     648
    646649?>
  • trunk/language/es_ES/admin.lang.php

    r2342 r2343  
    650650$lang['Piwigo version'] = 'Versión de Piwigo';
    651651$lang['You are running the latest version of Piwigo.'] = 'Usted utiliza la última versión de Piwigo.';
     652/* TODO */ $lang['c13y_version_anomaly'] = 'The version of %s [%s] installed is not compatible with the version required [%s]';
     653/* 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';
    652654
    653655?>
  • trunk/language/fr_FR/admin.lang.php

    r2342 r2343  
    644644$lang['Piwigo version'] = 'Version de Piwigo';
    645645$lang['You are running the latest version of Piwigo.'] = 'Vous utilisez la dernière version de Piwigo.';
     646$lang['c13y_version_anomaly'] = 'La version de %s [%s] installée n\'est pas compatible avec la version requise [%s]';
     647$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';
    646648
    647649?>
  • trunk/language/nl_NL/admin.lang.php

    r2342 r2343  
    650650$lang['Piwigo version'] = 'Piwigo versie';
    651651$lang['You are running the latest version of Piwigo.'] = 'Je hebt de laatste versie van Piwigo.';
     652/* TODO */ $lang['c13y_version_anomaly'] = 'The version of %s [%s] installed is not compatible with the version required [%s]';
     653/* 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';
    652654
    653655?>
Note: See TracChangeset for help on using the changeset viewer.