diff options
author | Evan Prodromou <evan@controlyourself.ca> | 2009-05-27 14:57:45 -0400 |
---|---|---|
committer | Evan Prodromou <evan@controlyourself.ca> | 2009-05-27 14:57:45 -0400 |
commit | d068680e1913a32eba0f5b0e1e746ac66ec638d3 (patch) | |
tree | 10ed4b25cdee14cc1449e13e2b39e7ec88544d8e | |
parent | b3bb8943f592de9f6936f35be49a88c641bf6da1 (diff) |
optionally use SET NAMES for utf8 to DB
-rw-r--r-- | README | 4 | ||||
-rw-r--r-- | classes/Memcached_DataObject.php | 4 | ||||
-rw-r--r-- | lib/common.php | 1 |
3 files changed, 8 insertions, 1 deletions
@@ -906,6 +906,10 @@ mirror: you can set this to an array of DSNs, like the above and adding the slaves to this array. Note that if you want some requests to go to the 'database' (master) server, you'll need to include it in this array, too. +utf8: whether to talk to the database in UTF-8 mode. This is the default + with new installations, but older sites may want to turn it off + until they get their databases fixed up. See "UTF-8 database" + above for details. syslog ------ diff --git a/classes/Memcached_DataObject.php b/classes/Memcached_DataObject.php index 877bbf2e0..52ad4100f 100644 --- a/classes/Memcached_DataObject.php +++ b/classes/Memcached_DataObject.php @@ -239,7 +239,9 @@ class Memcached_DataObject extends DB_DataObject $result = parent::_connect(); if (!$exists) { $DB = &$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]; - $DB->query('SET NAMES "utf8"'); + if (common_config('db', 'utf8')) { + $DB->query('SET NAMES "utf8"'); + } } return $result; } diff --git a/lib/common.php b/lib/common.php index f983c4d16..8f95c2361 100644 --- a/lib/common.php +++ b/lib/common.php @@ -167,6 +167,7 @@ $config['db'] = 'require_prefix' => 'classes/', 'class_prefix' => '', 'mirror' => null, + 'utf8' => true, 'db_driver' => 'DB', # XXX: JanRain libs only work with DB 'quote_identifiers' => false, 'type' => 'mysql' ); |