previousconstructor Cache_Lite_Output::
Cache_Lite_Output
(Previous)
(Next) Cache_Lite_Output::endnext

View this page in Last updated: Sun, 05 Jul 2009
English | Brazilian Portuguese | Chinese | Dutch | French | German | Hungarian | Japanese | Polish | Russian | Spanish | Turkish

Cache_Lite_Output::start

Cache_Lite_Output::start() – Test if a cache is available and (if yes) return it to the browser. Else, the output buffering is activated.

Synopsis

require_once 'Cache/Lite/Output.php';

boolean Cache_Lite_Output::start ( string $id , string $group = 'default' , boolean $doNotTestCacheValidity = false )

Description

Test if a cache is available and (if yes) return it to the browser. Else, the output buffering is activated.

Parameter

string $id

cache id

string $group

name of the cache group

boolean $doNotTestCacheValidity

if set to TRUE, the cache validity won't be tested

Return value

returns true if the cache is hit (false else)

Note

This function can not be called statically.

Example

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'))) {

    
// Cache not hit !
    // All the output is bufferised until the end() method
    // (...)

    
$cache->end();

}

?>
previousconstructor Cache_Lite_Output::
Cache_Lite_Output
(Previous)
(Next) Cache_Lite_Output::endnext

Download Documentation Last updated: Sun, 05 Jul 2009
Do you think that something on this page is wrong? Please file a bug report or add a note.
User Notes:
There are no user contributed notes for this page.