Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
CacheManager Class Reference

Manager for caches (Router, Rest, models). More...

+ Inheritance diagram for CacheManager:

Static Public Member Functions

static startProd (array &$config)
 Starts the cache for production.
 
static startProdFromCtrl ()
 Starts the cache from a controller.
 
static getCacheDirectory ()
 Returns the relative cache directory.
 
static getAbsoluteCacheDirectory ()
 Returns the absolute cache directory.
 
static getCacheSubDirectory (string $subDirectory)
 Returns an absolute cache subdirectory.
 
static getAllRoutes ()
 Returns an array of all defined routes, included REST routes.
 
- Static Public Member Functions inherited from DevCacheTrait
static initModelsCache (array &$config, bool $forChecking=false, bool $silent=false)
 
static getAnnotationsEngineInstance ()
 
static start (array &$config)
 Starts the cache in dev mode, for generating the other caches Do not use in production.
 
static registerAnnotations (array $nameClasses)
 
static checkCache (array &$config, bool $silent=false)
 Checks the existence of cache subdirectories and returns an array of cache folders.
 
static getCacheDirectories (array &$config, bool $silent=false)
 Returns an associative array of cache folders (annotations, models, controllers, queries, views, seo, git, contents)
 
static clearCache (array &$config, string $type='all')
 Deletes files from a cache type.
 
static initCache (array &$config, string $type='all', bool $silent=false)
 
- Static Public Member Functions inherited from RouterCacheTrait
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 Public Member Functions inherited from DevRouterCacheTrait
static getAnnotationsEngineInstance ()
 
static getFirstPartIndex (string $element)
 
static getControllersFiles (array &$config, bool $silent=false)
 
static getAllControllersFiles (array &$config, bool $silent=false)
 
static getControllers (string $subClass="\\Ubiquity\\controllers\\Controller", bool $backslash=false, bool $includeSubclass=false, bool $includeAbstract=false)
 
- Static Public Member Functions inherited from ModelsCacheTrait
static createOrmModelCache (string $classname)
 
static getOrmModelCache (string $classname)
 
static getModelCacheKey (string $classname)
 
static modelCacheExists (string $classname)
 
static initModelsCache (array &$config, bool $forChecking=false, bool $silent=false)
 
static modelsCacheUpdated (array &$config)
 Checks if the models cache is up to date.
 
static getModelsFiles (array &$config, bool $silent=false)
 Returns an array of files corresponding to models.
 
static getAllModelsFiles (array &$config, bool $silent=false)
 Returns an array of all model files.
 
static getModels (array &$config, bool $silent=false, string $databaseOffset='default')
 Returns an array of the models class names.
 
static getModelsNamespace (string $databaseOffset='default')
 
static getModelsDatabases ()
 
static storeModelsDatabases (array $modelsDatabases)
 
static getDatabases ()
 
static warmUpModels (array &$config, string $offset='default', ?array $models=null)
 Preloads models metadatas.
 
- Static Public Member Functions inherited from RestCacheTrait
static getRestRoutes ()
 
static getRestCache ()
 
static getRestResource (string $controllerClass)
 
static getRestCacheController (string $controllerClass)
 

Static Public Attributes

static $cache
 

Static Protected Member Functions

static getCacheInstance (array &$config, string $cacheDirectory, string $postfix)
 
static _getFiles (array &$config, string $type, bool $silent=false,?string $domain=null)
 Returns an array of files from type $type.
 
static _getAllFiles (array &$config, string $type, bool $silent=false)
 Returns an array of all files from type $type.
 
- Static Protected Member Functions inherited from DevCacheTrait
static initRestCache (array &$config, bool $silent=false)
 
static initRouterCache (array &$config, bool $silent=false)
 
- Static Protected Member Functions inherited from RouterCacheTrait
static expired (string $key, int $duration)
 
- Static Protected Member Functions inherited from DevRouterCacheTrait
static createIndex (array $routes)
 
static sortByPriority (array &$array)
 
static initRouterCache (array &$config, bool $silent=false)
 
- Static Protected Member Functions inherited from ModelsCacheTrait
static _getFiles (array &$config, string $type, bool $silent=false)
 
- Static Protected Member Functions inherited from RestCacheTrait
static initRestCache (array &$config, bool $silent=false)
 

Static Private Attributes

static $cacheDirectory
 

Detailed Description

Manager for caches (Router, Rest, models).

Ubiquity\cache$CacheManager This class is part of Ubiquity

Author
jcheron myadd.nosp@m.ress.nosp@m.mail@.nosp@m.gmai.nosp@m.l.com
Version
1.0.6

Definition at line 28 of file CacheManager.php.

Member Function Documentation

◆ _getAllFiles()

static _getAllFiles ( array &  $config,
string  $type,
bool  $silent = false 
)
staticprotected

Returns an array of all files from type $type.

Parameters
array$config
string$type
boolean$silent
Returns
array

Reimplemented from ModelsCacheTrait.

Definition at line 140 of file CacheManager.php.

◆ _getFiles()

static _getFiles ( array &  $config,
string  $type,
bool  $silent = false,
?string  $domain = null 
)
staticprotected

Returns an array of files from type $type.

Parameters
array$config
string$type
boolean$silent
?string$domain
Returns
array

Definition at line 118 of file CacheManager.php.

◆ getAbsoluteCacheDirectory()

static getAbsoluteCacheDirectory ( )
static

Returns the absolute cache directory.

Returns
string

Definition at line 84 of file CacheManager.php.

◆ getAllRoutes()

static getAllRoutes ( )
static

Returns an array of all defined routes, included REST routes.

Returns
array

Definition at line 104 of file CacheManager.php.

◆ getCacheDirectory()

static getCacheDirectory ( )
static

Returns the relative cache directory.

Returns
string

Definition at line 75 of file CacheManager.php.

◆ getCacheInstance()

static getCacheInstance ( array &  $config,
string  $cacheDirectory,
string  $postfix 
)
staticprotected

Reimplemented from DevCacheTrait.

Definition at line 59 of file CacheManager.php.

◆ getCacheSubDirectory()

static getCacheSubDirectory ( string  $subDirectory)
static

Returns an absolute cache subdirectory.

Parameters
string$subDirectory
Returns
string

Definition at line 94 of file CacheManager.php.

◆ startProd()

static startProd ( array &  $config)
static

Starts the cache for production.

Parameters
array$config

Definition at line 43 of file CacheManager.php.

◆ startProdFromCtrl()

static startProdFromCtrl ( )
static

Starts the cache from a controller.

Definition at line 52 of file CacheManager.php.

Field Documentation

◆ $cache

$cache
static

Definition at line 34 of file CacheManager.php.

◆ $cacheDirectory

$cacheDirectory
staticprivate

Definition at line 36 of file CacheManager.php.


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