PHP Class Prado\I18N\core\MessageCache

It can cache each cataloug+variant or just the whole section.
Author: $Author: weizhuo $
Afficher le fichier Open project: pradosoft/prado Class Usage Examples

Protected Properties

Свойство Type Description
$cache TCache_Lite Cache Lite instance.
$lifetime Caceh life time, default is 1 year.

Méthodes publiques

Méthode Description
__construct ( string $cacheDir ) Create a new Translation cache.
clean ( string $catalogue, string $culture ) Clean up the cache for the specified section and locale.
clear ( ) Flush the cache. Deletes all the cache files.
get ( string $catalogue, string $culture, $lastmodified ) : mixed Get the data from the cache.
getLifeTime ( ) : integer Get the cache life time.
save ( array $data, string $catalogue, string $culture ) Save the data to cache for the specified section and locale.
setLifeTime ( integer $time ) Set the cache life time.

Méthodes protégées

Méthode Description
getGroup ( string $catalogue, string $culture ) Get the cache file GROUP based section and locale.
getID ( string $catalogue, string $culture ) Get the cache file ID based section and locale.

Method Details

__construct() public méthode

Create a new Translation cache.
public __construct ( string $cacheDir )
$cacheDir string Directory to store the cache files.

clean() public méthode

Clean up the cache for the specified section and locale.
public clean ( string $catalogue, string $culture )
$catalogue string The translation section.
$culture string The translation locale, e.g. "en_AU".

clear() public méthode

Flush the cache. Deletes all the cache files.
public clear ( )

get() public méthode

Get the data from the cache.
public get ( string $catalogue, string $culture, $lastmodified ) : mixed
$catalogue string The translation section.
$culture string The translation locale, e.g. "en_AU".
Résultat mixed Boolean FALSE if no cache hit. Otherwise, translation table data for the specified section and locale.

getGroup() protected méthode

Get the cache file GROUP based section and locale.
protected getGroup ( string $catalogue, string $culture )
$catalogue string The translation section.
$culture string The translation locale, e.g. "en_AU".

getID() protected méthode

Get the cache file ID based section and locale.
protected getID ( string $catalogue, string $culture )
$catalogue string The translation section.
$culture string The translation locale, e.g. "en_AU".

getLifeTime() public méthode

Get the cache life time.
public getLifeTime ( ) : integer
Résultat integer Cache life time.

save() public méthode

Save the data to cache for the specified section and locale.
public save ( array $data, string $catalogue, string $culture )
$data array The data to save.
$catalogue string The translation section.
$culture string The translation locale, e.g. "en_AU".

setLifeTime() public méthode

Set the cache life time.
public setLifeTime ( integer $time )
$time integer Cache life time.

Property Details

$cache protected_oe property

Cache Lite instance.
protected TCache_Lite,Prado\I18N\core $cache
Résultat TCache_Lite

$lifetime protected_oe property

Caceh life time, default is 1 year.
protected $lifetime