From 73db66afa58cb14c6ced4163c10f4603a3399428 Mon Sep 17 00:00:00 2001 From: plegall Date: Wed, 28 Apr 2010 14:28:05 +0000 Subject: feature 1630: upgrade to Piwigo 2.1 :-) bug 1604: only activate core themes not all themes. git-svn-id: http://piwigo.org/svn/trunk@5982 68402e56-0260-453c-a942-63ccdbb3a9ee --- include/dblayer/functions_mysql.inc.php | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) (limited to 'include/dblayer/functions_mysql.inc.php') diff --git a/include/dblayer/functions_mysql.inc.php b/include/dblayer/functions_mysql.inc.php index 437d603bd..3160e1902 100644 --- a/include/dblayer/functions_mysql.inc.php +++ b/include/dblayer/functions_mysql.inc.php @@ -52,18 +52,26 @@ function pwg_db_connect($host, $user, $password, $database) function pwg_db_check_charset() { - defined('PWG_CHARSET') and defined('DB_CHARSET') - or fatal_error('PWG_CHARSET and/or DB_CHARSET is not defined'); - if ( version_compare(mysql_get_server_info(), '4.1.0', '>=') ) + $db_charset = 'utf8'; + if (defined('DB_CHARSET') and DB_CHARSET != '') { - if (DB_CHARSET!='') - { - pwg_query('SET NAMES "'.DB_CHARSET.'"'); - } + $db_charset = DB_CHARSET; } - elseif ( strtolower(PWG_CHARSET)!='iso-8859-1' ) + pwg_query('SET NAMES "'.$db_charset.'"'); +} + +function pwg_db_check_version() +{ + $current_mysql = pwg_get_db_version(); + if (version_compare($current_mysql, REQUIRED_MYSQL_VERSION, '<')) { - fatal_error('PWG supports only iso-8859-1 charset on MySql version '.mysql_get_server_info()); + fatal_error( + sprintf( + 'your MySQL version is too old, you have "%s" and you need at least "%s"', + $current_mysql, + REQUIRED_MYSQL_VERSION + ) + ); } } -- cgit v1.2.3