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:
Tony Murray 2019-03-14 08:06:27 -05:00 committed by GitHub
parent 3905423147
commit c7c7b57de4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 7 deletions

View File

@ -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");

View File

@ -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();

View File

@ -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';
}

View File

@ -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::');

View File

@ -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