Ubiquity  2.3.12
php rapid development framework
CacheManager Class Reference

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

+ Inheritance diagram for CacheManager:

Static Public Member Functions

static start (&$config)
 Starts the cache in dev mode, for generating the other caches Do not use in production. More...
 
static startProd (&$config)
 Starts the cache for production. More...
 
static startProdFromCtrl ()
 
static getCacheDirectory ()
 Returns the relative cache directory. More...
 
static getAbsoluteCacheDirectory ()
 Returns the absolute cache directory. More...
 
static getCacheSubDirectory ($subDirectory)
 Returns an absolute cache subdirectory. More...
 
static checkCache (&$config, $silent=false)
 Checks the existence of cache subdirectories and returns an array of cache folders. More...
 
static getCacheDirectories (&$config, $silent=false)
 Returns an associative array of cache folders (annotations, models, controllers, queries, views, seo, git, contents) More...
 
static clearCache (&$config, $type='all')
 Deletes files from a cache type. More...
 
static initCache (&$config, $type='all', $silent=false)
 
static getAllRoutes ()
 Returns an array of all defined routes, included REST routes. More...
 
- Static Public Member Functions inherited from RouterCacheTrait
static controllerCacheUpdated (&$config)
 
static storeDynamicRoutes ($isRest=false)
 
static getControllerCache ($isRest=false)
 
static getRouteCache ($routePath, $routeArray, $duration)
 
static isExpired ($routePath, $duration)
 
static setExpired ($routePath)
 
static setRouteCache ($routePath)
 
static addAdminRoutes ()
 
static getRoutes ()
 
static getControllerRoutes ($controllerClass, $isRest=false)
 
static addRoute ($path, $controller, $action='index', $methods=null, $name='', $isRest=false, $priority=0, $callback=null)
 
static addRoutes ($pathArray, $controller, $action='index', $methods=null, $name='')
 
static addRestRoutes ($pathArray, $controller, $action='index', $methods=null, $name='')
 
static getControllersFiles (&$config, $silent=false)
 
static getControllers ($subClass="\biquity\ontrollers\ontroller", $backslash=false, $includeSubclass=false, $includeAbstract=false)
 
static warmUpControllers ($controllers=null)
 Preloads controllers. More...
 
- Static Public Member Functions inherited from ModelsCacheTrait
static createOrmModelCache ($classname)
 
static getOrmModelCache ($classname)
 
static getModelCacheKey ($classname)
 
static modelCacheExists ($classname)
 
static initModelsCache (&$config, $forChecking=false, $silent=false)
 
static modelsCacheUpdated (&$config)
 Checks if the models cache is up to date. More...
 
static getModelsFiles (&$config, $silent=false)
 Returns an array of files corresponding to models. More...
 
static getModels (&$config, $silent=false, $databaseOffset='default')
 Returns an array of the models class names. More...
 
static getModelsDatabases ()
 
static warmUpModels (&$config, $offset='default', $models=null)
 Preloads models metadatas. More...
 
- Static Public Member Functions inherited from RestCacheTrait
static getRestRoutes ()
 
static getRestCache ()
 
static getRestResource ($controllerClass)
 
static getRestCacheController ($controllerClass)
 

Static Public Attributes

static $cache
 

Static Protected Member Functions

static getCacheInstance (&$config, $cacheDirectory, $postfix)
 
static _getFiles (&$config, $type, $silent=false)
 Returns an array of files from type $type. More...
 
- Static Protected Member Functions inherited from RouterCacheTrait
static _getFiles (&$config, $type, $silent=false)
 
static sortByPriority (&$array)
 
static expired ($key, $duration)
 
- Static Protected Member Functions inherited from ModelsCacheTrait
static _getFiles (&$config, $type, $silent=false)
 

Static Private Member Functions

static initialGetCacheDirectory (&$config)
 
static safeMkdir ($dir)
 
static _clearCache ($cacheDirectories, $type, $typeRef)
 
static register (AnnotationManager $annotationManager)
 

Static Private Attributes

static $cacheDirectory
 

Detailed Description

Manager for caches (Router, Rest, models).

Ubiquity$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.4

Definition at line 26 of file CacheManager.php.

Member Function Documentation

◆ _clearCache()

static _clearCache (   $cacheDirectories,
  $type,
  $typeRef 
)
staticprivate

Definition at line 187 of file CacheManager.php.

◆ _getFiles()

static _getFiles ( $config,
  $type,
  $silent = false 
)
staticprotected

Returns an array of files from type $type.

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

Definition at line 227 of file CacheManager.php.

◆ checkCache()

static checkCache ( $config,
  $silent = false 
)
static

Checks the existence of cache subdirectories and returns an array of cache folders.

Parameters
array$config
boolean$silent
Returns
string[]

Definition at line 117 of file CacheManager.php.

◆ clearCache()

static clearCache ( $config,
  $type = 'all' 
)
static

Deletes files from a cache type.

Parameters
array$config
string$type

Definition at line 172 of file CacheManager.php.

◆ getAbsoluteCacheDirectory()

static getAbsoluteCacheDirectory ( )
static

Returns the absolute cache directory.

Returns
string

Definition at line 96 of file CacheManager.php.

◆ getAllRoutes()

static getAllRoutes ( )
static

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

Returns
array

Definition at line 214 of file CacheManager.php.

◆ getCacheDirectories()

static getCacheDirectories ( $config,
  $silent = false 
)
static

Returns an associative array of cache folders (annotations, models, controllers, queries, views, seo, git, contents)

Parameters
array$config
boolean$silent
Returns
string[]

Definition at line 132 of file CacheManager.php.

◆ getCacheDirectory()

static getCacheDirectory ( )
static

Returns the relative cache directory.

Returns
string

Definition at line 87 of file CacheManager.php.

◆ getCacheInstance()

static getCacheInstance ( $config,
  $cacheDirectory,
  $postfix 
)
staticprotected

Definition at line 68 of file CacheManager.php.

◆ getCacheSubDirectory()

static getCacheSubDirectory (   $subDirectory)
static

Returns an absolute cache subdirectory.

Parameters
string$subDirectory
Returns
string

Definition at line 106 of file CacheManager.php.

◆ initCache()

static initCache ( $config,
  $type = 'all',
  $silent = false 
)
static
Parameters
array$config
string$type
boolean$silent

Definition at line 198 of file CacheManager.php.

◆ initialGetCacheDirectory()

static initialGetCacheDirectory ( $config)
staticprivate

Definition at line 78 of file CacheManager.php.

◆ register()

static register ( AnnotationManager  $annotationManager)
staticprivate

Definition at line 235 of file CacheManager.php.

◆ safeMkdir()

static safeMkdir (   $dir)
staticprivate

Definition at line 161 of file CacheManager.php.

◆ start()

static start ( $config)
static

Starts the cache in dev mode, for generating the other caches Do not use in production.

Parameters
array$config

Definition at line 42 of file CacheManager.php.

◆ startProd()

static startProd ( $config)
static

Starts the cache for production.

Parameters
array$config

Definition at line 55 of file CacheManager.php.

◆ startProdFromCtrl()

static startProdFromCtrl ( )
static

Definition at line 61 of file CacheManager.php.

Field Documentation

◆ $cache

$cache
static

Definition at line 32 of file CacheManager.php.

◆ $cacheDirectory

$cacheDirectory
staticprivate

Definition at line 34 of file CacheManager.php.


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