Methods

handleHttpRequest()

handleHttpRequest(\swoole_http_client  $request) 

HTTP请求解析

Parameters

\swoole_http_client $request

请求对象

getControllerName()

getControllerName() : string

获取控制器名称

Returns

string

getControllerClassName()

getControllerClassName() : string

获取请求对应的控制器完全命名空间类名

Returns

string

findControllerClassName()

findControllerClassName() : boolean

计算Controller Class Name

Returns

boolean

getMethodName()

getMethodName() : string

获取方法名称

Returns

string

getParams()

getParams() : array

获取请求的参数

Returns

array

getPath()

getPath() : string

获取请求的PATH

Returns

string

getIsRpc()

getIsRpc() : boolean

判断请求是否为RPC请求

Returns

boolean

getVerb()

getVerb() : string|null

获取请求的方法

Returns

string|null

setControllerName()

setControllerName(string  $name) : $this

设置请求的控制器标识

Parameters

string $name

控制器标识

Returns

$this

setMethodName()

setMethodName(string  $name) : $this

设置请求控制器的方法标识

Parameters

string $name

控制器的方法标识

Returns

$this

setParams()

setParams(array  $params) : $this

设置请求的参数

Parameters

array $params

请求的参数

Returns

$this

getEnableCache()

getEnableCache() : boolean

获取是否支持路由Cache

Returns

boolean

setRouteCache()

setRouteCache(string  $path, array  $callable) : $this

缓存路由

Parameters

string $path

URL Path

array $callable

路由解析结果

Returns

$this

getRouteCache()

getRouteCache(string  $path) : mixed|null

获取已缓存的路由信息

Parameters

string $path

URL Path

Returns

mixed|null