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 3
3
namespace App \Console ;
4
4
5
5
use Illuminate \Console \Scheduling \Schedule ;
6
- use Run \Console \Kernel as ConsoleKernel ;
6
+ use Run \Steps \ Console \RunConsoleKernel ;
7
7
8
- class Kernel extends ConsoleKernel
8
+ class Kernel extends RunConsoleKernel
9
9
{
10
10
/**
11
11
* The Artisan commands provided by your application.
@@ -26,4 +26,15 @@ protected function schedule(Schedule $schedule)
26
26
{
27
27
//
28
28
}
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
+ }
29
40
}
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 1
1
#!/usr/bin/env php
2
2
<?php
3
3
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 ;
6
8
7
9
/*
8
10
|--------------------------------------------------------------------------
@@ -11,13 +13,30 @@ use Symfony\Component\Console\Application;
11
13
|
12
14
|
13
15
*/
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 ' );
15
27
16
28
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 );
18
40
19
- // ... register commands
20
- $ command ->add (new CustomCommand ());
21
- // ...
22
41
23
- $ command -> run ( );
42
+ exit ( $ status );
You can’t perform that action at this time.
0 commit comments