Exponential 6.0.13 Exponential Enterprise Open Source CMS - PHP Class Reference

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

Cache handling for translations. More...

## Static Public Member Functions
static | cacheTable ()
static | contextCache ( $contextName)
static | setContextCache ( $contextName, $context)
static | cacheDirectory ()
static | rootCacheDirectory ()
static | canRestoreCache ( $key, $timestamp)
static | restoreCache ( $key)
static | storeCache ( $key)
static | resetGlobals ()

## Public Attributes
const | CODE_DATE = 1058863428

## Detailed Description

Cache handling for translations.

Definition at line 17 of file eztranslationcache.php.

## Member Function Documentation

## ◆ cacheDirectory()

static eZTranslationCache::cacheDirectory | ( |  | ) |
| static

Returns
  the cache directory for translation cache files.

Definition at line 76 of file eztranslationcache.php.

References eZDir\path(), and rootCacheDirectory().

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

## ◆ cacheTable()

static eZTranslationCache::cacheTable | ( |  | ) |
| static

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

Definition at line 25 of file eztranslationcache.php.

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

## ◆ canRestoreCache()

static eZTranslationCache::canRestoreCache | ( |  | $key,
|  |  | $timestamp
| ) |  |
| 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 124 of file eztranslationcache.php.

References cacheDirectory(), and cacheTable().

Referenced by eZTSTranslator\loadTranslationFile().

## ◆ contextCache()

static eZTranslationCache::contextCache | ( |  | $contextName | ) |
| static

Returns
  the cache translation context which is stored with the cache key $contextName. Returns `null` if no cache data was found.

Definition at line 39 of file eztranslationcache.php.

References cacheTable().

Referenced by eZTSTranslator\loadTranslationFile().

## ◆ resetGlobals()

static eZTranslationCache::resetGlobals | ( |  | ) |
| static

Reset values strored in $GLOABLS variable

Definition at line 206 of file eztranslationcache.php.

Referenced by eZTranslatorManager\resetTranslations().

## ◆ restoreCache()

static eZTranslationCache::restoreCache | ( |  | $key | ) |
| 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 145 of file eztranslationcache.php.

References cacheDirectory(), cacheTable(), setContextCache(), and eZDebug\writeWarning().

Referenced by eZTSTranslator\loadTranslationFile().

## ◆ rootCacheDirectory()

static eZTranslationCache::rootCacheDirectory | ( |  | ) |
| static

Definition at line 94 of file eztranslationcache.php.

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

Referenced by cacheDirectory().

## ◆ setContextCache()

static eZTranslationCache::setContextCache | ( |  | $contextName,
|  |  | $context
| ) |  |
| static

Sets the translation context $context to be cached with the cache key $contextName.

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

Definition at line 54 of file eztranslationcache.php.

References eZDebug\writeWarning().

Referenced by eZTSTranslator\loadTranslationFile(), and restoreCache().

## ◆ storeCache()

static eZTranslationCache::storeCache | ( |  | $key | ) |
| 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 173 of file eztranslationcache.php.

References cacheDirectory(), cacheTable(), eZTextCodec\internalCharset(), eZDir\mkdir(), and eZDebug\writeWarning().

Referenced by eZTSTranslator\loadTranslationFile().

## Member Data Documentation

## ◆ CODE_DATE

const eZTranslationCache::CODE_DATE = 1058863428

Definition at line 19 of file eztranslationcache.php.

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

- eztranslationcache.php

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