dblayer : check if the PDO Driver is installed in PHP before using it

git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@2844 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
2016-07-06 11:15:18 +00:00
parent 820d360e79
commit b7748f6ad1

View File

@@ -101,6 +101,9 @@ class dblayer
if (! isset ($driver[0]))
throw new Exception (dgettext("domframework", "No valid DSN provided"),
500);
if (! in_array ($driver[0], pdo_drivers ()))
throw new \Exception (dgettext("domframework",
"Driver PDO not available in PHP"), 500);
// Force specifics initialisations
$this->dsn = $dsn;
switch ($driver[0])