Skip to content

Commit

Permalink
修正拼写
Browse files Browse the repository at this point in the history
  • Loading branch information
fengqi committed Jan 17, 2019
1 parent 6506af8 commit 1d196f6
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 14 deletions.
3 changes: 1 addition & 2 deletions CHANGELOG-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
- 时区从配置文件读取

## v1.5.1

- 命令行添加 `callSystem()` 接口, 允许至今调用系统命令, 如: ls, mkdir, sed, awk 等
- 命令行添加 `callSystem()` 接口, 允许直接调用系统命令, 如: ls, mkdir, sed, awk 等
- Request 和 Response 使用 [Symfony/http-foundation](https://github.com/symfony/http-foundation) 代替
- 修改 Request 获取 ip, 判断 pjax 问题
8 changes: 4 additions & 4 deletions src/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,13 @@ public function bootstrap()
$instances = $class->register();

if (is_object($instances)) {
$this->register($accessor, $instances);
static::register($accessor, $instances);
continue;
}

if (!is_array($instances)) continue;
foreach ($instances as $abstract => $instance) {
$this->register($accessor.'.'.$abstract, $instance);
static::register($accessor.'.'.$abstract, $instance);
}
}

Expand All @@ -132,7 +132,7 @@ public function bootstrap()
public function run()
{
if ($this->runningInConsole()) {
$kernel = $kernel = $this->make('ConsoleKernel');
$kernel = $kernel = static::make('ConsoleKernel');

$input = new Input();
$output = new Output();
Expand All @@ -144,7 +144,7 @@ public function run()
exit($status);
}
else {
$kernel = $this->make('HttpKernel');
$kernel = static::make('HttpKernel');

$request = Request::createFromGlobals();
$request::enableHttpMethodParameterOverride();
Expand Down
9 changes: 5 additions & 4 deletions src/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ public function __construct(App $app)
* @param Output|null $output
*
* @return int
* @throws \Exception
*/
public function handle(Input $input, Output $output = null)
{
Expand All @@ -58,13 +59,13 @@ public function handle(Input $input, Output $output = null)
require $this->app->basePath.'/bootstrap/routes.php';

// 注册 Router
$this->app->register('router', $router);
$this->app::register('router', $router);

// 注册 Input
$this->app->register('input', $input);
$this->app::register('input', $input);

// 测试 Output
$this->app->register('output', $output);
$this->app::register('output', $output);

// 获取命令列表
$commands = require $this->app->basePath.'/bootstrap/commands.php';
Expand All @@ -89,7 +90,7 @@ public function resolveCommands($commands)
$consoleApp->add(new $command);
}

$this->app->register('consoleApp', $consoleApp);
$this->app::register('consoleApp', $consoleApp);

return $consoleApp;
}
Expand Down
6 changes: 3 additions & 3 deletions src/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function handle(Request $request)
{
try {
// 注册 Request
$this->app->register('request', $request);
$this->app::register('request', $request);

// 启用 App
$this->app->bootstrap();
Expand All @@ -60,13 +60,13 @@ public function handle(Request $request)
require $this->app->basePath.'/bootstrap/routes.php';

// 注册 Router
$this->app->register('router', $router);
$this->app::register('router', $router);

// 任务分发
$response = $router->dispatch($request);
}
catch (Exception $e) {
$this->app->make('log')->error('runtime exception: '. $e->getMessage(), [
$this->app::make('log')->error('runtime exception: '. $e->getMessage(), [
'code' => $e->getCode(),
'file' => $e->getFile(),
'line' => $e->getLine(),
Expand Down
2 changes: 1 addition & 1 deletion src/Pipeline.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public function then(Closure $destination)
return call_user_func($destination, $passable);
};

// 要传过的管道, 通常是中间件
// 要穿过的管道, 通常是中间件
$pipes = array_reverse($this->pipes);

// 使用 array_reduce 递归调用
Expand Down

0 comments on commit 1d196f6

Please sign in to comment.