SproutCMS

This is the code documentation for the SproutCMS project

Page options:

Inherited members

class Cache

Provides a driver-based interface for finding, creating, and deleting cached
resources. Caches are identified by a unique string. Tagging of caches is
also supported, and caches can be found and deleted by id or tag.

Variables

NameVisibilityDescription
$config 
$driver 
$instances (static) 
$loaded (static) 

Functions

NameVisibilityDescription
__constructpublicLoads the configured driver and validates it.
deletepublicDelete a cache item by id.
deleteAllpublicDelete ALL cache items items.
deleteTagpublicDelete all cache items with a given tag.
findpublicFetches all of the caches for a given tag. An empty array will be
getpublicFetches a cache by id. NULL is returned when a cache item is not found.
instancepublic (static)Returns a singleton instance of Cache.
sanitizeIdprotectedReplaces troublesome characters with underscores.
setpublicSet a cache item by id. Tags may also be added and a custom lifetime

public __construct

void $Cache->__construct ( [ array|string $config ] );

Loads the configured driver and validates it.

public delete

boolean $Cache->delete ( string $id );

Delete a cache item by id.

public deleteAll

boolean $Cache->deleteAll ( );

Delete ALL cache items items.

public deleteTag

boolean $Cache->deleteTag ( string $tag );

Delete all cache items with a given tag.

public find

array $Cache->find ( string $tag );

Fetches all of the caches for a given tag. An empty array will be
returned when no matching caches are found.

public get

mixed $Cache->get ( string $id );

Fetches a cache by id. NULL is returned when a cache item is not found.

public instance

Cache Cache::instance ( [ string &$config ] );

Returns a singleton instance of Cache.

protected sanitizeId

string $Cache->sanitizeId ( string $id );

Replaces troublesome characters with underscores.

public set

boolean $Cache->set ( string $id , mixed $data [, array|string $tags [, integer $lifetime ]] );

Set a cache item by id. Tags may also be added and a custom lifetime
can be set. Non-string data is automatically serialized.