mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUGFIX If there is *any* error connecting to MySQL, expose this to the installer.
This commit is contained in:
parent
d58e37417f
commit
aaf91154a2
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user