Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
RouterCacheTrait Class Reference
+ Inheritance diagram for RouterCacheTrait:

Static Public Member Functions

static getControllers (string $subClass="\\Ubiquity\\controllers\\Controller", bool $backslash=false, bool $includeSubclass=false, bool $includeAbstract=false)
 
static controllerCacheUpdated (array &$config)
 
static storeDynamicRoutes (bool $isRest=false)
 
static getControllerCache (bool $isRest=false)
 
static getControllerCacheByDomain (bool $isRest=false, string $domain='')
 
static getControllerCacheIndex (bool $isRest=false)
 
static getRouteCache (string $routePath, array $routeArray, int $duration)
 
static isExpired (string $routePath, int $duration)
 
static setExpired (string $routePath)
 
static setRouteCache (string $routePath)
 Stores a route response in cache.
 
static addAdminRoutes ()
 
static getRoutes ()
 
static getControllerRoutes (string $controllerClass, bool $isRest=false)
 
static addRoute (string $path, string $controller, string $action='index', ?array $methods=null, string $name='', bool $isRest=false, int $priority=0, $callback=null)
 
static addRoutes ($pathArray, $controller, $action='index', $methods=null, $name='')
 
static addRestRoutes ($pathArray, $controller, $action='index', $methods=null, $name='')
 
static warmUpControllers (?array $controllers=null)
 Preloads controllers.
 

Static Protected Member Functions

static expired (string $key, int $duration)
 

Static Private Member Functions

static storeRouteResponse (string $key, ?string $response)
 
static getRouteKey (string $routePath)
 
static addRoutes_ ($pathArray, $controller, $action='index', $methods=null, $name='', $isRest=false)
 

Detailed Description

Definition at line 24 of file RouterCacheTrait.php.

Member Function Documentation

◆ addAdminRoutes()

static addAdminRoutes ( )
static

Definition at line 162 of file RouterCacheTrait.php.

◆ addRestRoutes()

static addRestRoutes (   $pathArray,
  $controller,
  $action = 'index',
  $methods = null,
  $name = '' 
)
static

Definition at line 200 of file RouterCacheTrait.php.

◆ addRoute()

static addRoute ( string  $path,
string  $controller,
string  $action = 'index',
?array  $methods = null,
string  $name = '',
bool  $isRest = false,
int  $priority = 0,
  $callback = null 
)
static

Definition at line 190 of file RouterCacheTrait.php.

◆ addRoutes()

static addRoutes (   $pathArray,
  $controller,
  $action = 'index',
  $methods = null,
  $name = '' 
)
static

Definition at line 196 of file RouterCacheTrait.php.

◆ addRoutes_()

static addRoutes_ (   $pathArray,
  $controller,
  $action = 'index',
  $methods = null,
  $name = '',
  $isRest = false 
)
staticprivate

Definition at line 204 of file RouterCacheTrait.php.

◆ controllerCacheUpdated()

static controllerCacheUpdated ( array &  $config)
static

Definition at line 28 of file RouterCacheTrait.php.

◆ expired()

static expired ( string  $key,
int  $duration 
)
staticprotected

Definition at line 134 of file RouterCacheTrait.php.

◆ getControllerCache()

static getControllerCache ( bool  $isRest = false)
static
Parameters
boolean$isRest
Returns
array

Definition at line 64 of file RouterCacheTrait.php.

◆ getControllerCacheByDomain()

static getControllerCacheByDomain ( bool  $isRest = false,
string  $domain = '' 
)
static
Parameters
boolean$isRest
string$domain
Returns
array

Definition at line 78 of file RouterCacheTrait.php.

◆ getControllerCacheIndex()

static getControllerCacheIndex ( bool  $isRest = false)
static
Parameters
boolean$isRest
Returns
array

Definition at line 111 of file RouterCacheTrait.php.

◆ getControllerRoutes()

static getControllerRoutes ( string  $controllerClass,
bool  $isRest = false 
)
static

Definition at line 170 of file RouterCacheTrait.php.

◆ getControllers()

static getControllers ( string  $subClass = "\\Ubiquity\\controllers\\Controller",
bool  $backslash = false,
bool  $includeSubclass = false,
bool  $includeAbstract = false 
)
staticabstract

◆ getRouteCache()

static getRouteCache ( string  $routePath,
array  $routeArray,
int  $duration 
)
static

Definition at line 119 of file RouterCacheTrait.php.

◆ getRouteKey()

static getRouteKey ( string  $routePath)
staticprivate

Definition at line 55 of file RouterCacheTrait.php.

◆ getRoutes()

static getRoutes ( )
static

Definition at line 166 of file RouterCacheTrait.php.

◆ isExpired()

static isExpired ( string  $routePath,
int  $duration 
)
static

Definition at line 138 of file RouterCacheTrait.php.

◆ setExpired()

static setExpired ( string  $routePath)
static

Definition at line 142 of file RouterCacheTrait.php.

◆ setRouteCache()

static setRouteCache ( string  $routePath)
static

Stores a route response in cache.

Parameters
string$routePathThe route path
Returns
string|null

Definition at line 154 of file RouterCacheTrait.php.

◆ storeDynamicRoutes()

static storeDynamicRoutes ( bool  $isRest = false)
static

Definition at line 43 of file RouterCacheTrait.php.

◆ storeRouteResponse()

static storeRouteResponse ( string  $key,
?string  $response 
)
staticprivate

Definition at line 49 of file RouterCacheTrait.php.

◆ warmUpControllers()

static warmUpControllers ( ?array  $controllers = null)
static

Preloads controllers.

To use only with async servers (Swoole, Workerman)

Parameters
?array$controllers

Definition at line 220 of file RouterCacheTrait.php.


The documentation for this class was generated from the following file: