Table of Contents

getInstance

API Package Subpackage Class Method Reference Last reviewed Doc status
API Home Package Joomla.Framework Subpackage Cache Class JCache Method getInstance Reference getInstance() Never Work in Progress

Returns a reference to the global cache object, only creating it if it doesn’t already exist.

Syntax

JCache &getInstance ( $handler, $options )

$handler string is a string containing the cache handler to instantiate. The currently available handlers are: Function, Hash, Output and Page. This parameter is optional and if omitted defaults to ‘Function’.
$options array is an associative array of cache options. See __construct for more information.

Examples

This function is called by the JFactory::getCache method using the following code:

Example

$cache =& JCache::getInstance( $handler, $options );