forked from GNUsocial/gnu-social
optionally use SET NAMES for utf8 to DB
This commit is contained in:
parent
b3bb8943f5
commit
d068680e19
4
README
4
README
@ -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
|
and adding the slaves to this array. Note that if you want some
|
||||||
requests to go to the 'database' (master) server, you'll need
|
requests to go to the 'database' (master) server, you'll need
|
||||||
to include it in this array, too.
|
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
|
syslog
|
||||||
------
|
------
|
||||||
|
@ -239,8 +239,10 @@ class Memcached_DataObject extends DB_DataObject
|
|||||||
$result = parent::_connect();
|
$result = parent::_connect();
|
||||||
if (!$exists) {
|
if (!$exists) {
|
||||||
$DB = &$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5];
|
$DB = &$_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5];
|
||||||
|
if (common_config('db', 'utf8')) {
|
||||||
$DB->query('SET NAMES "utf8"');
|
$DB->query('SET NAMES "utf8"');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -167,6 +167,7 @@ $config['db'] =
|
|||||||
'require_prefix' => 'classes/',
|
'require_prefix' => 'classes/',
|
||||||
'class_prefix' => '',
|
'class_prefix' => '',
|
||||||
'mirror' => null,
|
'mirror' => null,
|
||||||
|
'utf8' => true,
|
||||||
'db_driver' => 'DB', # XXX: JanRain libs only work with DB
|
'db_driver' => 'DB', # XXX: JanRain libs only work with DB
|
||||||
'quote_identifiers' => false,
|
'quote_identifiers' => false,
|
||||||
'type' => 'mysql' );
|
'type' => 'mysql' );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user