## Class MessageCache

Description

Cache the translation table into the file system.

It can cache each cataloug+variant or just the whole section.

- version: $Id: MessageCache.php,v 1.3 2005/01/05 03:15:14 weizhuo Exp $
- author: $Author: weizhuo $

Located in /I18N/core/MessageCache.php (line 21)

Variable Summary
TCache_Lite $cache
mixed $lifetime
Method Summary
MessageCache __construct (string $cacheDir)
void clean (string $catalogue, string $culture)
void clear ()
mixed get (string $catalogue, string $culture, mixed $lastmodified, string $filename)
void getGroup (string $catalogue, string $culture)
void getID (string $catalogue, string $culture)
int getLifeTime ()
void save (array $data, string $catalogue, string $culture)
void setLifeTime (int $time)
Variables
TCache_Lite $cache (line 28)

Cache Lite instance.

- access: protected

mixed $lifetime = 3153600 (line 33)

Caceh life time, default is 1 year.

- access: protected

Methods
Constructor __construct (line 40)

Create a new Translation cache.

- access: public

MessageCache __construct (string $cacheDir)

- string $cacheDir: Directory to store the cache files.

clean (line 155)

Clean up the cache for the specified section and locale.

- access: public

void clean (string $catalogue, string $culture)

- string $catalogue: The translation section.
- string $culture: The translation locale, e.g. "en_AU".

clear (line 164)

Flush the cache. Deletes all the cache files.

- access: public

void clear ()
get (line 109)

Get the data from the cache.

- return: Boolean FALSE if no cache hit. Otherwise, translation table data for the specified section and locale.
- access: public

mixed get (string $catalogue, string $culture, mixed $lastmodified, string $filename)

- string $catalogue: The translation section.
- string $culture: The translation locale, e.g. "en_AU".
- string $filename: If the source is a file, this file's modified time is newer than the cache's modified time, no cache hit.

getGroup (line 95)

Get the cache file GROUP based section and locale.

- access: protected

void getGroup (string $catalogue, string $culture)

- string $catalogue: The translation section.
- string $culture: The translation locale, e.g. "en_AU".

getID (line 85)

Get the cache file ID based section and locale.

- access: protected

void getID (string $catalogue, string $culture)

- string $catalogue: The translation section.
- string $culture: The translation locale, e.g. "en_AU".

getLifeTime (line 66)

Get the cache life time.

- return: Cache life time.
- access: public

int getLifeTime ()
save (line 139)

Save the data to cache for the specified section and locale.

- access: public

void save (array $data, string $catalogue, string $culture)

- array $data: The data to save.
- string $catalogue: The translation section.
- string $culture: The translation locale, e.g. "en_AU".

setLifeTime (line 75)

Set the cache life time.

- access: public

void setLifeTime (int $time)

- int $time: Cache life time.

Documentation generated on Mon, 01 May 2006 23:02:37 -0400 by phpDocumentor 1.3.0RC4