Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

Static Public Member Functions | Public Attributes | Static Private Member Functions | List of all members
eZTemplateTreeCache Class Reference

Cache handling for template tree nodes. More...

## Static Public Member Functions
static & | cacheTable ()
static | cachedTree ( $key, $uri, $res, $templatePath, &$extraParameters)
static | setCachedTree ( $originalKey, $uri, $res, $templatePath, &$extraParameters, &$root)
static | isCacheEnabled ()
static | cacheDirectory ()
static | treeCacheFilename ( $key, $templateFilepath)
static | canRestoreCache ( $key, $timestamp, $templateFilepath)
static | restoreCache ( $key, $templateFilepath)
static | storeCache ( $key, $templateFilepath)

## Public Attributes
const | CODE_DATE = 1044440833

## Static Private Member Functions
static | internalKey ( $key)

## Detailed Description

Cache handling for template tree nodes.

Definition at line 17 of file eztemplatetreecache.php.

## Member Function Documentation

## ◆ cacheDirectory()

static eZTemplateTreeCache::cacheDirectory | ( |  | ) |
| static

Returns
  the cache directory for tree node cache files.

Definition at line 126 of file eztemplatetreecache.php.

References eZSys\cacheDirectory(), and eZDir\path().

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

## ◆ cachedTree()

static 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.

Definition at line 54 of file eztemplatetreecache.php.

References cacheTable(), internalKey(), and eZDebugSetting\writeDebug().

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

## ◆ cacheTable()

static& eZTemplateTreeCache::cacheTable | ( |  | ) |
| static

Returns
  the cache table which has cache keys and cache data.

Definition at line 25 of file eztemplatetreecache.php.

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

## ◆ canRestoreCache()

static 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.

Definition at line 159 of file eztemplatetreecache.php.

References cacheDirectory(), cacheTable(), internalKey(), isCacheEnabled(), and treeCacheFilename().

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

## ◆ internalKey()

static eZTemplateTreeCache::internalKey | ( |  | $key | ) |
| static private

Returns
  a new key from $key which has some additional info.

Definition at line 38 of file eztemplatetreecache.php.

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

## ◆ isCacheEnabled()

static 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.

Definition at line 105 of file eztemplatetreecache.php.

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

## ◆ restoreCache()

static 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.

Definition at line 181 of file eztemplatetreecache.php.

References cacheDirectory(), cacheTable(), CODE_DATE, internalKey(), isCacheEnabled(), treeCacheFilename(), and eZDebug\writeDebug().

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

## ◆ setCachedTree()

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

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.

Definition at line 74 of file eztemplatetreecache.php.

References cacheTable(), internalKey(), and eZDebug\writeDebug().

Referenced by eZTemplateFileResource\setCachedTemplateTree().

## ◆ storeCache()

static 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.

Definition at line 212 of file eztemplatetreecache.php.

References cacheDirectory(), cacheTable(), CODE_DATE, internalKey(), isCacheEnabled(), treeCacheFilename(), and eZDebug\writeDebug().

Referenced by eZTemplateFileResource\setCachedTemplateTree().

## ◆ treeCacheFilename()

static eZTemplateTreeCache::treeCacheFilename | ( |  | $key,
|  |  | $templateFilepath
| ) |  |
| static

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.

Definition at line 140 of file eztemplatetreecache.php.

References eZTextCodec\internalCharset().

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

## Member Data Documentation

## ◆ CODE_DATE

const eZTemplateTreeCache::CODE_DATE = 1044440833

Definition at line 19 of file eztemplatetreecache.php.

Referenced by restoreCache(), and storeCache().

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

- eztemplatetreecache.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.