eZPublish  3.9
eZTemplateTreeCache Class Reference

Cache handling for template tree nodes. More...

Public Member Functions

 setCachedTree ($originalKey, $uri, $res, $templatePath, &$extraParameters, &$root)
 
 treeCacheFilename ($key, $templateFilepath)
 

Static Public Member Functions

 cacheDirectory ()
 
 cachedTree ($key, $uri, $res, $templatePath, &$extraParameters)
 
cacheTable ()
 
 canRestoreCache ($key, $timestamp, $templateFilepath)
 
 isCacheEnabled ()
 
 restoreCache ($key, $templateFilepath)
 
 storeCache ($key, $templateFilepath)
 

Static Private Member Functions

 internalKey ($key)
 

Detailed Description

Cache handling for template tree nodes.

Member Function Documentation

eZTemplateTreeCache::cacheDirectory ( )
static
Returns
the cache directory for tree node cache files.

Referenced by canRestoreCache(), restoreCache(), and storeCache().

eZTemplateTreeCache::cachedTree (   $key,
  $uri,
  $res,
  $templatePath,
$extraParameters 
)
static
Returns
the cache node tree which is stored with the cache key $key. Returns null if no cache data was found.

Referenced by eZTemplateFileResource\cachedTemplateTree(), and eZTemplateFileResource\hasCachedProcessTree().

& eZTemplateTreeCache::cacheTable ( )
static
Returns
the cache table which has cache keys and cache data.

Referenced by cachedTree(), canRestoreCache(), restoreCache(), setCachedTree(), and storeCache().

eZTemplateTreeCache::canRestoreCache (   $key,
  $timestamp,
  $templateFilepath 
)
static
Returns
true if the cache with the key $key can be restored. A cache file is found restorable when it exists and has a timestamp higher or equal to $timestamp.

Referenced by eZTemplateFileResource\cachedTemplateTree(), and eZTemplateFileResource\hasCachedProcessTree().

eZTemplateTreeCache::internalKey (   $key)
staticprivate
Returns
a new key from $key which has some additional info.

Referenced by cachedTree(), canRestoreCache(), restoreCache(), setCachedTree(), and storeCache().

eZTemplateTreeCache::isCacheEnabled ( )
static
Returns
true if template tree node caching is enabled.
Note
To change this setting edit settings/site.ini and locate the group TemplateSettings and the entry NodeTreeCaching.

Referenced by canRestoreCache(), restoreCache(), and storeCache().

eZTemplateTreeCache::restoreCache (   $key,
  $templateFilepath 
)
static

Loads the cache with the key $key from a file and sets the result in the cache table.

Returns
true if the cache was successfully restored.

Referenced by eZTemplateFileResource\cachedTemplateTree(), and eZTemplateFileResource\hasCachedProcessTree().

eZTemplateTreeCache::setCachedTree (   $originalKey,
  $uri,
  $res,
  $templatePath,
$extraParameters,
$root 
)

Sets the template tree node $root to be cached with the cache key $root.

Note
Trying to overwrite and existing cache key will give a warning and fail.

Referenced by eZTemplateFileResource\setCachedTemplateTree().

eZTemplateTreeCache::storeCache (   $key,
  $templateFilepath 
)
static

Stores the data of the cache with the key $key to a file.

Returns
false if the cache does not exist.

Referenced by eZTemplateFileResource\setCachedTemplateTree().

eZTemplateTreeCache::treeCacheFilename (   $key,
  $templateFilepath 
)

Creates the name for the tree cache file and returns it. The name conists of the md5 of the key and charset with the original filename appended.

Referenced by canRestoreCache(), restoreCache(), and storeCache().


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