Skip to content

Commit 62db1ae

Browse files
committed
suppot command
1 parent 88657fa commit 62db1ae

File tree

7 files changed

+32
-50
lines changed

7 files changed

+32
-50
lines changed

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#### 安装roadrunner
2+
```shell
3+
php bin/console roadrunner:get
4+
```
5+
6+
#### 运行
7+
```shell
8+
php bin/console start
9+
```

app/Command/GetRoadRunnerCommand.php

Lines changed: 0 additions & 27 deletions
This file was deleted.

bin/bootstrap.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
6+
require __DIR__.'/../vendor/autoload.php';
7+
8+
date_default_timezone_set('Asia/Shanghai');
9+
10+
! defined('BASE_PATH') && define('BASE_PATH', __DIR__ . '/../');

bin/console

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,10 @@
11
#!/usr/bin/env php
22
<?php
3-
43
declare(strict_types=1);
54

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';
5+
use MicroPHP\Framework\ConsoleApplication;
156

16-
$application->addCommands(array_map(static function (string $command) {
17-
return new $command();
18-
}, $commands));
7+
require_once 'bootstrap.php';
198

209
/** @noinspection PhpUnhandledExceptionInspection */
21-
$application->run();
10+
ConsoleApplication::boot();

bin/index.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,7 @@
44

55
use MicroPHP\Framework\Application;
66

7-
require __DIR__.'/../vendor/autoload.php';
8-
9-
date_default_timezone_set('Asia/Shanghai');
10-
11-
! defined('BASE_PATH') && define('BASE_PATH', __DIR__ . '/../');
7+
require_once 'bootstrap.php';
128

139
/** @noinspection PhpUnhandledExceptionInspection */
14-
Application::boot();
10+
Application::run();

config/app.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,11 @@
22

33
declare(strict_types=1);
44

5-
return [];
5+
return [
6+
'scanner' => [
7+
'directories' => [
8+
'app',
9+
'vendor/microphp/framework/src',
10+
]
11+
]
12+
];

config/commands.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
declare(strict_types=1);
44

5-
use App\Command\GetRoadRunnerCommand;
65

76
return [
8-
GetRoadRunnerCommand::class,
97
];

0 commit comments

Comments
 (0)