PHP Класс CacheTool\Proxy\ApcProxy

Наследование: implements CacheTool\Proxy\ProxyInterface
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$adapter CacheTool\Adapter\AbstractAdapter

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

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

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

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

Note: Unlike many other mechanisms in PHP, variables stored using apc_add() will persist between requests (until the value is removed from the cache).
С версии: 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.).
Результат mixed

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

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
С версии: 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.
Результат 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() публичный Метод

Outputs a binary dump of the given files and user variables from the APC cache to the named file.
С версии: 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.
Результат 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() публичный Метод

Loads the given binary dump into the APC file/user cache
С версии: 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.
Результат 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() публичный Метод

Load a binary dump from a file into the APC file/user cache
С версии: 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.
Результат 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() публичный Метод

Retrieves cached information from APC's data store
С версии: 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.
Результат boolean Array of cached data (and meta-data) or FALSE on failure

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

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.
С версии: 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
Результат boolean Returns TRUE on success or FALSE on failure.

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

Clears the user/system cache
С версии: 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.
Результат boolean Always returns true

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

Stores a file in the bytecode cache, bypassing all filters.
С версии: 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
Результат boolean Returns TRUE on success or FALSE on failure

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

Decrease a stored number
С версии: 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
Результат mixed Returns the current value of key's value on success, or FALSE on failure

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

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.
С версии: 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.
Результат boolean Returns TRUE on success or FALSE on failure.

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

Removes a stored variable from the cache
С версии: 3.1.1
public apc_delete ( mixed $key ) : mixed
$key mixed The key used to store the value (with apc_store()).
Результат mixed Returns TRUE on success or FALSE on failure.

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

Deletes files from the opcode cache
С версии: 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.
Результат 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() публичный Метод

Checks if one or more APC keys exist.
С версии: 3.1.4
public apc_exists ( mixed $keys ) : mixed
$keys mixed A string, or an array of strings, that contain keys.
Результат 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() публичный Метод

Fetch a stored variable from the cache
С версии: 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
Результат mixed The stored variable or array of variables on success; FALSE on failure

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

Increase a stored number
С версии: 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
Результат mixed Returns the current value of key's value on success, or FALSE on failure

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

Loads a set of constants from the cache
С версии: 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.
Результат boolean Returns TRUE on success or FALSE on failure

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

Retrieves APC's Shared Memory Allocation information
С версии: 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.
Результат boolean Array of Shared Memory Allocation data; FALSE on failure

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

Note: Unlike many other mechanisms in PHP, variables stored using apc_store() will persist between requests (until the value is removed from the cache).
С версии: 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.).
Результат boolean Returns TRUE on success or FALSE on failure. Second syntax returns array with error keys.

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

public apc_version ( ) : string
Результат string

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

public getFunctions ( )

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

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

Описание свойств

$adapter защищенное свойство

protected AbstractAdapter,CacheTool\Adapter $adapter
Результат CacheTool\Adapter\AbstractAdapter