mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
* Add librenms command Hook up to artisan. Hide dev commands and most other commands if app environment is production. Register all commands for php artisan or when not in production. * remove dead end line * Console application name and version. Had to shift some stuff from legacy code, but deferred others as it was too extensive of a change. * switch check order * always get local version now * update array format * whitepace * fix style
24 lines
637 B
PHP
24 lines
637 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use Illuminate\Foundation\Providers\ArtisanServiceProvider;
|
|
|
|
class CliServiceProvider extends ArtisanServiceProvider
|
|
{
|
|
public function register()
|
|
{
|
|
// Restrict LibreNMS CLI commands
|
|
if (defined('LIBRENMS_CLI') && $this->app->environment() == 'production') {
|
|
$this->commands = array_intersect_key($this->commands, [
|
|
"Migrate" => true,
|
|
]);
|
|
|
|
$this->registerCommands($this->commands);
|
|
} else {
|
|
$this->app->register(\Laravel\Tinker\TinkerServiceProvider::class);
|
|
parent::register();
|
|
}
|
|
}
|
|
}
|