configDir = $configDir; } /** * @param \Cake\Http\MiddlewareQueue $middleware The middleware queue to set in your App Class * @return \Cake\Http\MiddlewareQueue */ abstract public function middleware($middleware); /** * Load all the application configuration and bootstrap logic. * * Override this method to add additional bootstrap logic for your application. * * @return void */ public function bootstrap() { require_once $this->configDir . '/bootstrap.php'; } /** * Invoke the application. * * - Convert the PSR response into CakePHP equivalents. * - Create the controller that will handle this request. * - Invoke the controller. * * @param \Psr\Http\Message\ServerRequestInterface $request The request * @param \Psr\Http\Message\ResponseInterface $response The response * @param callable $next The next middleware * @return \Psr\Http\Message\ResponseInterface */ public function __invoke(ServerRequestInterface $request, ResponseInterface $response, $next) { return $this->getDispatcher()->dispatch($request, $response); } /** * Get the ActionDispatcher. * * @return \Cake\Http\ActionDispatcher */ protected function getDispatcher() { return new ActionDispatcher(null, null, DispatcherFactory::filters()); } }