Always boot Laravel (#9842)
* Always boot Laravel That way we can depend on it being available. Saves us crashes if some code accidentally uses something that isn't booted and a lot of silly if/elses. * ignore init php errors
This commit is contained in:
parent
3905423147
commit
c7c7b57de4
|
@ -27,7 +27,7 @@ if (file_exists($config['install_dir'] . '/config.php')) {
|
|||
echo("This should only be called during install");
|
||||
exit;
|
||||
}
|
||||
$init_modules = ['laravel', 'nodb'];
|
||||
$init_modules = ['nodb'];
|
||||
require $config['install_dir'] . '/includes/init.php';
|
||||
|
||||
header("Content-type: text/plain");
|
||||
|
|
|
@ -92,9 +92,10 @@ if (module_selected('alerts', $init_modules)) {
|
|||
require_once $install_dir . '/includes/alerts.inc.php';
|
||||
}
|
||||
|
||||
if (module_selected('laravel', $init_modules)) {
|
||||
\LibreNMS\Util\Laravel::bootCli();
|
||||
}
|
||||
// Boot Laravel
|
||||
\LibreNMS\Util\Laravel::bootCli();
|
||||
|
||||
set_debug(false); // disable debug initially (hides legacy errors too)
|
||||
|
||||
if (!module_selected('nodb', $init_modules)) {
|
||||
\LibreNMS\DB\Eloquent::boot();
|
||||
|
|
|
@ -32,7 +32,7 @@ use LibreNMS\Util\MemcacheLock;
|
|||
|
||||
if (!isset($init_modules) && php_sapi_name() == 'cli') {
|
||||
// Not called from within discovery, let's load up the necessary stuff.
|
||||
$init_modules = ['laravel'];
|
||||
$init_modules = [];
|
||||
require realpath(__DIR__ . '/../..') . '/includes/init.php';
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
* Adapted from old snmptrap.php handler
|
||||
*/
|
||||
|
||||
$init_modules = ['laravel', 'alerts-cli']; // so I don't have to rebase yet
|
||||
$init_modules = [];
|
||||
require __DIR__ . '/includes/init.php';
|
||||
|
||||
$options = getopt('d::');
|
||||
|
|
|
@ -130,7 +130,7 @@ if ($pre_checks_failed) {
|
|||
exit;
|
||||
}
|
||||
|
||||
$init_modules = ['laravel'];
|
||||
$init_modules = [];
|
||||
require 'includes/init.php';
|
||||
|
||||
// make sure install_dir is set correctly, or the next includes will fail
|
||||
|
|
Loading…
Reference in New Issue