mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Work around issue with Weathermaps (#10033)
This commit is contained in:
@@ -46,6 +46,25 @@ class Laravel
|
||||
$kernel->bootstrap();
|
||||
}
|
||||
|
||||
public static function bootWeb()
|
||||
{
|
||||
// this is not a substitute for the normal Laravel boot, just a way to make auth work for external php
|
||||
if (self::isBooted()) {
|
||||
return;
|
||||
}
|
||||
|
||||
define('LARAVEL_START', microtime(true));
|
||||
$install_dir = realpath(__DIR__ . '/../..');
|
||||
$app = require_once $install_dir . '/bootstrap/app.php';
|
||||
$kernel = $app->make(\Illuminate\Contracts\Http\Kernel::class);
|
||||
|
||||
$request = \Illuminate\Http\Request::capture();
|
||||
$request->server->set('REQUEST_URI', '/blank'); // load an empty page since it will be discarded
|
||||
$response = $kernel->handle($request);
|
||||
|
||||
// $response->send(); // don't send response, legacy code will
|
||||
}
|
||||
|
||||
public static function isBooted()
|
||||
{
|
||||
return !empty(app()->isAlias('Illuminate\Foundation\Application')) && app()->isBooted();
|
||||
|
||||
Reference in New Issue
Block a user