PHP Class CacheTool\Proxy\ApcProxy

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

Protected Properties

Property Type Description
$adapter CacheTool\Adapter\AbstractAdapter

Public Methods

Method Description
apc_add ( mixed $key, mixed $var = null, integer $ttl ) : mixed Caches a variable in the data store, only if it's not already stored
apc_bin_dump ( array $files = null, mixed $user_vars = null ) : mixed Get a binary dump of the given files and user variables
apc_bin_dumpfile ( array $files, array $user_vars, string $filename, integer $flags, resource $context = null ) : integer Outputs a binary dump of the given files and user variables from the APC cache to the named file.
apc_bin_load ( string $data, integer $flags ) : boolean Loads the given binary dump into the APC file/user cache
apc_bin_loadfile ( string $filename, resource $context = null, integer $flags ) : boolean Load a binary dump from a file into the APC file/user cache
apc_cache_info ( string $cache_type = "", boolean $limited = false ) : boolean Retrieves cached information from APC's data store
apc_cas ( string $key, integer $old, integer $new ) : boolean Updates an old value with a new value apc_cas() updates an already existing integer value if the old parameter matches the currently stored value with the value of the new parameter.
apc_clear_cache ( string $cache_type = "" ) : boolean Clears the user/system cache
apc_compile_file ( string $filename, boolean $atomic = true ) : boolean Stores a file in the bytecode cache, bypassing all filters.
apc_dec ( string $key, integer $step = 1, stdClass $ref = false ) : mixed Decrease a stored number
apc_define_constants ( string $key, array $constants, boolean $case_sensitive = true ) : boolean Defines a set of constants for retrieval and mass-definition
apc_delete ( mixed $key ) : mixed Removes a stored variable from the cache
apc_delete_file ( mixed $keys ) : mixed Deletes files from the opcode cache
apc_exists ( mixed $keys ) : mixed Checks if one or more APC keys exist.
apc_fetch ( mixed $key, stdClass $ref = false ) : mixed Fetch a stored variable from the cache
apc_inc ( string $key, integer $step = 1, stdClass $ref = false ) : mixed Increase a stored number
apc_load_constants ( mixed $key, boolean $case_sensitive = true ) : boolean Loads a set of constants from the cache
apc_sma_info ( boolean $limited = false ) : boolean Retrieves APC's Shared Memory Allocation information
apc_store ( mixed $key, mixed $var = null, integer $ttl ) : boolean Cache a variable in the data store
apc_version ( ) : string
getFunctions ( )
setAdapter ( AbstractAdapter $adapter )

Method Details

apc_add() public method

Note: Unlike many other mechanisms in PHP, variables stored using apc_add() will persist between requests (until the value is removed from the cache).
Since: 3.0.13
public apc_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 apc_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

apc_bin_dump() public method

Returns a binary dump of the given files and user variables from the APC cache. A NULL for files or user_vars signals a dump of every entry, whereas array() will dump nothing
Since: 3.1.4
public apc_bin_dump ( array $files = null, mixed $user_vars = null ) : mixed
$files array The files. Passing in NULL signals a dump of every entry, while passing in array() will dump nothing.
$user_vars mixed The user vars. Passing in NULL signals a dump of every entry, while passing in array() will dump nothing.
return mixed Returns a binary dump of the given files and user variables from the APC cache, FALSE if APC is not enabled, or NULL if an unknown error is encountered.

apc_bin_dumpfile() public method

Outputs a binary dump of the given files and user variables from the APC cache to the named file.
Since: 3.1.4
public apc_bin_dumpfile ( array $files, array $user_vars, string $filename, integer $flags, resource $context = null ) : integer
$files array The file names being dumped
$user_vars array The user variables being dumped
$filename string The filename where the dump is being saved
$flags integer Flags passed to the filename stream. See the file_put_contents() documentation for details.
$context resource The context passed to the filename stream. See the file_put_contents() documentation for details.
return integer The number of bytes written to the file, otherwise FALSE if APC is not enabled, filename is an invalid file name, filename can't be opened, the file dump can't be completed (e.g., the hard drive is out of disk space), or an unknown error was encountered.

apc_bin_load() public method

Loads the given binary dump into the APC file/user cache
Since: 3.1.4
public apc_bin_load ( string $data, integer $flags ) : boolean
$data string The binary dump being loaded, likely from apc_bin_dump().
$flags integer Either APC_BIN_VERIFY_CRC32, APC_BIN_VERIFY_MD5, or both.
return boolean Returns TRUE if the binary dump data was loaded with success, otherwise FALSE is returned. FALSE is returned if APC is not enabled, or if the data is not a valid APC binary dump (e.g., unexpected size)

