Correctly save and pass on the charset

Signed-off-by: Joas Schilling <coding@schilljs.com>
pull/1773/head
Joas Schilling 8 years ago committed by Morris Jobke
parent d294ef23dd
commit 9356a0e583
No known key found for this signature in database
GPG Key ID: 9CE5ED29E7FCD38A

@ -67,7 +67,7 @@ class ConnectionFactory {
public function __construct(IConfig $config) {
if($config->getSystemValue('mysql.utf8mb4', false)) {
$defaultConnectionParams['mysql']['charset'] = 'utf8mb4';
$this->defaultConnectionParams['mysql']['charset'] = 'utf8mb4';
}
}
@ -106,7 +106,9 @@ class ConnectionFactory {
case 'mysql':
// 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
$eventManager->addEventSubscriber(new MysqlSessionInit);
$eventManager->addEventSubscriber(new MysqlSessionInit(
$this->defaultConnectionParams['mysql']['charset']
));
$eventManager->addEventSubscriber(
new SQLSessionInit("SET SESSION AUTOCOMMIT=1"));
break;

Loading…
Cancel
Save