コード例 #1
0
 public function boot(ContainerInterface $app)
 {
     if ($app->has(KernelInterface::class)) {
         $kernel = $app->get(KernelInterface::class);
         $kernel['commands'] = (require __DIR__ . '/../app/commands.php');
         $kernel['routes'] = (require __DIR__ . '/../app/routes.php');
     }
 }
コード例 #2
0
 /**
  * {@inheritdoc}
  */
 public function boot(ContainerInterface $app)
 {
     if ($app->has(KernelInterface::class)) {
         /** @var \Wandu\Foundation\Contracts\KernelInterface $kernel */
         $kernel = $app->get(KernelInterface::class);
         $kernel['commands'] = ['psysh' => PsyshCommand::class, 'install' => InstallCommand::class];
     }
 }
コード例 #3
0
ファイル: HttpRouterKernel.php プロジェクト: wandu/framework
 /**
  * {@inheritdoc}
  */
 public function execute(ContainerInterface $app)
 {
     $this->useErrorHandling();
     if (!$app->has(HttpErrorHandlerInterface::class)) {
         $app->bind(HttpErrorHandlerInterface::class, DefaultHttpErrorHandler::class);
     }
     /* @var \Psr\Http\Message\ServerRequestInterface $request */
     $request = $this->createRequest($app);
     try {
         $response = $this->dispatch($app->get(Dispatcher::class), $request);
     } catch (Throwable $exception) {
         return $this->handleException($exception);
     } catch (Exception $exception) {
         return $this->handleException($exception);
     }
     return $this->sendResponse($response);
 }