Changeset 5982 for trunk/include/dblayer


Ignore:
Timestamp:
Apr 28, 2010, 4:28:05 PM (14 years ago)
Author:
plg
Message:

feature 1630: upgrade to Piwigo 2.1 :-)

bug 1604: only activate core themes not all themes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/dblayer/functions_mysql.inc.php

    r5782 r5982  
    5353function pwg_db_check_charset()
    5454{
    55   defined('PWG_CHARSET') and defined('DB_CHARSET')
    56     or fatal_error('PWG_CHARSET and/or DB_CHARSET is not defined');
    57   if ( version_compare(mysql_get_server_info(), '4.1.0', '>=') )
    58   {
    59     if (DB_CHARSET!='')
    60     {
    61       pwg_query('SET NAMES "'.DB_CHARSET.'"');
    62     }
    63   }
    64   elseif ( strtolower(PWG_CHARSET)!='iso-8859-1' )
    65   {
    66     fatal_error('PWG supports only iso-8859-1 charset on MySql version '.mysql_get_server_info());
     55  $db_charset = 'utf8';
     56  if (defined('DB_CHARSET') and DB_CHARSET != '')
     57  {
     58    $db_charset = DB_CHARSET;
     59  }
     60  pwg_query('SET NAMES "'.$db_charset.'"');
     61}
     62
     63function pwg_db_check_version()
     64{
     65  $current_mysql = pwg_get_db_version();
     66  if (version_compare($current_mysql, REQUIRED_MYSQL_VERSION, '<'))
     67  {
     68    fatal_error(
     69      sprintf(
     70        'your MySQL version is too old, you have "%s" and you need at least "%s"',
     71        $current_mysql,
     72        REQUIRED_MYSQL_VERSION
     73        )
     74      );
    6775  }
    6876}
Note: See TracChangeset for help on using the changeset viewer.