Properties

$request

$request : \Psr\Http\Message\ServerRequestInterface

Type

\Psr\Http\Message\ServerRequestInterface

$middleWares

$middleWares : \SplStack

Type

\SplStack

$base

$base : string

Type

string

$middleWareInstance

$middleWareInstance : \SplStack

Type

\SplStack

$requestAttributes

$requestAttributes : array

Type

array — Additional attributes will be added to the initial Request object

Methods

__construct()

__construct(  $base,   $requestAttributes = array()) 

Server constructor.

Parameters

$base
$requestAttributes

registerCatchAll()

registerCatchAll() 

getRequest()

getRequest() : \Psr\Http\Message\ServerRequestInterface

Returns

\Psr\Http\Message\ServerRequestInterface

updateRequest()

updateRequest(\Psr\Http\Message\ServerRequestInterface  $request) 

Parameters

\Psr\Http\Message\ServerRequestInterface $request

callNextMiddleWare()

callNextMiddleWare(\Psr\Http\Message\ServerRequestInterface  $requestInterface, \Psr\Http\Message\ResponseInterface  $responseInterface, callable|null  $next = null) : \Psr\Http\Message\ResponseInterface

To be used by middlewares

Parameters

\Psr\Http\Message\ServerRequestInterface $requestInterface
\Psr\Http\Message\ResponseInterface $responseInterface
callable|null $next

Returns

\Psr\Http\Message\ResponseInterface

callNextMiddleWareAndRewind()

callNextMiddleWareAndRewind(callable  $comparisonFunction, \Psr\Http\Message\ServerRequestInterface  $requestInterface, \Psr\Http\Message\ResponseInterface  $responseInterface, callable|null  $next = null) : \Psr\Http\Message\ResponseInterface

Parameters

callable $comparisonFunction
\Psr\Http\Message\ServerRequestInterface $requestInterface
\Psr\Http\Message\ResponseInterface $responseInterface
callable|null $next

Returns

\Psr\Http\Message\ResponseInterface

addMiddleware()

addMiddleware(callable  $middleWareCallable) 

Parameters

callable $middleWareCallable

listen()

listen() 

catchError()

catchError(  $code,   $message,   $fichier,   $ligne,   $context) 

Error Catcher for PHP errors. Depending on the SERVER_DEBUG config shows the file/line info or not.

Parameters

$code
$message
$fichier
$ligne
$context

catchException()

catchException(\Exception  $exception) 

Catch exceptions, @see catchError

Parameters

\Exception $exception

stackMiddleWares()

stackMiddleWares() 

nextCallable()

nextCallable(\Psr\Http\Message\ServerRequestInterface  $request, \Psr\Http\Message\ResponseInterface  $response) : \Psr\Http\Message\ResponseInterface

Parameters

\Psr\Http\Message\ServerRequestInterface $request
\Psr\Http\Message\ResponseInterface $response

Returns

\Psr\Http\Message\ResponseInterface

initServerRequest()

initServerRequest(boolean  $rest = false) : \Psr\Http\Message\ServerRequestInterface

Parameters

boolean $rest

Returns

\Psr\Http\Message\ServerRequestInterface