mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix install (#8724)
Don't try to connect to the database if it isn't configured yet.
This commit is contained in:
@@ -20,17 +20,19 @@ class AppServiceProvider extends ServiceProvider
|
||||
*/
|
||||
public function boot()
|
||||
{
|
||||
// connect legacy db
|
||||
// connect legacy db, only if configured
|
||||
//FIXME this is for auth right now, remove later
|
||||
$db_config = config('database.connections')[config('database.default')];
|
||||
dbConnect(
|
||||
$db_config['host'],
|
||||
$db_config['username'],
|
||||
$db_config['password'],
|
||||
$db_config['database'],
|
||||
$db_config['port'],
|
||||
$db_config['unix_socket']
|
||||
);
|
||||
if (!empty($db_config['database'])) {
|
||||
dbConnect(
|
||||
$db_config['host'],
|
||||
$db_config['username'],
|
||||
$db_config['password'],
|
||||
$db_config['database'],
|
||||
$db_config['port'],
|
||||
$db_config['unix_socket']
|
||||
);
|
||||
}
|
||||
|
||||
// load config
|
||||
Config::load();
|
||||
|
Reference in New Issue
Block a user