PHP Класс Phprest\Application

Наследование: 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
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$configuration Config
$exceptionDecorator callable
$router League\Route\RouteCollection
$stackBuilder Stack\Builder

Открытые методы

Метод Описание
__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.

Защищенные методы

Метод Описание
setErrorHandler ( ) : void

Описание методов

__construct() публичный Метод

public __construct ( Config $configuration )
$configuration Config

delete() публичный Метод

Add a DELETE route.
public delete ( string $route, mixed $action ) : void
$route string
$action mixed
Результат void

get() публичный Метод

Add a GET route.
public get ( string $route, mixed $action ) : void
$route string
$action mixed
Результат void

getConfiguration() публичный Метод

public getConfiguration ( ) : Config
Результат Config

getEventEmitter() публичный Метод

Return the event emitter.
public getEventEmitter ( ) : League\Event\EmitterInterface
Результат League\Event\EmitterInterface

getRouter() публичный Метод

public getRouter ( ) : RouteCollection
Результат Phprest\Router\RouteCollection

handle() публичный Метод

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
Результат Symfony\Component\HttpFoundation\Response

head() публичный Метод

Add a HEAD route
public head ( string $route, mixed $action ) : void
$route string
$action mixed
Результат void

options() публичный Метод

Add a OPTIONS route
public options ( string $route, mixed $action ) : void
$route string
$action mixed
Результат void

patch() публичный Метод

Add a PATCH route.
public patch ( string $route, mixed $action ) : void
$route string
$action mixed
Результат void

post() публичный Метод

Add a POST route.
public post ( string $route, mixed $action ) : void
$route string
$action mixed
Результат void

put() публичный Метод

Add a PUT route.
public put ( string $route, mixed $action ) : void
$route string
$action mixed
Результат void

registerController() публичный Метод

public registerController ( string $class ) : void
$class string Namespaced class name
Результат void

registerMiddleware() публичный Метод

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

registerService() публичный Метод

public registerService ( Phprest\Service\Serviceable $service, Phprest\Service\Configurable $config ) : void
$service Phprest\Service\Serviceable
$config Phprest\Service\Configurable
Результат void

run() публичный Метод

Run the application
public run ( Request $request = null ) : string
$request Symfony\Component\HttpFoundation\Request
Результат string

setErrorHandler() защищенный Метод

protected setErrorHandler ( ) : void
Результат void

setExceptionDecorator() публичный Метод

Set the exception decorator.
public setExceptionDecorator ( callable $func ) : void
$func callable
Результат void

subscribe() публичный Метод

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

terminate() публичный Метод

Terminates a request/response cycle.
public terminate ( Request $request, Response $response ) : void
$request Symfony\Component\HttpFoundation\Request
$response Symfony\Component\HttpFoundation\Response
Результат void

Описание свойств

$configuration защищенное свойство

protected Config,phprest $configuration
Результат Config

$exceptionDecorator защищенное свойство

protected callable $exceptionDecorator
Результат callable

$router защищенное свойство

protected RouteCollection,League\Route $router
Результат League\Route\RouteCollection

$stackBuilder защищенное свойство

protected Builder,Stack $stackBuilder
Результат Stack\Builder