PHP Class CampCache

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

Public Methods

Method 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

Method 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 method

public static GetFetchRequests ( )

GetHits() public static method

public static GetHits ( )

GetMissKeys() public static method

public static GetMissKeys ( )

GetStoreRequests() public static method

fn genKey
public static GetStoreRequests ( )

IsEnabled() public static method

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

IsSupported() public static method

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

add() public method

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
return boolean TRUE on success, FALSE on failure

clear() public method

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.
return boolean TRUE on success, FALSE on failure

delete() public method

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

fetch() public method

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

info() public method

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.
return mixed array Cached data and metadata boolean FALSE on failure

initialized() public static method

fn __construct
public static initialized ( )

meminfo() public method

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

singleton() public static method

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

store() public method

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
return boolean TRUE on success, FALSE on failure