boolean Cache_Lite_Output::start (
string $id
, string $group = 'default'
, boolean $doNotTestCacheValidity
= = false
)
キャッシュが有効かどうかをテストし、(有効であれば) ブラウザにそれを返します。あるいは出力バッファリングが有効になります。
$id
キャッシュIDを指定します
$group
キャッシュグループ名を指定します
$doNotTestCacheValidity
TRUE の場合、キャッシュの妥当性はチェックされません
returns キャッシュがヒットすれば true (そうでなければ false)
This function can not be called statically.
classical using
<?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'))) {
// キャッシュがヒットしなかった !
// 全ての出力は end() メソッドまでバッファされる
// (...)
$cache->end();
}
?>