PHP Class Phprest\Application

Inheritance: implements Symfony\Component\HttpKernel\HttpKernelInterface, implements Symfony\Component\HttpKernel\TerminableInterface, implements League\Container\ContainerAwareInterface, implements League\Event\ListenerAcceptorInterface, use trait League\Event\EmitterTrait, use trait League\Container\ContainerAwareTrait, use trait Phprest\Service\Hateoas\Getter, use trait Phprest\Service\Hateoas\Util, use trait Phprest\Service\Logger\Getter
Afficher le fichier Open project: phprest/phprest Class Usage Examples

Protected Properties

Свойство Type Description
$configuration Config
$exceptionDecorator callable
$router League\Route\RouteCollection
$stackBuilder Stack\Builder

Méthodes publiques

Méthode Description
__construct ( Config $configuration )
delete ( string $route, mixed $action ) : void Add a DELETE route.
get ( string $route, mixed $action ) : void Add a GET route.
getConfiguration ( ) : Config
getEventEmitter ( ) : League\Event\EmitterInterface Return the event emitter.
getRouter ( ) : RouteCollection
handle ( Request $request, integer $type = self::MASTER_REQUEST, boolean $catch = true ) : Response Handle the request.
head ( string $route, mixed $action ) : void Add a HEAD route
options ( string $route, mixed $action ) : void Add a OPTIONS route
patch ( string $route, mixed $action ) : void Add a PATCH route.
post ( string $route, mixed $action ) : void Add a POST route.
put ( string $route, mixed $action ) : void Add a PUT route.
registerController ( string $class ) : void
registerMiddleware ( string $classPath, array $arguments = [] )
registerService ( Phprest\Service\Serviceable $service, Phprest\Service\Configurable $config ) : void
run ( Request $request = null ) : string Run the application
setExceptionDecorator ( callable $func ) : void Set the exception decorator.
subscribe ( string $event, callable $listener, integer $priority = ListenerAcceptorInterface::P_NORMAL ) Subscribe to an event.
terminate ( Request $request, Response $response ) : void Terminates a request/response cycle.

Méthodes protégées

Méthode Description
setErrorHandler ( ) : void

Method Details

__construct() public méthode

public __construct ( Config $configuration )
$configuration Config

delete() public méthode

Add a DELETE route.
public delete ( string $route, mixed $action ) : void
$route string
$action mixed
Résultat void

get() public méthode

Add a GET route.
public get ( string $route, mixed $action ) : void
$route string
$action mixed
Résultat void

getConfiguration() public méthode

public getConfiguration ( ) : Config
Résultat Config

getEventEmitter() public méthode

Return the event emitter.
public getEventEmitter ( ) : League\Event\EmitterInterface
Résultat League\Event\EmitterInterface

getRouter() public méthode

public getRouter ( ) : RouteCollection
Résultat Phprest\Router\RouteCollection

handle() public méthode

Handle the request.
public handle ( Request $request, integer $type = self::MASTER_REQUEST, boolean $catch = true ) : Response
$request Symfony\Component\HttpFoundation\Request
$type integer
$catch boolean
Résultat Symfony\Component\HttpFoundation\Response

head() public méthode

Add a HEAD route
public head ( string $route, mixed $action ) : void
$route string
$action mixed
Résultat void

options() public méthode

Add a OPTIONS route
public options ( string $route, mixed $action ) : void
$route string
$action mixed
Résultat void

patch() public méthode

Add a PATCH route.
public patch ( string $route, mixed $action ) : void
$route string
$action mixed
Résultat void

post() public méthode

Add a POST route.
public post ( string $route, mixed $action ) : void
$route string
$action mixed
Résultat void

put() public méthode

Add a PUT route.
public put ( string $route, mixed $action ) : void
$route string
$action mixed
Résultat void

registerController() public méthode

public registerController ( string $class ) : void
$class string Namespaced class name
Résultat void

registerMiddleware() public méthode

public registerMiddleware ( string $classPath, array $arguments = [] )
$classPath string
$arguments array

registerService() public méthode

public registerService ( Phprest\Service\Serviceable $service, Phprest\Service\Configurable $config ) : void
$service Phprest\Service\Serviceable
$config Phprest\Service\Configurable
Résultat void

run() public méthode

Run the application
public run ( Request $request = null ) : string
$request Symfony\Component\HttpFoundation\Request
Résultat string

setErrorHandler() protected méthode

protected setErrorHandler ( ) : void
Résultat void

setExceptionDecorator() public méthode

Set the exception decorator.
public setExceptionDecorator ( callable $func ) : void
$func callable
Résultat void

subscribe() public méthode

Subscribe to an event.
public subscribe ( string $event, callable $listener, integer $priority = ListenerAcceptorInterface::P_NORMAL )
$event string
$listener callable
$priority integer

terminate() public méthode

Terminates a request/response cycle.
public terminate ( Request $request, Response $response ) : void
$request Symfony\Component\HttpFoundation\Request
$response Symfony\Component\HttpFoundation\Response
Résultat void

Property Details

$configuration protected_oe property

protected Config,phprest $configuration
Résultat Config

$exceptionDecorator protected_oe property

protected callable $exceptionDecorator
Résultat callable

$router protected_oe property

protected RouteCollection,League\Route $router
Résultat League\Route\RouteCollection

$stackBuilder protected_oe property

protected Builder,Stack $stackBuilder
Résultat Stack\Builder