From 7c0d47eba0b9fa4a926743280985b6d7b42ea7c2 Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Tue, 14 Jan 2014 13:07:09 +1100 Subject: [PATCH] Update install.php5 Defaulting to MySQL here is really dumb. There is an explicit type as an argument so falling back to mysql could result in "I couldn't write to path ....db" despite the real error that the include of the sqlite3/code/SQLiteDatabaseConfigurationHelper.php failed for some reason. Other uses of getDatabaseConfigurationHelper also need a similar error handler. --- dev/install/install.php5 | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dev/install/install.php5 b/dev/install/install.php5 index 92a90938b..5d8238122 100755 --- a/dev/install/install.php5 +++ b/dev/install/install.php5 @@ -48,7 +48,7 @@ $dirsToCheck = array( if($dirsToCheck[0] == $dirsToCheck[1]) { unset($dirsToCheck[1]); } -foreach($dirsToCheck as $dir) { +foreach($dirsToCheck as $dir) { //check this dir and every parent dir (until we hit the base of the drive) // or until we hit a dir we can't read do { @@ -1052,12 +1052,16 @@ class InstallRequirements { $helperPath = $adapters[$databaseClass]['helperPath']; $class = str_replace('.php', '', basename($helperPath)); } - return (class_exists($class)) ? new $class() : new MySQLDatabaseConfigurationHelper(); + return (class_exists($class)) ? new $class() : false; } function requireDatabaseFunctions($databaseConfig, $testDetails) { $this->testing($testDetails); $helper = $this->getDatabaseConfigurationHelper($databaseConfig['type']); + if (!$helper) { + $this->error("Couldn't load database helper code for ". $databaseConfig['type']); + return false; + } $result = $helper->requireDatabaseFunctions($databaseConfig); if($result) { return true;