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

Inheritance: extends Kraken\Network\NetworkComponentInterface
Afficher le fichier Open project: kraken-php/framework Interface Usage Examples

Méthodes publiques

Méthode 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 méthode

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
Résultat Kraken\Network\Http\Component\Router\HttpRouterInterface

allowOrigin() public méthode

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
Résultat Kraken\Network\Http\Component\Router\HttpRouterInterface

disallowOrigin() public méthode

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

existsRoute() public méthode

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

getAllowedOrigins() public méthode

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

isOriginAllowed() public méthode

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

removeRoute() public méthode

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