mirror of
https://github.com/InvoiceShelf/InvoiceShelf.git
synced 2026-08-04 15:12:12 +00:00
fix(setup): support mariadb in the installation wizard (#704)
Fixes InvoiceShelf/docker#79 — a fresh install using the shipped docker-compose.mysql.yml cannot get past the database step, because that compose file sets DB_CONNECTION=mariadb. getDatabaseEnvironment() switched on sqlite, pgsql and mysql with no arm for mariadb and no default, so it answered {"config":[]}. The wizard chooses which form to render from database_connection in that response, so step 4 rendered blank with no way forward — and nothing reached the log, because the app never errored, it just replied with nothing. Adds the mariadb arm, and a default so an unrecognised driver can never again produce an unrenderable response: it is echoed back with the server defaults, leaving the fields editable rather than the step empty. MariaDB is now offered in the driver dropdown too. It was already a valid DB_CONNECTION with its own connection in config/database.php, and the form fields are identical to MySQL's. Tested against the original code, where three of the new cases fail with "Failed asserting that null is identical to 'mariadb'".
This commit is contained in:
committed by
GitHub
parent
3b2aa1ca2e
commit
fdd958c1e5
@@ -77,6 +77,27 @@ class DatabaseConfigurationController extends Controller
|
||||
|
||||
break;
|
||||
|
||||
case 'mariadb':
|
||||
$databaseData = [
|
||||
'database_connection' => 'mariadb',
|
||||
'database_host' => '127.0.0.1',
|
||||
'database_port' => 3306,
|
||||
];
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
// Never return an empty config: the wizard picks its form from
|
||||
// database_connection, so an unrecognised driver used to render
|
||||
// a blank step with no way forward. Echo it back with the
|
||||
// server defaults instead.
|
||||
$databaseData = [
|
||||
'database_connection' => $connection,
|
||||
'database_host' => '127.0.0.1',
|
||||
'database_port' => 3306,
|
||||
];
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return response()->json([
|
||||
|
||||
Reference in New Issue
Block a user