fix: database.core.DatabaseDriver (set connection timeout to 5s)

This commit is contained in:
xdrm-brackets 2017-11-28 06:57:06 +01:00
parent b706948b3a
commit 272c928375
1 changed files with 4 additions and 2 deletions

View File

@ -69,8 +69,10 @@
try{ try{
$this->pdo = new \PDO('mysql:host='.$this->host.';dbname='.$this->dbname, $this->username, $this->password); $this->pdo = new \PDO('mysql:host='.$this->host.';dbname='.$this->dbname, $this->username, $this->password, [
$this->pdo->setAttribute(\PDO::ATTR_DEFAULT_FETCH_MODE, \PDO::FETCH_ASSOC); \PDO::ATTR_DEFAULT_FETCH_MODE => \PDO::FETCH_ASSOC,
\PDO::ATTR_TIMEOUT => 5
]);
// On signale que tout s'est bien passe // On signale que tout s'est bien passe
$this->error = new Error(Err::Success); $this->error = new Error(Err::Success);