[*] Installer : added timout to sql connection

This commit is contained in:
dMetzger
2012-08-07 12:32:40 +00:00
parent e39ce99efe
commit dcbb07649b
4 changed files with 14 additions and 7 deletions
+2 -2
View File
@@ -179,11 +179,11 @@ class DbPDOCore extends Db
/**
* @see Db::checkConnection()
*/
static public function tryToConnect($server, $user, $pwd, $db, $newDbLink = true, $engine = null)
public static function tryToConnect($server, $user, $pwd, $db, $newDbLink = true, $engine = null, $timeout = 5)
{
try
{
$link = @new PDO('mysql:dbname='.$db.';host='.$server, $user, $pwd);
$link = @new PDO('mysql:dbname='.$db.';host='.$server, $user, $pwd, array(PDO::ATTR_TIMEOUT => $timeout));
}
catch (PDOException $e)
{