———

 
Translations of this page:

nsVarCache

Members

fields

    protected $fields = array();

Methods

Constructor

  • $cbLoad - callback to load value that is not in cache. Must be valid callback which takes one argument and returns the value of variable or false if not successful.
    public function __construct($cbLoad);

loadValue

  • abstract
  • $field - name of the variable queried
  • return value: should return the value of variable $field from cache storage.
    abstract public function loadValue($field);

storeValue

  • abstract
  • $field - name of the variable queried
  • $value - value to be stored
  • return value: true on success or false on failure
    abstract public function storeValue($field, $value);

preload

  • abstract
  • $fields - array of variables to preload
  • return value: true on success or false on failure.
  abstract public function preload($fields);
Preloads an array of variables. This is good to be used when cache storage is database to minimize number of queries. This function does not guarantee that all variables are loaded from cache.

gc

  • abstract
  • return value: N/A.
  abstract public function gc();
Garbage collector. When this function is called all expired variables should be deleted.

getField

  • $field - name of the variable queried
  • return value: returns the value of variable $field or false if fails.
    abstract public function getField($field);

setField

  • $field - name of the variable
  • return value: sets the value of variable $field or false if fails.
    abstract public function setField($field);
 
nscl/c-nsvarcache.txt · Last modified: 11.10.2008 18:23 by npelov
 
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki