Create a new Translation cache.
MessageCache
__construct
(string $cacheDir)
-
string
$cacheDir: Directory to store the cache files.
Clean up the cache for the specified section and locale.
void
clean
(string $catalogue, string $culture)
-
string
$catalogue: The translation section.
-
string
$culture: The translation locale, e.g. "en_AU".
Flush the cache. Deletes all the cache files.
void
clear
()
Get the data from the cache.
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.
Get the cache file GROUP based section and locale.
void
getGroup
(string $catalogue, string $culture)
-
string
$catalogue: The translation section.
-
string
$culture: The translation locale, e.g. "en_AU".
Get the cache file ID based section and locale.
void
getID
(string $catalogue, string $culture)
-
string
$catalogue: The translation section.
-
string
$culture: The translation locale, e.g. "en_AU".
Get the cache life time.
int
getLifeTime
()
Save the data to cache for the specified section and locale.
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".
Set the cache life time.
void
setLifeTime
(int $time)
-
int
$time: Cache life time.