Files

73 lines
1.7 KiB
PHP
Raw Permalink Normal View History

2018-05-09 08:05:17 -05:00
<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
2019-01-08 21:42:56 -06:00
use LibreNMS\Util\Version;
2018-05-09 08:05:17 -05:00
class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
2019-01-28 08:45:47 -06:00
protected $commands = [
//
2019-01-28 08:45:47 -06:00
];
2018-05-09 08:05:17 -05:00
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
// $schedule->command('inspire')
// ->hourly();
}
/**
* Register the commands for the application.
2018-05-09 08:05:17 -05:00
*
* @return void
*/
protected function commands()
{
2020-09-21 14:54:51 +02:00
$this->load(__DIR__ . '/Commands');
2018-05-09 08:05:17 -05:00
require base_path('routes/console.php');
2019-01-08 21:42:56 -06:00
if ($this->app->environment() !== 'production') {
require base_path('routes/dev-console.php');
}
}
2019-01-28 08:45:47 -06:00
public function getArtisan()
2019-01-08 21:42:56 -06:00
{
if (is_null($this->artisan)) {
parent::getArtisan();
$this->artisan->setName(\LibreNMS\Config::get('project_name', 'LibreNMS'));
$this->artisan->setVersion(Version::get()->local());
}
return $this->artisan;
2018-05-09 08:05:17 -05:00
}
2019-01-09 19:36:32 -06:00
public function handle($input, $output = null)
{
// intercept input and check for debug
if ($input->hasParameterOption(['-d', '--debug', '-vv', '-vvv'], true)) {
if ($input->hasParameterOption(['-vvv'], true)) {
global $vdebug;
$vdebug = true;
}
$this->app->booted('set_debug');
}
return parent::handle($input, $output);
}
2018-05-09 08:05:17 -05:00
}