* [FIX] Solved weird issue when connecting to MySQL DB after a successful installation. Solves #382

This commit is contained in:
nuxsmin
2017-01-23 23:50:06 +01:00
parent 957e6ddf08
commit a5358476ab
10 changed files with 87 additions and 77 deletions

View File

@@ -134,9 +134,10 @@ class MySQLHandler implements DBStorageInterface
}
try {
$opts = [PDO::ATTR_EMULATE_PREPARES => true, PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION];
$dsn = 'mysql:host=' . $this->dbHost . ';port=' . $this->dbPort . ';dbname=' . $this->dbName . ';charset=utf8';
// $this->db = new PDO($dsn, $dbuser, $dbpass, array(PDO::ATTR_PERSISTENT => true));
$this->db = new PDO($dsn, $this->dbUser, $this->dbPass);
$this->db = new PDO($dsn, $this->dbUser, $this->dbPass, $opts);
// $this->db = new PDO($dsn, $this->dbUser, $this->dbPass);
$this->dbStatus = 0;
} catch (\Exception $e) {
if ($isInstalled) {
@@ -153,9 +154,6 @@ class MySQLHandler implements DBStorageInterface
}
}
$this->db->setAttribute(PDO::ATTR_EMULATE_PREPARES, true); //FIXME
$this->db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
return $this->db;
}