PHP Class Kraken\Network\Http\Component\Router\HttpRouter

Inheritance: implements Kraken\Network\Http\Component\Router\HttpRouterInterface
Show file Open project: kraken-php/framework

Protected Properties

Property Type Description
$allowedOrigins string[]
$checkOrigin boolean
$context Symfony\Component\Routing\RequestContext
$host string
$matcher Symfony\Component\Routing\Matcher\UrlMatcherInterface
$routes Symfony\Component\Routing\RouteCollection

Public Methods

Method Description
__construct ( Kraken\Network\NetworkComponentAwareInterface $aware = null, mixed[] $params = [] )
__destruct ( )
addRoute ( $path, Kraken\Network\NetworkComponentInterface $component )
allowOrigin ( $address )
disallowOrigin ( $address )
existsRoute ( $path )
getAllowedOrigins ( )
handleConnect ( Kraken\Network\NetworkConnectionInterface $conn )
handleDisconnect ( Kraken\Network\NetworkConnectionInterface $conn )
handleError ( Kraken\Network\NetworkConnectionInterface $conn, $ex )
handleMessage ( Kraken\Network\NetworkConnectionInterface $conn, Kraken\Network\NetworkMessageInterface $message )
isOriginAllowed ( $address )
removeRoute ( $path )

Protected Methods

Method Description
close ( Kraken\Network\NetworkConnectionInterface $conn, integer $code = 400 ) : null Close a connection with an HTTP response.

Method Details

__construct() public method

public __construct ( Kraken\Network\NetworkComponentAwareInterface $aware = null, mixed[] $params = [] )
$aware Kraken\Network\NetworkComponentAwareInterface
$params mixed[]

__destruct() public method

public __destruct ( )

addRoute() public method

public addRoute ( $path, Kraken\Network\NetworkComponentInterface $component )
$component Kraken\Network\NetworkComponentInterface

allowOrigin() public method

public allowOrigin ( $address )

close() protected method

Close a connection with an HTTP response.
protected close ( Kraken\Network\NetworkConnectionInterface $conn, integer $code = 400 ) : null
$conn Kraken\Network\NetworkConnectionInterface
$code integer
return null

disallowOrigin() public method

public disallowOrigin ( $address )

existsRoute() public method

public existsRoute ( $path )

getAllowedOrigins() public method

public getAllowedOrigins ( )

handleConnect() public method

public handleConnect ( Kraken\Network\NetworkConnectionInterface $conn )
$conn Kraken\Network\NetworkConnectionInterface

handleDisconnect() public method

public handleDisconnect ( Kraken\Network\NetworkConnectionInterface $conn )
$conn Kraken\Network\NetworkConnectionInterface

handleError() public method

public handleError ( Kraken\Network\NetworkConnectionInterface $conn, $ex )
$conn Kraken\Network\NetworkConnectionInterface

handleMessage() public method

public handleMessage ( Kraken\Network\NetworkConnectionInterface $conn, Kraken\Network\NetworkMessageInterface $message )
$conn Kraken\Network\NetworkConnectionInterface
$message Kraken\Network\NetworkMessageInterface

isOriginAllowed() public method

public isOriginAllowed ( $address )

removeRoute() public method

public removeRoute ( $path )

Property Details

$allowedOrigins protected property

protected string[] $allowedOrigins
return string[]

$checkOrigin protected property

protected bool $checkOrigin
return boolean

$context protected property

protected RequestContext,Symfony\Component\Routing $context
return Symfony\Component\Routing\RequestContext

$host protected property

protected string $host
return string

$matcher protected property

protected UrlMatcherInterface,Symfony\Component\Routing\Matcher $matcher
return Symfony\Component\Routing\Matcher\UrlMatcherInterface

$routes protected property

protected RouteCollection,Symfony\Component\Routing $routes
return Symfony\Component\Routing\RouteCollection