boolean Cache_Lite_Output::start (
string
$id
,
string
$group = 'default'
,
boolean
$doNotTestCacheValidity
= = false
)
Teste si un cache est disponible et (si oui) le retourne au navigateur. Sinon, la beufferisation de la sortie est activée.
identifiant du cache
nom du groupe de cache
Si défini à TRUE, la validité du cache ne sera pas testée
Retourne TRUE si le cache est disponible (FALSE sinon)
This function can not be called statically.
Utilisation
<?php
require_once "Cache/Lite/Output.php";
$options = array(
'cacheDir' => '/tmp/',
'lifeTime' => 7200,
'pearErrorMode' => CACHE_LITE_ERROR_DIE
);
$cache = new Cache_Lite_Output($options);
if (!($cache->start('id_of_the_page'))) {
// Cache non présent !
// Toute la sortie est beufferisée en attendant la méthode end()
// (...)
$cache->end();
}
?>