\hymie\routerRouterInfoHolder

保存路由表信息,路由表信息保存在缓存中

Summary

Methods
Properties
Constants
__construct()
hasRouterInfo()
addRouterInfo()
getControllerInfo()
sortRouters()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
$cache
$cacheKey
$routers
N/A

Properties

$cache

$cache : 

Type

$cacheKey

$cacheKey : 

Type

$routers

$routers : 

Type

Methods

__construct()

__construct(array  $modules) 

构造函数,检查缓存中是否有路由表,如有则使用否重新构造。

Parameters

array $modules

hasRouterInfo()

hasRouterInfo() : boolean

是否缓存了路由定义

Returns

boolean

addRouterInfo()

addRouterInfo(array  $routers) : void

将 $routers 与缓存中已有的路由表合并,若缓存中没有路由表,则创建新的缓存。

Parameters

array $routers

getControllerInfo()

getControllerInfo(string  $path) : array

根据路径获取匹配的控制器定义

Parameters

string $path

Returns

array —

[matchs, moduleControllerDef]

sortRouters()

sortRouters() : void

注册 shutdown 方法,对缓存中的路由根据访问次数进行排序。