40 lines
942 B
PHP
40 lines
942 B
PHP
<?php
|
|
|
|
namespace App\Console;
|
|
|
|
use App\Commands\HelloWorld;
|
|
use App\Console\Commands\HRCInstall;
|
|
use Illuminate\Console\Scheduling\Schedule;
|
|
use Laravel\Lumen\Console\Kernel as ConsoleKernel;
|
|
use App\Helpers\ClassHelper;
|
|
|
|
class Kernel extends ConsoleKernel
|
|
{
|
|
/**
|
|
* Define the application's command schedule.
|
|
*
|
|
* @param \Illuminate\Console\Scheduling\Schedule $schedule
|
|
* @return void
|
|
*/
|
|
protected function schedule(Schedule $schedule)
|
|
{
|
|
//
|
|
}
|
|
|
|
public function getCommands()
|
|
{
|
|
$commands_path = CORE_PATH . '/commands';
|
|
$files = array_diff(scandir($commands_path), array('.', '..'));
|
|
|
|
$classes = [];
|
|
foreach($files as $file) {
|
|
$classes[] = ClassHelper::extract($commands_path . '/' . $file);
|
|
}
|
|
|
|
$classes[] = HRCInstall::class;
|
|
|
|
$commands = parent::getCommands();
|
|
return array_merge($commands, $classes);
|
|
}
|
|
}
|