Skip to content
This repository has been archived by the owner on Jan 22, 2018. It is now read-only.

Commit

Permalink
Merge pull request #13 from OpenBuildings/charset
Browse files Browse the repository at this point in the history
Set connection charset in DSN
  • Loading branch information
hkdobrev committed Oct 1, 2015
2 parents df4d681 + 409ad21 commit 095ca8b
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions classes/Migration/Driver/Mysql.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,13 @@ public function __construct($database)

if ($database['type'] !== 'PDO')
{
$database['connection']['dsn'] = strtolower($database['type'].':'.
'host='.$database['connection']['hostname'].';'.
'dbname='.$database['connection']['database']);
$database['connection']['dsn'] = strtolower($database['type']
.':host='.$database['connection']['hostname']
.';dbname='.$database['connection']['database']
.(isset($database['connection']['charset'])
? ';charset='.$database['connection']['charset']
: '')
);
}

$this->pdo = new PDO(
Expand Down

0 comments on commit 095ca8b

Please sign in to comment.