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;
|
||||
$error = '';
|
||||
$conn = @new MySQLi($databaseConfig['server'], $databaseConfig['username'], $databaseConfig['password']);
|
||||
if($conn && $conn->connect_errno < 2000) {
|
||||
$success = true;
|
||||
} else {
|
||||
if($conn && $conn->connect_errno) {
|
||||
$success = false;
|
||||
$error = ($conn) ? $conn->connect_error : '';
|
||||
$error = $conn->connect_error;
|
||||
} else {
|
||||
$success = true;
|
||||
}
|
||||
|
||||
return array(
|
||||
'success' => $success,
|
||||
'error' => $error
|
||||
|
Loading…
Reference in New Issue
Block a user