-
Notifications
You must be signed in to change notification settings - Fork 68
Open
Description
first thx for the great tool.
I'm using the latest version 1.9.0
When i only set the URL in the .env:
DATABASE_URL=mysql://root:root@127.0.0.1/fwgshopmanager_test
I get following error:
[ErrorException] Notice: Undefined index: master
the params array which comes into ConnectionFactory::createConnection looks like so
array:9 [ "url" => "mysql://root:root@127.0.0.1/fwgshopmanager_test" "charset" => "UTF8" "host" => "localhost" "port" => null "user" => "root" "password" => null "driver" => "pdo_mysql" "driverOptions" => [] "defaultTableOptions" => [] ]
My suggestion to fix this would be:
if (isset($params['url']) && !isset($params['dbname'])) {
$connection = DriverManager::getConnection($params, $config, $eventManager);
$params = $connection->getParams();
unset($params['url']);
}
if (isset($params['dbname'])) {
$dbName = $this->getDbNameFromEnv($params['dbname']);
} else {
$dbName = $this->getDbNameFromEnv($params['master']['dbname']);
}Metadata
Metadata
Assignees
Labels
No labels