From 4df6feecae06fcabced2ff868585582eb62f70b3 Mon Sep 17 00:00:00 2001 From: e107steved Date: Thu, 7 Jan 2010 21:05:24 +0000 Subject: [PATCH] Get rid of direct mysql calls --- .../shortcode/batch/admin_shortcodes_class.php | 12 ++++++++++-- e107_handlers/mysql_class.php | 11 +++++++---- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/e107_files/shortcode/batch/admin_shortcodes_class.php b/e107_files/shortcode/batch/admin_shortcodes_class.php index 9ba9c4716..62ee6c3f0 100644 --- a/e107_files/shortcode/batch/admin_shortcodes_class.php +++ b/e107_files/shortcode/batch/admin_shortcodes_class.php @@ -1,10 +1,18 @@
".FOOTLAN_12."
- ".mysql_get_server_info(). + ".e107::getDB()->mySqlServerInfo. "
".FOOTLAN_16.": ".$mySQLdefaultdb."

diff --git a/e107_handlers/mysql_class.php b/e107_handlers/mysql_class.php index 1acf5031b..9320aa8ea 100644 --- a/e107_handlers/mysql_class.php +++ b/e107_handlers/mysql_class.php @@ -9,8 +9,8 @@ * mySQL Handler * * $Source: /cvs_backup/e107_0.8/e107_handlers/mysql_class.php,v $ - * $Revision: 1.74 $ - * $Date: 2010-01-05 22:00:41 $ + * $Revision: 1.75 $ + * $Date: 2010-01-07 21:05:24 $ * $Author: e107steved $ */ @@ -20,7 +20,7 @@ * * @package e107 * @subpackage e107_handlers - * @version $Id: mysql_class.php,v 1.74 2010-01-05 22:00:41 e107steved Exp $; + * @version $Id: mysql_class.php,v 1.75 2010-01-07 21:05:24 e107steved Exp $; * * @todo separate cache for db type tables */ @@ -94,6 +94,7 @@ class e_db_mysql * @var string */ public $mySQLcharset; + public $mySqlServerInfo = '?'; // Server info - needed for various things public $total_results = false; // Total number of results @@ -170,6 +171,8 @@ class e_db_mysql } } + $this->mySqlServerInfo = mysql_get_server_info(); // We always need this for db_Set_Charset() - so make generally available + // Set utf8 connection? //@TODO: simplify when yet undiscovered side-effects will be fixed $this->db_Set_Charset(); @@ -1507,7 +1510,7 @@ class e_db_mysql else { // Check if MySQL version is utf8 compatible - preg_match('/^(.*?)($|-)/', mysql_get_server_info(), $mysql_version); + preg_match('/^(.*?)($|-)/', $this->mySqlServerInfo, $mysql_version); if (version_compare($mysql_version[1], '4.1.2', '<')) { // reset utf8