PHP Class CampCache

Deprecation: from 4.3, removed in 4.4, use newscoop.cache service
Afficher le fichier Open project: sourcefabric/newscoop Class Usage Examples

Méthodes publiques

Méthode Description
GetFetchRequests ( )
GetHits ( )
GetMissKeys ( )
GetStoreRequests ( ) fn genKey
IsEnabled ( $p_cacheEngine = null ) : boolean Returns true if the given cache engine was enabled
IsSupported ( $p_cacheEngine = null ) : boolean Returns true if the given cache engine was supported
add ( $p_key, $p_data, $p_ttl ) : boolean Alias for the store() method.
clear ( $p_type = null ) : boolean Clears the cache.
delete ( $p_key ) : boolean Remove the object with given cache key from cache.
fetch ( $p_key ) : mixed Fetch an object from cache.
info ( $p_type = null ) : mixed Retrieves cache information and metadata from the cache store.
initialized ( ) fn __construct
meminfo ( ) : mixed Retrieves shared memory allocation information.
singleton ( ) : CampCache Singleton function that returns the global class object.
store ( $p_key, $p_data, $p_ttl ) : boolean Store the given data into cache.

Private Methods

Méthode Description
__construct ( $p_cacheEngine ) CampCache class constructor.
genKey ( $p_data ) : string Generates the hash key for a cache object.
serialize ( $p_data ) : string Serializes the given data.
unserialize ( $p_serial ) : mixed Unserializes the given serialized data.

Method Details

GetFetchRequests() public static méthode

public static GetFetchRequests ( )

GetHits() public static méthode

public static GetHits ( )

GetMissKeys() public static méthode

public static GetMissKeys ( )

GetStoreRequests() public static méthode

fn genKey
public static GetStoreRequests ( )

IsEnabled() public static méthode

Returns true if the given cache engine was enabled
public static IsEnabled ( $p_cacheEngine = null ) : boolean
$p_cacheEngine
Résultat boolean TRUE on success, FALSE on failure

IsSupported() public static méthode

Returns true if the given cache engine was supported
public static IsSupported ( $p_cacheEngine = null ) : boolean
$p_cacheEngine
Résultat boolean TRUE on success, FALSE on failure

add() public méthode

An apc_add() method will be available in future releases of APC providing a different behave than apc_store(). This is basically why we implement this alias function.
public add ( $p_key, $p_data, $p_ttl ) : boolean
$p_key The cache key for the object
$p_data The expected data to be cached
Résultat boolean TRUE on success, FALSE on failure

clear() public méthode

Clears the cache.
public clear ( $p_type = null ) : boolean
$p_type If given is 'user', the user cache will be cleard, otherwise the system cache (cached files) will be.
Résultat boolean TRUE on success, FALSE on failure

delete() public méthode

Remove the object with given cache key from cache.
public delete ( $p_key ) : boolean
$p_key The cache key for the object.
Résultat boolean TRUE on success, FALSE on failure

fetch() public méthode

Fetch an object from cache.
public fetch ( $p_key ) : mixed
Résultat mixed The unserialized data.

info() public méthode

Retrieves cache information and metadata from the cache store.
public info ( $p_type = null ) : mixed
$p_type If given is 'user', information about the user cache will be returned, otherwise system cache information.
Résultat mixed array Cached data and metadata boolean FALSE on failure

initialized() public static méthode

fn __construct
public static initialized ( )

meminfo() public méthode

Retrieves shared memory allocation information.
public meminfo ( ) : mixed
Résultat mixed array Shared memory allocation data boolean FALSE on failure

singleton() public static méthode

Singleton function that returns the global class object.
public static singleton ( ) : CampCache
Résultat CampCache

store() public méthode

Store the given data into cache.
public store ( $p_key, $p_data, $p_ttl ) : boolean
$p_key The cache key for the object
$p_data The expected data to be cached
Résultat boolean TRUE on success, FALSE on failure