return;
} // Init db in container
$container->
offsetSet('db',
$connection);
/** @var DatabaseService $databaseService */
$databaseService =
$container->
offsetGet('database.service'
);
// No need for listing the following schemas
$omitSchemas =
['information_schema', 'performance_schema', 'sys', 'mysql'
];
$databaseNames =
$databaseService->
getSchemas($omitSchemas);
$result =
[];
foreach ($databaseNames as $databaseName) { $result[] =
[ 'value' =>
$databaseName,
'display' =>
$databaseName,
];
} $response->
header('Content-Type', 'application/json'
);
$response->
status(200
);