PHP Class CacheTool\Proxy\ApcuProxy

Inheritance: implements CacheTool\Proxy\ProxyInterface
Datei anzeigen Open project: gordalina/cachetool

Protected Properties

Property Type Description
$adapter CacheTool\Adapter\AbstractAdapter

Public Methods

Method Description
apcu_add ( mixed $key, mixed $var = null, integer $ttl ) : mixed Caches a variable in the data store, only if it's not already stored
apcu_cache_info ( boolean $limited = false ) : boolean Retrieves cached information from APCu's data store
apcu_cas ( string $key, integer $old, integer $new ) : boolean Updates an old value with a new value apcu_cas() updates an already existing integer value if the old parameter matches the currently stored value with the value of the new parameter.
apcu_clear_cache ( ) : boolean Clears the user/system cache
apcu_dec ( string $key, integer $step = 1, stdClass $ref = false ) : mixed Decrease a stored number
apcu_delete ( mixed $key ) : mixed Removes a stored variable from the cache
apcu_exists ( mixed $keys ) : mixed Checks if one or more APCu keys exist.
apcu_fetch ( mixed $key, stdClass $ref = false ) : mixed Fetch a stored variable from the cache
apcu_inc ( string $key, integer $step = 1, stdClass $ref = false ) : mixed Increase a stored number
apcu_sma_info ( boolean $limited = false ) : boolean Retrieves APCu's Shared Memory Allocation information
apcu_store ( mixed $key, mixed $var = null, integer $ttl ) : boolean Cache a variable in the data store
apcu_version ( ) : string
getFunctions ( )
setAdapter ( AbstractAdapter $adapter )

Method Details

apcu_add() public method

Note: Unlike many other mechanisms in PHP, variables stored using apcu_add() will persist between requests (until the value is removed from the cache).
Since: 3.0.13
public apcu_add ( mixed $key, mixed $var = null, integer $ttl ) : mixed
$key mixed Store the variable using this name. keys are cache-unique, so attempting to use apc_add() to store data with a key that already exists will not overwrite the existing data, and will instead return FALSE. (This is the only difference between apcu_add() and apc_store().) If $key is an array set Names in key, variables in value
$var mixed The variable to store If $key is an array, this parameter is unused and set to NULL
$ttl integer Time To Live; store var in the cache for ttl seconds. After the ttl has passed, the stored variable will be expunged from the cache (on the next request). If no ttl is supplied (or if the ttl is 0), the value will persist until it is removed from the cache manually, or otherwise fails to exist in the cache (clear, restart, etc.).
return mixed

apcu_cache_info() public method

Retrieves cached information from APCu's data store
Since: 2.0.0
public apcu_cache_info ( boolean $limited = false ) : boolean
$limited boolean If limited is TRUE, the return value will exclude the individual list of cache entries. This is useful when trying to optimize calls for statistics gathering.
return boolean Array of cached data (and meta-data) or FALSE on failure

apcu_cas() public method

Updates an old value with a new value apcu_cas() updates an already existing integer value if the old parameter matches the currently stored value with the value of the new parameter.
Since: 3.1.1
public apcu_cas ( string $key, integer $old, integer $new ) : boolean
$key string The key of the value being updated.
$old integer The old value (the value currently stored).
$new integer The new value to update to
return boolean Returns TRUE on success or FALSE on failure.

apcu_clear_cache() public method

Clears the user/system cache
Since: 2.0.0
public apcu_clear_cache ( ) : boolean
return boolean Always returns true

apcu_dec() public method

Decrease a stored number
Since: 3.1.1
public apcu_dec ( string $key, integer $step = 1, stdClass $ref = false ) : mixed
$key string The key of the value being decreased.
$step integer The step, or value to decrease.
$ref stdClass success is set to TRUE in success and FALSE in failure
return mixed Returns the current value of key's value on success, or FALSE on failure

apcu_delete() public method

Removes a stored variable from the cache
Since: 3.1.1
public apcu_delete ( mixed $key ) : mixed
$key mixed The key used to store the value (with apcu_store()).
return mixed Returns TRUE on success or FALSE on failure.

apcu_exists() public method

Checks if one or more APCu keys exist.
Since: 3.1.4
public apcu_exists ( mixed $keys ) : mixed
$keys mixed A string, or an array of strings, that contain keys.
return mixed Returns TRUE if the key exists, otherwise FALSE Or if an array was passed to keys, then an array is returned that contains all existing keys, or an empty array if none exist.

apcu_fetch() public method

Fetch a stored variable from the cache
Since: 3.0.0
public apcu_fetch ( mixed $key, stdClass $ref = false ) : mixed
$key mixed The key used to store the value (with apcu_store()). If an array is passed then each element is fetched and returned.
$ref stdClass success is set to TRUE in success and FALSE in failure
return mixed The stored variable or array of variables on success; FALSE on failure

apcu_inc() public method

Increase a stored number
Since: 3.1.1
public apcu_inc ( string $key, integer $step = 1, stdClass $ref = false ) : mixed
$key string The key of the value being increased.
$step integer The step, or value to increased.
$ref stdClass success is set to TRUE in success and FALSE in failure
return mixed Returns the current value of key's value on success, or FALSE on failure

apcu_sma_info() public method

Retrieves APCu's Shared Memory Allocation information
Since: 2.0.0
public apcu_sma_info ( boolean $limited = false ) : boolean
$limited boolean When set to FALSE (default) apcu_sma_info() will return a detailed information about each segment.
return boolean Array of Shared Memory Allocation data; FALSE on failure

apcu_store() public method

Note: Unlike many other mechanisms in PHP, variables stored using apcu_store() will persist between requests (until the value is removed from the cache).
Since: 3.0.0
public apcu_store ( mixed $key, mixed $var = null, integer $ttl ) : boolean
$key mixed Store the variable using this name. keys are cache-unique, so storing a second value with the same key will overwrite the original value. If $key is an array set Names in key, variables in value
$var mixed The variable to store If $key is an array, this parameter is unused and set to NULL
$ttl integer Time To Live; store var in the cache for ttl seconds. After the ttl has passed, the stored variable will be expunged from the cache (on the next request). If no ttl is supplied (or if the ttl is 0), the value will persist until it is removed from the cache manually, or otherwise fails to exist in the cache (clear, restart, etc.).
return boolean Returns TRUE on success or FALSE on failure. Second syntax returns array with error keys.

apcu_version() public method

public apcu_version ( ) : string
return string

getFunctions() public method

public getFunctions ( )

setAdapter() public method

public setAdapter ( AbstractAdapter $adapter )
$adapter CacheTool\Adapter\AbstractAdapter

Property Details

$adapter protected_oe property

protected AbstractAdapter,CacheTool\Adapter $adapter
return CacheTool\Adapter\AbstractAdapter