From 797ffad0c778c2c3e687bbf849e5a0827e0cdc36 Mon Sep 17 00:00:00 2001 From: skodak Date: Mon, 9 Feb 2009 17:51:01 +0000 Subject: [PATCH] MDL-18194 detect if driver install before trying to create db --- lib/dml/mysqli_native_moodle_database.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/dml/mysqli_native_moodle_database.php b/lib/dml/mysqli_native_moodle_database.php index 64517fdb42..09189025f9 100644 --- a/lib/dml/mysqli_native_moodle_database.php +++ b/lib/dml/mysqli_native_moodle_database.php @@ -22,6 +22,12 @@ class mysqli_native_moodle_database extends moodle_database { */ /// TODO: Decide if this method should go to DDL instead of being here public function create_database($dbhost, $dbuser, $dbpass, $dbname, array $dboptions=null) { + $driverstatus = $this->driver_installed(); + + if ($driverstatus !== true) { + throw new dml_exception('dbdriverproblem', $driverstatus); + } + ob_start(); $conn = new mysqli($dbhost, $dbuser, $dbpass); /// Connect without db $dberr = ob_get_contents(); -- 2.39.5