Class CacheHandler__JS

Description

The CacheHandler class (ignore the file's __JS suffix).

This class can be used to handle data caching, using AJAX. It uses the Wigbi.PHP.System.CacheHandler class to achieve this.

IMPORTANT - In order to use the class, the caching folder must be specified with the application.cacheFolder parameter in the Wigbi config file. For caching to work, Wigbi must be allowed to create files within the cache folder.

Located in /wigbi_source/php/__js__system/CacheHandler.php (line 44)


	
			
Method Summary
 static void clear (string $name, function $onClear)
 static void get (string $name, function $onGet)
 static void set (string $name, mixed $data, [int $validityTime = 10], function $onSet)
Methods
static clear (line 55)

Clear any cached data.

  • access: public
static void clear (string $name, function $onClear)
  • string $name: The name of the cached data.
  • function $onClear: Callback function, if any; takes no parameters.
static get (line 66)

Retrieve an object to the cache.

  • access: public
static void get (string $name, function $onGet)
  • string $name: The name of the cached data.
  • function $onGet: Callback function, if any; takes the result as a parameter.
static set (line 79)

Save an object to the cache.

  • access: public
static void set (string $name, mixed $data, [int $validityTime = 10], function $onSet)
  • string $name: The name of the cached data.
  • mixed $data: The data that is to be cached.
  • int $validityTime: The time, in minutes, for how long the data is valid; default 10.
  • function $onSet: Callback function, if any; takes no parameters.

Documentation generated on Sun, 27 Dec 2009 20:12:00 +0100 by phpDocumentor 1.4.1