Correctly save and pass on the charset
Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
parent
d294ef23dd
commit
9356a0e583
|
@ -67,7 +67,7 @@ class ConnectionFactory {
|
||||||
|
|
||||||
public function __construct(IConfig $config) {
|
public function __construct(IConfig $config) {
|
||||||
if($config->getSystemValue('mysql.utf8mb4', false)) {
|
if($config->getSystemValue('mysql.utf8mb4', false)) {
|
||||||
$defaultConnectionParams['mysql']['charset'] = 'utf8mb4';
|
$this->defaultConnectionParams['mysql']['charset'] = 'utf8mb4';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -106,7 +106,9 @@ class ConnectionFactory {
|
||||||
case 'mysql':
|
case 'mysql':
|
||||||
// Send "SET NAMES utf8". Only required on PHP 5.3 below 5.3.6.
|
// Send "SET NAMES utf8". Only required on PHP 5.3 below 5.3.6.
|
||||||
// See http://stackoverflow.com/questions/4361459/php-pdo-charset-set-names#4361485
|
// See http://stackoverflow.com/questions/4361459/php-pdo-charset-set-names#4361485
|
||||||
$eventManager->addEventSubscriber(new MysqlSessionInit);
|
$eventManager->addEventSubscriber(new MysqlSessionInit(
|
||||||
|
$this->defaultConnectionParams['mysql']['charset']
|
||||||
|
));
|
||||||
$eventManager->addEventSubscriber(
|
$eventManager->addEventSubscriber(
|
||||||
new SQLSessionInit("SET SESSION AUTOCOMMIT=1"));
|
new SQLSessionInit("SET SESSION AUTOCOMMIT=1"));
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue