Class BaseApplication

Base class for application classes.

The application class is responsible for bootstrapping the application, and ensuring that middleware is attached. It is also invoked as the last piece of middleware, and delegates request/response handling to the correct controller.

Abstract
Namespace: Cake\Http
Location: Http/BaseApplication.php

Properties summary

  • $configDir protected
    string
    Contains the path of the config directory

Method Summary

Method Detail

__construct()source public

__construct( string $configDir )

Constructor

Parameters

string $configDir
The directory the bootstrap configuration is held in.

__invoke()source public

__invoke( Psr\Http\Message\ServerRequestInterface $request , Psr\Http\Message\ResponseInterface $response , callable $next )

Invoke the application.

  • Convert the PSR request/response into CakePHP equivalents.
  • Create the controller that will handle this request.
  • Invoke the controller.

Parameters

Psr\Http\Message\ServerRequestInterface $request
The request
Psr\Http\Message\ResponseInterface $response
The response
callable $next
The next middleware

Returns

Psr\Http\Message\ResponseInterface

bootstrap()source public

bootstrap( )

Load all the application configuration and bootstrap logic.

Override this method to add additional bootstrap logic for your application.

getDispatcher()source protected

getDispatcher( )

Get the ActionDispatcher.

Returns

Cake\Http\ActionDispatcher

middleware()source abstract public

middleware( Cake\Http\MiddlewareQueue $middleware )

Parameters

Cake\Http\MiddlewareQueue $middleware
The middleware queue to set in your App Class

Returns

Cake\Http\MiddlewareQueue

Properties detail

$configDirsource

protected string

Contains the path of the config directory

© 2005–2017 The Cake Software Foundation, Inc.
Licensed under the MIT License.
CakePHP is a registered trademark of Cake Software Foundation, Inc.
We are not endorsed by or affiliated with CakePHP.
https://api.cakephp.org/3.3/class-Cake.Http.BaseApplication.html