File tree Expand file tree Collapse file tree 4 files changed +59
-2
lines changed
Expand file tree Collapse file tree 4 files changed +59
-2
lines changed Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ namespace App \Command ;
6+
7+ use Symfony \Component \Console \Command \Command ;
8+ use Symfony \Component \Console \Input \InputInterface ;
9+ use Symfony \Component \Console \Output \OutputInterface ;
10+
11+ class GetRoadRunnerCommand extends Command
12+ {
13+ protected function execute (InputInterface $ input , OutputInterface $ output ): int
14+ {
15+ $ command = "curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/roadrunner-server/roadrunner/master/download-latest.sh | sh && tar -xzvf roadrunner-*.tar.gz && rm -rf roadrunner-*.tar.gz && mv roadrunner-*/rr . && rm -rf roadrunner-* && chmod +x ./rr " ;
16+ $ result = shell_exec ($ command );
17+ $ output ->writeln ($ result );
18+
19+ return Command::SUCCESS ;
20+ }
21+
22+ protected function configure (): void
23+ {
24+ $ this ->setName ('roadrunner:get ' )
25+ ->setDescription ('get last version of roadrunner ' );
26+ }
27+ }
Original file line number Diff line number Diff line change 1+ #!/usr/bin/env php
2+ <?php
3+
4+ declare (strict_types=1 );
5+
6+ use Symfony \Component \Console \Application ;
7+
8+ require __DIR__ .'/../vendor/autoload.php ' ;
9+
10+ date_default_timezone_set ('Asia/Shanghai ' );
11+
12+ $ application = new Application ();
13+
14+ $ commands = require __DIR__ .'/../config/commands.php ' ;
15+
16+ $ application ->addCommands (array_map (static function (string $ command ) {
17+ return new $ command ();
18+ }, $ commands ));
19+
20+ /** @noinspection PhpUnhandledExceptionInspection */
21+ $ application ->run ();
Original file line number Diff line number Diff line change 44
55use MicroPHP \Framework \Application ;
66
7- require __DIR__ .'/vendor/autoload.php ' ;
7+ require __DIR__ .'/../ vendor/autoload.php ' ;
88
99date_default_timezone_set ('Asia/Shanghai ' );
1010
11- ! defined ('BASE_PATH ' ) && define ('BASE_PATH ' , __DIR__ );
11+ ! defined ('BASE_PATH ' ) && define ('BASE_PATH ' , __DIR__ . ' /../ ' );
1212
1313/** @noinspection PhpUnhandledExceptionInspection */
1414Application::boot ();
Original file line number Diff line number Diff line change 1+ <?php
2+
3+ declare (strict_types=1 );
4+
5+ use App \Command \GetRoadRunnerCommand ;
6+
7+ return [
8+ GetRoadRunnerCommand::class,
9+ ];
You can’t perform that action at this time.
0 commit comments