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'); } }
/** * {@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]; } }
/** * {@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); }