PHP Interface Kraken\Network\Http\Component\Router\HttpRouterInterface

Inheritance: extends Kraken\Network\NetworkComponentInterface
Show file Open project: kraken-php/framework Interface Usage Examples

Public Methods

Method Description
addRoute ( string $path, Kraken\Network\NetworkComponentInterface $component ) : Kraken\Network\Http\Component\Router\HttpRouterInterface Add an endpoint/application to the server.
allowOrigin ( string $address ) : Kraken\Network\Http\Component\Router\HttpRouterInterface Add an origin to the whitelist that will be allowed to connect to your application.
disallowOrigin ( string $address ) : Kraken\Network\Http\Component\Router\HttpRouterInterface Remove an origin so it will not be able access your routes.
existsRoute ( string $path ) : boolean Check if there exists any endpoint/application to the server on given route.
getAllowedOrigins ( ) : string[] Get an array of all the addresses allowed.
isOriginAllowed ( string $address ) : boolean Check if given $address is allowed or not.
removeRoute ( string $path ) : Kraken\Network\Http\Component\Router\HttpRouterInterface Remote endpoint/application from the server.

Method Details

addRoute() public method

Add an endpoint/application to the server.
public addRoute ( string $path, Kraken\Network\NetworkComponentInterface $component ) : Kraken\Network\Http\Component\Router\HttpRouterInterface
$path string
$component Kraken\Network\NetworkComponentInterface
return Kraken\Network\Http\Component\Router\HttpRouterInterface

allowOrigin() public method

Add an origin to the whitelist that will be allowed to connect to your application.
public allowOrigin ( string $address ) : Kraken\Network\Http\Component\Router\HttpRouterInterface
$address string
return Kraken\Network\Http\Component\Router\HttpRouterInterface

disallowOrigin() public method

Remove an origin so it will not be able access your routes.
public disallowOrigin ( string $address ) : Kraken\Network\Http\Component\Router\HttpRouterInterface
$address string
return Kraken\Network\Http\Component\Router\HttpRouterInterface

existsRoute() public method

Check if there exists any endpoint/application to the server on given route.
public existsRoute ( string $path ) : boolean
$path string
return boolean

getAllowedOrigins() public method

Get an array of all the addresses allowed.
public getAllowedOrigins ( ) : string[]
return string[]

isOriginAllowed() public method

Check if given $address is allowed or not.
public isOriginAllowed ( string $address ) : boolean
$address string
return boolean

removeRoute() public method

Remote endpoint/application from the server.
public removeRoute ( string $path ) : Kraken\Network\Http\Component\Router\HttpRouterInterface
$path string
return Kraken\Network\Http\Component\Router\HttpRouterInterface