Cache_Lite_File::get() -- Test if a cache is available and (if yes) return it
Описание
test the validity of a cache file and return it if it's available (FALSE else)
Параметр
- string
$group
name of the cache group
Возвращаемое значение
returns data of the cache (or false if no cache available)
Заметка
Эта функция не должна вызываться статически.
Пример
Пример 32-1. Usage
<?php
require_once "Cache/Lite/File.php";
$options = array(
'cacheDir' => '/tmp/',
'masterFile' => '/home/web/config.xml',
'pearErrorMode' => CACHE_LITE_ERROR_DIE
);
$cache = new Cache_Lite_File($options);
if ($data = $cache->get('id_of_the_page')) {
// Cache hit !
// Content is in $data
// (...)
} else {
// No valid cache found (you have to make and save the page)
// (...)
}
?> |
|