PHP Class CapMousse\ReactRestify\Server

Exibir arquivo Open project: capmousse/react-restify Class Usage Examples

Public Properties

Property Type Description
$name string Name of the server
$version null Version of the API

Public Methods

Method Description
__call ( string $name, array $arguments )
__construct ( null $name = null, null $version = null )
__invoke ( React\Http\Request $httpRequest, React\Http\Response $httpResponse ) Parse request from user
group ( String $prefix, Callable $callback ) : CapMousse\ReactRestify\Routing\Routes Create a new group of route
on ( String $event, Callable $callback ) Manual router event manager
setAccessControlAllowOrigin ( string $origin ) The the Access-Control-Allow-Origin header

Private Methods

Method Description
initEvents ( ) : void Init default event catch

Method Details

__call() public method

public __call ( string $name, array $arguments )
$name string method to call
$arguments array

__construct() public method

public __construct ( null $name = null, null $version = null )
$name null
$version null

__invoke() public method

Parse request from user
public __invoke ( React\Http\Request $httpRequest, React\Http\Response $httpResponse )
$httpRequest React\Http\Request
$httpResponse React\Http\Response

group() public method

Create a new group of route
public group ( String $prefix, Callable $callback ) : CapMousse\ReactRestify\Routing\Routes
$prefix String prefix of the routes
$callback Callable
return CapMousse\ReactRestify\Routing\Routes

on() public method

Manual router event manager
public on ( String $event, Callable $callback )
$event String
$callback Callable

setAccessControlAllowOrigin() public method

The the Access-Control-Allow-Origin header
public setAccessControlAllowOrigin ( string $origin )
$origin string

Property Details

$name public_oe property

Name of the server
public string $name
return string

$version public_oe property

Version of the API
public null $version
return null