PHP Class blink\core\Application

Inheritance: extends blink\core\ServiceLocator
Show file Open project: bixuehujin/blink Class Usage Examples

Public Properties

Property Type Description
$commands string[] Available console commands.
$controllerNamespace
$currentRequest
$debug
$environment string The environment that the application is running on. dev, prod or test.
$name string The name for the application.
$plugins array The installed application plugins.
$root string The root path for the application.
$routes
$runtime
$server
$services array Application service definitions.
$timezone

Protected Properties

Property Type Description
$bootstrapped
$dispatcher
$lastError
$refreshing

Public Methods

Method Description
bootstrap ( )
consoleCommands ( ) : array Returns all console commands definitions.
defaultCommands ( ) : array Returns the default console commands definitions.
defaultServices ( )
handleRequest ( blink\http\Request $request ) : mixed
init ( )
makeRequest ( $config = [] )
route ( $method, $route, $handler )
shutdown ( ) Shutdown the application.

Protected Methods

Method Description
afterAction ( $action, $request, $response )
beforeAction ( $action, $request )
createAction ( $handler )
dispatch ( $request )
exceptionToArray ( $exception )
exec ( $request, $response )
formatException ( $e, $response )
initializeConfig ( )
internalServerError ( )
refreshServices ( )
registerPlugins ( )
registerRoutes ( )
registerServices ( )
runAction ( $action, $args, $request, $response )

Method Details

afterAction() protected method

protected afterAction ( $action, $request, $response )

beforeAction() protected method

protected beforeAction ( $action, $request )

bootstrap() public method

public bootstrap ( )

consoleCommands() public method

Returns all console commands definitions.
public consoleCommands ( ) : array
return array

createAction() protected method

protected createAction ( $handler )

defaultCommands() public method

Returns the default console commands definitions.
public defaultCommands ( ) : array
return array

defaultServices() public method

public defaultServices ( )

dispatch() protected method

protected dispatch ( $request )

exceptionToArray() protected method

protected exceptionToArray ( $exception )

exec() protected method

protected exec ( $request, $response )

formatException() protected method

protected formatException ( $e, $response )

handleRequest() public method

public handleRequest ( blink\http\Request $request ) : mixed
$request blink\http\Request
return mixed

init() public method

public init ( )

initializeConfig() protected method

protected initializeConfig ( )

internalServerError() protected method

protected internalServerError ( )

makeRequest() public method

public makeRequest ( $config = [] )

refreshServices() protected method

protected refreshServices ( )

registerPlugins() protected method

protected registerPlugins ( )

registerRoutes() protected method

protected registerRoutes ( )

registerServices() protected method

protected registerServices ( )

route() public method

public route ( $method, $route, $handler )

runAction() protected method

protected runAction ( $action, $args, $request, $response )

shutdown() public method

Shutdown the application.
public shutdown ( )

Property Details

$bootstrapped protected property

protected $bootstrapped

$commands public property

Available console commands.
public string[] $commands
return string[]

$controllerNamespace public property

public $controllerNamespace

$currentRequest public property

public $currentRequest

$debug public property

public $debug

$dispatcher protected property

protected $dispatcher

$environment public property

The environment that the application is running on. dev, prod or test.
public string $environment
return string

$lastError protected property

protected $lastError

$name public property

The name for the application.
public string $name
return string

$plugins public property

The installed application plugins.
public array $plugins
return array

$refreshing protected property

protected $refreshing

$root public property

The root path for the application.
public string $root
return string

$routes public property

public $routes

$runtime public property

public $runtime

$server public property

public $server

$services public property

Application service definitions.
public array $services
return array

$timezone public property

public $timezone