apc_bin_loadfile() public method

Load a binary dump from a file into the APC file/user cache
Since: 3.1.4
public apc_bin_loadfile ( string $filename, resource $context = null, integer $flags ) : boolean
$filename string The file name containing the dump, likely from apc_bin_dumpfile().
$context resource The files context.
$flags integer Either APC_BIN_VERIFY_CRC32, APC_BIN_VERIFY_MD5, or both.
return boolean Returns TRUE on success, otherwise FALSE Reasons it may return FALSE include APC is not enabled, filename is an invalid file name or empty, filename can't be opened, the file dump can't be completed, or if the data is not a valid APC binary dump (e.g., unexpected size).

apc_cache_info() public method

Retrieves cached information from APC's data store
Since: 2.0.0
public apc_cache_info ( string $cache_type = "", boolean $limited = false ) : boolean
$cache_type string If cache_type is "user", information about the user cache will be returned. If cache_type is "filehits", information about which files have been served from the bytecode cache for the current request will be returned. This feature must be enabled at compile time using --enable-filehits . If an invalid or no cache_type is specified, information about the system cache (cached files) will be returned.
$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

apc_cas() public method

Updates an old value with a new value apc_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 apc_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.

apc_clear_cache() public method

Clears the user/system cache
Since: 2.0.0
public apc_clear_cache ( string $cache_type = "" ) : boolean
$cache_type string If cache_type is "user", the user cache will be cleared; otherwise, the system cache (cached files) will be cleared.
return boolean Always returns true

apc_compile_file() public method

Stores a file in the bytecode cache, bypassing all filters.
Since: 3.0.13
public apc_compile_file ( string $filename, boolean $atomic = true ) : boolean
$filename string Full or relative path to a PHP file that will be compiled and stored in the bytecode cache.
$atomic boolean defaults to true
return boolean Returns TRUE on success or FALSE on failure

apc_dec() public method

Decrease a stored number
Since: 3.1.1
public apc_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

apc_define_constants() public method

define() is notoriously slow. Since the main benefit of APC is to increase the performance of scripts/applications, this mechanism is provided to streamline the process of mass constant definition. However, this function does not perform as well as anticipated.
Since: 3.0.0
public apc_define_constants ( string $key, array $constants, boolean $case_sensitive = true ) : boolean
$key string The key serves as the name of the constant set being stored. This key is used to retrieve the stored constants in apc_load_constants().
$constants array An associative array of constant_name => value pairs. The constant_name must follow the normal constant naming rules. value must evaluate to a scalar value.
$case_sensitive boolean The default behaviour for constants is to be declared case-sensitive; i.e. CONSTANT and Constant represent different values. If this parameter evaluates to FALSE the constants will be declared as case-insensitive symbols.
return boolean Returns TRUE on success or FALSE on failure.

apc_delete() public method

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

apc_delete_file() public method

Deletes files from the opcode cache
Since: 3.1.1
public apc_delete_file ( mixed $keys ) : mixed
$keys mixed The files to be deleted. Accepts a string, array of strings, or an APCIterator object.
return mixed Returns TRUE on success or FALSE on failure. Or if keys is an array, then an empty array is returned on success, or an array of failed files is returned.

apc_exists() public method

Checks if one or more APC keys exist.
Since: 3.1.4
public apc_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.

apc_fetch() public method

Fetch a stored variable from the cache
Since: 3.0.0
public apc_fetch ( mixed $key, stdClass $ref = false ) : mixed
$key mixed The key used to store the value (with apc_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

apc_inc() public method

Increase a stored number
Since: 3.1.1
public apc_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

apc_load_constants() public method

Loads a set of constants from the cache
Since: 3.0.0
public apc_load_constants ( mixed $key, boolean $case_sensitive = true ) : boolean
$key mixed The name of the constant set (that was stored with apc_define_constants()) to be retrieved.
$case_sensitive boolean The default behaviour for constants is to be declared case-sensitive; i.e. CONSTANT and Constant represent different values. If this parameter evaluates to FALSE the constants will be declared as case-insensitive symbols.
return boolean Returns TRUE on success or FALSE on failure

apc_sma_info() public method

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

apc_store() public method

Note: Unlike many other mechanisms in PHP, variables stored using apc_store() will persist between requests (until the value is removed from the cache).
Since: 3.0.0
public apc_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.

apc_version() public method

public apc_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