Created
June 3, 2012 13:33
-
-
Save Ocramius/2863521 to your computer and use it in GitHub Desktop.
Setting up Doctrine DBAL to use UTF-8 in MySQL connections
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use Doctrine\DBAL\Event\Listeners\MysqlSessionInit; | |
/* ... */ | |
if( | |
isset($options['encoding']) | |
&& $this->_em->getConnection()->getDriver() instanceof MysqlDriver | |
) { | |
$this | |
->_em | |
->getEventManager() | |
->addEventSubscriber(new MysqlSessionInit( | |
$options['encoding'], | |
isset($options['collation']) ? $options['collation'] : false | |
)); | |
} | |
/* ... */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment