File tree Expand file tree Collapse file tree 3 files changed +59
-10
lines changed Expand file tree Collapse file tree 3 files changed +59
-10
lines changed Original file line number Diff line number Diff line change 33namespace App \Console ;
44
55use Illuminate \Console \Scheduling \Schedule ;
6- use Run \Console \Kernel as ConsoleKernel ;
6+ use Run \Steps \ Console \RunConsoleKernel ;
77
8- class Kernel extends ConsoleKernel
8+ class Kernel extends RunConsoleKernel
99{
1010 /**
1111 * The Artisan commands provided by your application.
@@ -26,4 +26,15 @@ protected function schedule(Schedule $schedule)
2626 {
2727 //
2828 }
29+ /**
30+ * Register the commands for the application.
31+ *
32+ * @return void
33+ */
34+ protected function commands ()
35+ {
36+ $ this ->load (__DIR__ .'/Commands ' );
37+
38+ require base_path ('routes/console.php ' );
39+ }
2940}
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ use Illuminate \Foundation \Inspiring ;
4+ use Illuminate \Support \Facades \Artisan ;
5+
6+ /*
7+ |--------------------------------------------------------------------------
8+ | Console Routes
9+ |--------------------------------------------------------------------------
10+ |
11+ | This file is where you may define all of your Closure based console
12+ | commands. Each Closure is bound to a command instance allowing a
13+ | simple approach to interacting with each command's IO methods.
14+ |
15+ */
16+
17+ Artisan::command ('talk ' , function () {
18+ $ this ->comment (Inspiring::quote ());
19+ })->purpose ('Display an inspiring quote ' );
Original file line number Diff line number Diff line change 11#!/usr/bin/env php
22<?php
33
4- use App \Console \Commands \CustomCommand ;
5- use Symfony \Component \Console \Application ;
4+ define ('RUN_START ' , microtime (true ));
5+
6+ use Symfony \Component \Console \Input \ArgvInput ;
7+ use Symfony \Component \Console \Output \ConsoleOutput ;
68
79/*
810|--------------------------------------------------------------------------
@@ -11,13 +13,30 @@ use Symfony\Component\Console\Application;
1113|
1214|
1315*/
14- require_once __DIR__ .'/bootstrap/app.php ' ;
16+ $ app = require __DIR__ .'/bootstrap/app.php ' ;
17+
18+ /*
19+ |--------------------------------------------------------------------------
20+ | Run Console Kernel Then Handel the Command
21+ |--------------------------------------------------------------------------
22+ |
23+ |
24+ */
25+
26+ $ kernel = $ app ->make ('Illuminate\Contracts\Console\Kernel ' );
1527
1628
17- $ command = new Application ("RUN FrameWork Command line Interface (RunCLI) => " , "1.0.0 V " );
29+ $ status = $ kernel ->handle ($ input = new ArgvInput , new ConsoleOutput );
30+
31+
32+ /*
33+ |--------------------------------------------------------------------------
34+ | Shutdown The Console
35+ |--------------------------------------------------------------------------
36+ |
37+ */
38+
39+ $ kernel ->terminate ($ input , $ status );
1840
19- // ... register commands
20- $ command ->add (new CustomCommand ());
21- // ...
2241
23- $ command -> run ( );
42+ exit ( $ status );
You can’t perform that action at this time.
0 commit comments