Support Joomla!

Joomla! 1.5 Documentation

Packages

Package: Cache_Lite

Developer Network License

The Joomla! Developer Network content is © copyright 2006 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution- NonCommercial- ShareAlike 2.5

 Class Cache_Lite_Function

Description

This class extends Cache_Lite and can be used to cache the result and output of functions/methods

This class is completly inspired from Sebastian Bergmann's PEAR/Cache_Function class. This is only an adaptation to Cache_Lite

There are some examples in the 'docs/examples' file Technical choices are described in the 'docs/technical' file

Located in /pear/cache/lite/Function.php (line 25)

Class Cache_Lite

Class Cache_Lite_Function
Method Summary
Constructor Cache_Lite_Function Cache_Lite_Function ([array $options = array(NULL)])
Method mixed call ()
Method boolean drop ()
Variables
boolean $_debugCacheLiteFunction = false (line 66)

Debug the Cache_Lite_Function caching process

string $_defaultGroup = 'Cache_Lite_Function' (line 35)

Default cache group for function caching

boolean $_dontCacheWhenTheOutputContainsNOCACHE = false (line 45)

Don't cache the method call when its output contains the string "NOCACHE"

if set to true, the output of the method will never be displayed (because the output is used to control the cache)

boolean $_dontCacheWhenTheResultIsFalse = false (line 52)

Don't cache the method call when its result is false

boolean $_dontCacheWhenTheResultIsNull = false (line 59)

Don't cache the method call when its result is null

Inherited Variables

Inherited from Cache_Lite

Variable Cache_Lite::$_automaticCleaningFactor
Variable Cache_Lite::$_automaticSerialization
Variable Cache_Lite::$_cacheDir
Variable Cache_Lite::$_caching
Variable Cache_Lite::$_errorHandlingAPIBreak
Variable Cache_Lite::$_file
Variable Cache_Lite::$_fileLocking
Variable Cache_Lite::$_fileName
Variable Cache_Lite::$_fileNameProtection
Variable Cache_Lite::$_group
Variable Cache_Lite::$_hashedDirectoryLevel
Variable Cache_Lite::$_hashedDirectoryUmask
Variable Cache_Lite::$_id
Variable Cache_Lite::$_lifeTime
Variable Cache_Lite::$_memoryCaching
Variable Cache_Lite::$_memoryCachingArray
Variable Cache_Lite::$_memoryCachingCounter
Variable Cache_Lite::$_memoryCachingLimit
Variable Cache_Lite::$_onlyMemoryCaching
Variable Cache_Lite::$_pearErrorMode
Variable Cache_Lite::$_readControl
Variable Cache_Lite::$_readControlType
Variable Cache_Lite::$_refreshTime
Variable Cache_Lite::$_writeControl
Methods
Constructor Cache_Lite_Function (line 89)

Constructor

$options is an assoc. To have a look at availables options, see the constructor of the Cache_Lite class in 'Cache_Lite.php'

Comparing to Cache_Lite constructor, there is another option : $options = array( (...) see Cache_Lite constructor 'debugCacheLiteFunction' => (bool) debug the caching process, 'defaultGroup' => default cache group for function caching (string), 'dontCacheWhenTheOutputContainsNOCACHE' => (bool) don't cache when the function output contains "NOCACHE", 'dontCacheWhenTheResultIsFalse' => (bool) don't cache when the function result is false, 'dontCacheWhenTheResultIsNull' => (bool don't cache when the function result is null );

  • access: public
Cache_Lite_Function Cache_Lite_Function ([array $options = array(NULL)])
  • array $options: options
call (line 113)

Calls a cacheable function or method (or not if there is already a cache for it)

Arguments of this method are read with func_get_args. So it doesn't appear in the function definition. Synopsis : call('functionName', $arg1, $arg2, ...) (arg1, arg2... are arguments of 'functionName')

  • return: result of the function/method
  • access: public
mixed call ()
drop (line 189)

Drop a cache file

Arguments of this method are read with func_get_args. So it doesn't appear in the function definition. Synopsis : remove('functionName', $arg1, $arg2, ...) (arg1, arg2... are arguments of 'functionName')

  • return: true if no problem
  • access: public
boolean drop ()

Inherited Methods

Inherited From Cache_Lite

 Cache_Lite::Cache_Lite()
 Cache_Lite::clean()
 Cache_Lite::extendLife()
 Cache_Lite::get()
 Cache_Lite::getMemoryCachingState()
 Cache_Lite::lastModified()
 Cache_Lite::raiseError()
 Cache_Lite::remove()
 Cache_Lite::save()
 Cache_Lite::saveMemoryCachingState()
 Cache_Lite::setLifeTime()
 Cache_Lite::setOption()
 Cache_Lite::setToDebug()

Documentation generated on Mon, 05 Mar 2007 21:02:11 +0000 by phpDocumentor 1.3.1