summaryrefslogtreecommitdiff
path: root/classes/Memcached_DataObject.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-06-08 11:55:32 -0700
committerEvan Prodromou <evan@controlyourself.ca>2009-06-08 11:55:32 -0700
commitadfb79a9bbdfb43f35c0f022c1de6118b10ce115 (patch)
treee14ec0cc5161cfd5cc321eaaa5b8eed07df952de /classes/Memcached_DataObject.php
parent1a126032efbcb265a59f4d682bd072251f857c97 (diff)
parent265e2bd58de2a01e0d7840310eb44b21b70e3914 (diff)
Merge branch '0.7.x' into 0.8.x
Conflicts: classes/Notice.php classes/Profile.php lib/common.php lib/util.php scripts/getvaliddaemons.php scripts/stopdaemons.sh
Diffstat (limited to 'classes/Memcached_DataObject.php')
-rw-r--r--classes/Memcached_DataObject.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/classes/Memcached_DataObject.php b/classes/Memcached_DataObject.php
index 52ad4100f..33ac70dd0 100644
--- a/classes/Memcached_DataObject.php
+++ b/classes/Memcached_DataObject.php
@@ -239,8 +239,14 @@ class Memcached_DataObject extends DB_DataObject
$result = parent::_connect();
if (!$exists) {
$DB = &$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5];
- if (common_config('db', 'utf8')) {
- $DB->query('SET NAMES "utf8"');
+ if (common_config('db', 'type') == 'mysql' &&
+ common_config('db', 'utf8')) {
+ $conn = $DB->connection;
+ if ($DB instanceof DB_mysqli) {
+ mysqli_set_charset($conn, 'utf8');
+ } else if ($DB instanceof DB_mysql) {
+ mysql_set_charset('utf8', $conn);
+ }
}
}
return $result;