class CallbackController extends CacheController

Joomla! Cache callback type object

Properties

Cache $cache Cache object from CacheController
array $options Array of options from CacheController

Methods

__construct( array $options)

Constructor

mixed
__call( string $name, array $arguments)

Magic method to proxy CacheController method calls to Cache

static  CacheController
getInstance( string $type = 'output', array $options = array())

Returns a reference to a cache adapter object, always creating it

static  array
addIncludePath( array|string $path = '')

Add a directory where Cache should search for controllers. You may either pass a string or an array of directories.

mixed
get( mixed $callback, array $args = array(), string $id = false, boolean $wrkarounds = false, array $woptions = array())

Executes a cacheable callback if not found in cache else returns cached output and result

boolean
store( mixed $data, string $id, string $group = null, boolean $wrkarounds = true)

Store data to cache by ID and group

mixed
call()

Executes a cacheable callback if not found in cache else returns cached output and result

Details

__construct( array $options)

Constructor

Parameters

array $options Array of options

mixed __call( string $name, array $arguments)

Magic method to proxy CacheController method calls to Cache

Parameters

string $name Name of the function
array $arguments Array of arguments for the function

Return Value

mixed

static CacheController getInstance( string $type = 'output', array $options = array())

Returns a reference to a cache adapter object, always creating it

Parameters

string $type The cache object type to instantiate; default is output.
array $options Array of options

Return Value

CacheController

Exceptions

RuntimeException

static array addIncludePath( array|string $path = '')

Add a directory where Cache should search for controllers. You may either pass a string or an array of directories.

Parameters

array|string $path A path to search.

Return Value

array An array with directory elements

mixed get( mixed $callback, array $args = array(), string $id = false, boolean $wrkarounds = false, array $woptions = array())

Executes a cacheable callback if not found in cache else returns cached output and result

Parameters

mixed $callback Callback or string shorthand for a callback
array $args Callback arguments
string $id The cache data ID
boolean $wrkarounds True to use wrkarounds
array $woptions Workaround options

Return Value

mixed Boolean false on no result, cached object otherwise

boolean store( mixed $data, string $id, string $group = null, boolean $wrkarounds = true)

Store data to cache by ID and group

Parameters

mixed $data The data to store
string $id The cache data ID
string $group The cache data group
boolean $wrkarounds True to use wrkarounds

Return Value

boolean True if cache stored

mixed call()

Executes a cacheable callback if not found in cache else returns cached output and result

Since arguments to this function are read with funcgetargs you can pass any number of arguments to this method as long as the first argument passed is the callback definition.

The callback definition can be in several forms: - Standard PHP Callback array see https://secure.php.net/callback [recommended] - Function name as a string eg. 'foo' for function foo() - Static method name as a string eg. 'MyClass::myMethod' for method myMethod() of class MyClass

Return Value

mixed Result of the callback