Arikaim CMS

Application
in package

Application

Table of Contents

Constants

DEFAULT_PAGE_NOT_FOUND_HANDLER  = '\\Arikaim\\Core\\Controllers\\ErrorController:showPageNotFound'
Sefault controller class for page not found error
DEFUALT_ERROR_HANDLER  = '\\Arikaim\\Core\\Framework\\ErrorHandler'
Default error handler class

Properties

$container  : ContainerInterface
App container
$errorHandler  : object|null
Error handler
$errorHandlerClass  : string|null
Error handler class
$factory  : object
Psr17 factory
$middlewares  : array<string|int, mixed>
Global middlewares
$router  : RouterInterface
Router

Methods

__construct()  : mixed
Constructor
addMiddleware()  : void
Add global middleware
addRoute()  : void
Add route
addRouteMiddleware()  : void
Add route middleware
createResponse()  : ResponseInterface
Create response
emit()  : void
Emit response
getContainer()  : ContainerInterface
Get container
getFactory()  : object
Return psr17 factory
getRouter()  : RouterInterface
Get router
handleRequest()  : ResponseInterface
Handle http request
resolveCallable()  : array<string|int, mixed>
Resolve route handler
run()  : void
Run application
setMiddlewares()  : void
Set middlewares
setRouter()  : void
Swt router
handleException()  : ResponseInterface
Render app exception
handleRoute()  : ResponseInterface
Execute route handler
resolveRouteMiddleware()  : MiddlewareInterface
Create middleware instance
emitHeaders()  : void
Emit headers
resolveErrorHandler()  : void
Create error handler if not set

Constants

DEFAULT_PAGE_NOT_FOUND_HANDLER

Sefault controller class for page not found error

public mixed DEFAULT_PAGE_NOT_FOUND_HANDLER = '\\Arikaim\\Core\\Controllers\\ErrorController:showPageNotFound'

DEFUALT_ERROR_HANDLER

Default error handler class

public mixed DEFUALT_ERROR_HANDLER = '\\Arikaim\\Core\\Framework\\ErrorHandler'

Properties

$container

App container

protected ContainerInterface $container

$errorHandler

Error handler

protected object|null $errorHandler = null

$errorHandlerClass

Error handler class

protected string|null $errorHandlerClass

$middlewares

Global middlewares

protected array<string|int, mixed> $middlewares = []

Methods

__construct()

Constructor

public __construct(ContainerInterface $container, RouterInterface $router[, string|null $errorHandlerClass = null ][, object|null $factory = null ]) : mixed
Parameters
$container : ContainerInterface
$router : RouterInterface
$errorHandlerClass : string|null = null
$factory : object|null = null

addMiddleware()

Add global middleware

public addMiddleware(object|string $middleware[, array<string|int, mixed> $options = [] ]) : void
Parameters
$middleware : object|string
$options : array<string|int, mixed> = []

addRoute()

Add route

public addRoute(string $method, string $pattern, string $handlerClass[, array<string|int, mixed> $options = [] ][, string|int|null $routeId = null ]) : void
Parameters
$method : string
$pattern : string
$handlerClass : string
$options : array<string|int, mixed> = []
$routeId : string|int|null = null

addRouteMiddleware()

Add route middleware

public addRouteMiddleware(string $method, string $routeHandlerClass, string|object $middleware) : void
Parameters
$method : string
$routeHandlerClass : string
$middleware : string|object

createResponse()

Create response

public createResponse([int $status = 200 ]) : ResponseInterface
Parameters
$status : int = 200
Return values
ResponseInterface

emit()

Emit response

public static emit(ResponseInterface $response) : void
Parameters
$response : ResponseInterface

getContainer()

Get container

public getContainer() : ContainerInterface
Return values
ContainerInterface

getFactory()

Return psr17 factory

public getFactory() : object
Return values
object

handleRequest()

Handle http request

public handleRequest(ServerRequestInterface $request, ResponseInterface $response[, array<string|int, mixed>|null $options = [] ]) : ResponseInterface
Parameters
$request : ServerRequestInterface
$response : ResponseInterface
$options : array<string|int, mixed>|null = []
Return values
ResponseInterface

resolveCallable()

Resolve route handler

public resolveCallable(string $callable, ResponseInterface $response) : array<string|int, mixed>
Parameters
$callable : string
$response : ResponseInterface
Return values
array<string|int, mixed>

run()

Run application

public run([ServerRequestInterface|null $request = null ][, array<string|int, mixed> $options = [] ]) : void
Parameters
$request : ServerRequestInterface|null = null
$options : array<string|int, mixed> = []

setMiddlewares()

Set middlewares

public setMiddlewares(array<string|int, mixed> $middlewares) : void
Parameters
$middlewares : array<string|int, mixed>

handleException()

Render app exception

protected handleException(Throwable $exception, ServerRequestInterface $request, ResponseInterface $response) : ResponseInterface
Parameters
$exception : Throwable
$request : ServerRequestInterface
$response : ResponseInterface
Return values
ResponseInterface

handleRoute()

Execute route handler

protected handleRoute(array<string|int, mixed> $route, ServerRequestInterface $request, ResponseInterface $response) : ResponseInterface
Parameters
$route : array<string|int, mixed>
$request : ServerRequestInterface
$response : ResponseInterface
Return values
ResponseInterface

resolveRouteMiddleware()

Create middleware instance

protected resolveRouteMiddleware(string $middlewareClass, array<string|int, mixed> $options) : MiddlewareInterface
Parameters
$middlewareClass : string
$options : array<string|int, mixed>
Return values
MiddlewareInterface

emitHeaders()

Emit headers

private static emitHeaders(ResponseInterface $response) : void
Parameters
$response : ResponseInterface

resolveErrorHandler()

Create error handler if not set

private resolveErrorHandler() : void

        
On this page

Search results