Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

apc_add(3) [php man page]

APC_ADD(3)								 1								APC_ADD(3)

apc_add - Cache a new variable in the data store

SYNOPSIS
bool apc_add (string $key, mixed $var, [int $ttl]) DESCRIPTION
array apc_add (array $values, [mixed $unused = NULL], [int $ttl]) Caches a variable in the data store, only if it's not already stored. Note Unlike many other mechanisms in PHP, variables stored using apc_add(3) will persist between requests (until the value is removed from the cache). PARAMETERS
o $key - Store the variable using this name. $keys are cache-unique, so attempting to use apc_add(3) 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(3) and apc_store(3).) o $var - The variable to store o $ttl - 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.). o $values - Names in key, variables in value. RETURN VALUES
Returns TRUE if something has effectively been added into the cache, FALSE otherwise. Second syntax returns array with error keys. EXAMPLES
Example #1 A apc_add(3) example <?php $bar = 'BAR'; apc_add('foo', $bar); var_dump(apc_fetch('foo')); echo " "; $bar = 'NEVER GETS SET'; apc_add('foo', $bar); var_dump(apc_fetch('foo')); echo " "; ?> The above example will output: string(3) "BAR" string(3) "BAR" SEE ALSO
apc_store(3), apc_fetch(3), apc_delete(3). PHP Documentation Group APC_ADD(3)

Check Out this Related Man Page

WINCACHE_UCACHE_DELETE(3)						 1						 WINCACHE_UCACHE_DELETE(3)

wincache_ucache_delete - Deletes variables from the user cache

SYNOPSIS
bool wincache_ucache_delete (mixed $key) DESCRIPTION
Deletes the elements in the user cache pointed by $key. PARAMETERS
o $key - The $key that was used to store the variable in the cache. $key is case sensitive. $key can be an array of keys. RETURN VALUES
Returns TRUE on success or FALSE on failure. If $key is an array then the function returns FALSE if every element of the array fails to get deleted from the user cache, otherwise returns an array which consists of all the keys that are deleted. EXAMPLES
Example #1 Using wincache_ucache_delete(3) with $key as a string <?php wincache_ucache_set('foo', 'bar'); var_dump(wincache_ucache_delete('foo')); var_dump(wincache_ucache_exists('foo')); ?> The above example will output: bool(true) bool(false) Example #2 Usingwincache_ucache_delete(3) with $key as an array <?php $array1 = array('green' => '5', 'blue' => '6', 'yellow' => '7', 'cyan' => '8'); wincache_ucache_set($array1); $array2 = array('green', 'blue', 'yellow', 'cyan'); var_dump(wincache_ucache_delete($array2)); ?> The above example will output: array(4) { [0]=> string(5) "green" [1]=> string(4) "Blue" [2]=> string(6) "yellow" [3]=> string(4) "cyan" } Example #3 Using wincache_ucache_delete(3) with $key as an array where some elements cannot be deleted <?php $array1 = array('green' => '5', 'blue' => '6', 'yellow' => '7', 'cyan' => '8'); wincache_ucache_set($array1); $array2 = array('orange', 'red', 'yellow', 'cyan'); var_dump(wincache_ucache_delete($array2)); ?> The above example will output: array(2) { [0]=> string(6) "yellow" [1]=> string(4) "cyan" } SEE ALSO
wincache_ucache_set(3), wincache_ucache_add(3), wincache_ucache_get(3), wincache_ucache_clear(3), wincache_ucache_exists(3), win- cache_ucache_meminfo(3), wincache_ucache_info(3). PHP Documentation Group WINCACHE_UCACHE_DELETE(3)
Man Page