From 272c92837528ceb339c9284e794bb4e28e9d904f Mon Sep 17 00:00:00 2001 From: xdrm-brackets Date: Tue, 28 Nov 2017 06:57:06 +0100 Subject: [PATCH] fix: database.core.DatabaseDriver (set connection timeout to 5s) --- build/database/core/DatabaseDriver.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/build/database/core/DatabaseDriver.php b/build/database/core/DatabaseDriver.php index 8e9a13c..70b6146 100755 --- a/build/database/core/DatabaseDriver.php +++ b/build/database/core/DatabaseDriver.php @@ -69,8 +69,10 @@ try{ - $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); + $this->pdo = new \PDO('mysql:host='.$this->host.';dbname='.$this->dbname, $this->username, $this->password, [ + \PDO::ATTR_DEFAULT_FETCH_MODE => \PDO::FETCH_ASSOC, + \PDO::ATTR_TIMEOUT => 5 + ]); // On signale que tout s'est bien passe $this->error = new Error(Err::Success);