Class modCacheManager

Description

The default xPDOCacheManager instance for MODx.

Through this class, MODx provides several types of default, file-based caching to reduce load and dependencies on the database, including:

  • partial modResource caching, which stores the object properties, along with individual modElement cache items
  • full caching of modContext and modSystemSetting data
  • object-level caching
  • db query-level caching
  • optional JSON object caching for increased Ajax performance possibilities

Located in /model/modx/modcachemanager.class.php (line 24)

xPDOCacheManager
   |
   --modCacheManager
Variable Summary
 mixed $modx
Method Summary
 modCacheManager __construct ( &$xpdo, [ $options = array()])
 void clearCache ([ $paths = array()], [ $options = array()])
 array generateActionMap (string $cacheKey, [ $options = array()])
 array generateConfig ([ $options = array()])
 array generateContext ( $key, [ $options = array()], modContext $obj)
 array generateLexiconTopic (string $cacheKey, [array $entries = array()], [array $options = array()])
 array generateResource (modResource &$obj, [ $options = array()], modResource $obj)
 boolean|string generateScript (modScript &$objElement, [string $objContent = null], [ $options = array()], modScript $objElement)
Variables
mixed $modx = null (line 25)
  • access: public

Inherited Variables

Inherited from xPDOCacheManager

xPDOCacheManager::$caches
xPDOCacheManager::$options
xPDOCacheManager::$xpdo
xPDOCacheManager::$_umask
Methods
Constructor __construct (line 27)
modCacheManager __construct ( &$xpdo, [ $options = array()])
  • &$xpdo
  • array $options

Redefinition of:
xPDOCacheManager::__construct()
clearCache (line 427)

Clear part or all of the MODx cache.

  • access: public
void clearCache ([ $paths = array()], [ $options = array()])
  • array $paths: An optional array of paths, relative to the cache path, to be deleted.
  • array $options: An optional associative array of cache clearing options:
    • <strong>objects</strong>: an array of objects or paths to flush from the db object cache
    • <strong>extensions</strong>: an array of file extensions to match when deleting the cache directories
generateActionMap (line 334)

Generates a cache file for the manager actions.

  • return: An array representing the action map.
  • access: public
array generateActionMap (string $cacheKey, [ $options = array()])
  • string $cacheKey: The key to use when caching the action map.
  • array $options
generateConfig (line 215)

Generates the system settings cache for a MODx site.

  • return: The generated system settings array.
  • access: public
array generateConfig ([ $options = array()])
  • array $options: Options for system settings generation.
generateContext (line 47)

Generates a cache entry for a MODx site Context.

Context cache entries can override site configuration settings and are responsible for loading the various lisitings and maps in the modX class, including documentListing, documentMap, and eventMap. It can also be used to setup or transform any other modX properties.

  • return: An array containing all the context variable values.
  • todo: Refactor the generation of documentMap, aliasMap, and resourceListing so it uses less memory/file size.
  • access: public
  • usedby: modContext::prepare() - This method is responsible for preparing the context for use.
array generateContext ( $key, [ $options = array()], modContext $obj)
  • modContext $obj: The modContext instance to be cached.
  • array $options: Options for system settings generation.
  • $key
generateLexiconTopic (line 315)

Generates a lexicon topic cache file from a collection of entries

  • return: An array representing the lexicon topic cache.
  • access: public
array generateLexiconTopic (string $cacheKey, [array $entries = array()], [array $options = array()])
  • string $cacheKey: The key to use when caching the lexicon topic.
  • array $entries: An array of key => value pairs of lexicon entries.
  • array $options: An optional array of caching options.
generateResource (line 259)

Generates a cache entry for a Resource or Resource-derived object.

Resource classes can define their own cacheKey.

  • return: The generated resource representation.
  • access: public
array generateResource (modResource &$obj, [ $options = array()], modResource $obj)
  • modResource $obj: The Resource instance to be cached.
  • array $options: Options for resource generation.
  • modResource &$obj
generateScript (line 388)

Generates a file representing an executable modScript function.

  • return: The actual generated source content representing the modScript or false if the source content could not be generated.
  • access: public
boolean|string generateScript (modScript &$objElement, [string $objContent = null], [ $options = array()], modScript $objElement)
  • modScript $objElement: A modScript instance to generate the script file for.
  • string $objContent: Optional script content to override the persistent instance.
  • array $options: An array of additional options for the operation.
  • modScript &$objElement

Inherited Methods

Inherited From xPDOCacheManager

 xPDOCacheManager::__construct()
 xPDOCacheManager::add()
 xPDOCacheManager::clean()
 xPDOCacheManager::copyFile()
 xPDOCacheManager::copyTree()
 xPDOCacheManager::delete()
 xPDOCacheManager::deleteTree()
 xPDOCacheManager::endsWith()
 xPDOCacheManager::escapeSingleQuotes()
 xPDOCacheManager::generateObject()
 xPDOCacheManager::get()
 xPDOCacheManager::getCachePath()
 xPDOCacheManager::getCacheProvider()
 xPDOCacheManager::getFilePermissions()
 xPDOCacheManager::getFolderPermissions()
 xPDOCacheManager::getOption()
 xPDOCacheManager::matches()
 xPDOCacheManager::replace()
 xPDOCacheManager::set()
 xPDOCacheManager::writeFile()
 xPDOCacheManager::writeTree()
Class Constants

Documentation generated on Fri, 17 Jun 2011 10:03:28 -0600 by phpDocumentor 1.4.3