mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Fix install not connecting to DB (#9984)
This commit is contained in:
@@ -36,7 +36,7 @@ class Eloquent
|
||||
/** @var Capsule static reference to capsule */
|
||||
private static $capsule;
|
||||
|
||||
public static function boot($options = [])
|
||||
public static function boot()
|
||||
{
|
||||
// boot Eloquent outside of Laravel
|
||||
if (!Laravel::isBooted() && is_null(self::$capsule)) {
|
||||
@@ -47,24 +47,6 @@ class Eloquent
|
||||
$db_config = include($install_dir . '/config/database.php');
|
||||
$settings = $db_config['connections'][$db_config['default']];
|
||||
|
||||
// legacy connection override
|
||||
if (!empty($options)) {
|
||||
$fields = [
|
||||
'host' => 'db_host',
|
||||
'port' => 'db_port',
|
||||
'database' => 'db_name',
|
||||
'username' => 'db_user',
|
||||
'password' => 'db_pass',
|
||||
'unix_socket' => 'db_socket',
|
||||
];
|
||||
|
||||
foreach ($fields as $new => $old) {
|
||||
if (isset($options[$old])) {
|
||||
$settings[$new] = $options[$old];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
self::$capsule = new Capsule;
|
||||
self::$capsule->addConnection($settings);
|
||||
self::$capsule->setEventDispatcher(new Dispatcher());
|
||||
|
Reference in New Issue
Block a user