PHP Класс CampCache

Устаревший: from 4.3, removed in 4.4, use newscoop.cache service
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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.

Приватные методы

Метод Описание
__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.

Описание методов

GetFetchRequests() публичный статический Метод

public static GetFetchRequests ( )

GetHits() публичный статический Метод

public static GetHits ( )

GetMissKeys() публичный статический Метод

public static GetMissKeys ( )

GetStoreRequests() публичный статический Метод

fn genKey
public static GetStoreRequests ( )

IsEnabled() публичный статический Метод

Returns true if the given cache engine was enabled
public static IsEnabled ( $p_cacheEngine = null ) : boolean
$p_cacheEngine
Результат boolean TRUE on success, FALSE on failure

IsSupported() публичный статический Метод

Returns true if the given cache engine was supported
public static IsSupported ( $p_cacheEngine = null ) : boolean
$p_cacheEngine
Результат boolean TRUE on success, FALSE on failure

add() публичный Метод

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
Результат boolean TRUE on success, FALSE on failure

clear() публичный Метод

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.
Результат boolean TRUE on success, FALSE on failure

delete() публичный Метод

Remove the object with given cache key from cache.
public delete ( $p_key ) : boolean
$p_key The cache key for the object.
Результат boolean TRUE on success, FALSE on failure

fetch() публичный Метод

Fetch an object from cache.
public fetch ( $p_key ) : mixed
Результат mixed The unserialized data.

info() публичный Метод

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.
Результат mixed array Cached data and metadata boolean FALSE on failure

initialized() публичный статический Метод

fn __construct
public static initialized ( )

meminfo() публичный Метод

Retrieves shared memory allocation information.
public meminfo ( ) : mixed
Результат mixed array Shared memory allocation data boolean FALSE on failure

singleton() публичный статический Метод

Singleton function that returns the global class object.
public static singleton ( ) : CampCache
Результат CampCache

store() публичный Метод

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
Результат boolean TRUE on success, FALSE on failure