BUGFIX If there is *any* error connecting to MySQL, expose this to the installer.

This commit is contained in:
Sean Harvey 2012-05-19 11:29:25 +12:00
parent d58e37417f
commit aaf91154a2

View File

@ -30,12 +30,13 @@ class MySQLDatabaseConfigurationHelper implements DatabaseConfigurationHelper {
$success = false; $success = false;
$error = ''; $error = '';
$conn = @new MySQLi($databaseConfig['server'], $databaseConfig['username'], $databaseConfig['password']); $conn = @new MySQLi($databaseConfig['server'], $databaseConfig['username'], $databaseConfig['password']);
if($conn && $conn->connect_errno < 2000) { if($conn && $conn->connect_errno) {
$success = true;
} else {
$success = false; $success = false;
$error = ($conn) ? $conn->connect_error : ''; $error = $conn->connect_error;
} else {
$success = true;
} }
return array( return array(
'success' => $success, 'success' => $success,
'error' => $error 'error' => $error