System.I18N.core
[ class tree: System.I18N.core ] [ index: System.I18N.core ] [ all elements ]

Class: MessageCache

Source Location: /I18N/core/MessageCache.php

Class Overview


Cache the translation table into the file system.

Class Details

[line 21]
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 $


[ Top ]

Variables

Methods



Class Variables

$cache =

[line 28]

Cache Lite instance.



access:  protected

Type:   TCache_Lite


[ Top ]

$lifetime =  3153600

[line 33]

Caceh life time, default is 1 year.



access:  protected

Type:   mixed


[ Top ]



Class Methods


constructor __construct [line 40]

MessageCache __construct( string $cacheDir)

Create a new Translation cache.



access:  public


Parameters:

string   $cacheDir   Directory to store the cache files.

[ Top ]

method clean [line 155]

void clean( string $catalogue, string $culture)

Clean up the cache for the specified section and locale.



access:  public


Parameters:

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

[ Top ]

method clear [line 164]

void clear( )

Flush the cache. Deletes all the cache files.



access:  public


[ Top ]

method get [line 109]

mixed get( string $catalogue, string $culture, [mixed $lastmodified = 0], string $filename)

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


Parameters:

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.

[ Top ]

method getGroup [line 95]

void getGroup( string $catalogue, string $culture)

Get the cache file GROUP based section and locale.



access:  protected


Parameters:

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

[ Top ]

method getID [line 85]

void getID( string $catalogue, string $culture)

Get the cache file ID based section and locale.



access:  protected


Parameters:

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

[ Top ]

method getLifeTime [line 66]

int getLifeTime( )

Get the cache life time.



return:  Cache life time.
access:  public


[ Top ]

method save [line 139]

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

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



access:  public


Parameters:

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

[ Top ]

method setLifeTime [line 75]

void setLifeTime( int $time)

Set the cache life time.



access:  public


Parameters:

int   $time   Cache life time.

[ Top ]


© 2004-2005 PRADO Software Group. All Rights Reserved.