An interface to the App Engine memory cache with an interface compatible with the "memcache" PHP extension (see http://php.net/manual/en/book.memcache.php)
All instances of this class use the same memory pool for their keys and values.
add(string $key, mixed $value, int $flag, int $expire) : bool
Will fail if the key is already present in the cache.
stringThe key associated with the value added to the cache.
mixedThe value to add to the cache.
intThis parameter is present only for compatibility and is ignored.
intThe delay before the item is removed from the cache. If $expire <= 2592000 then it is interpreted as the number of seconds from the time of the call to wait before removing the item from the cache. If $expire > 2592000 then it is interpreted as the absolute Unix epoch time when the value will expire.
booltrue if the item was successfully added to the cache, false
otherwise.addServer($host)
close()
connect($host, $port, $timeout)
decrement(string $key, int $value) : mixed
The value must be a int, float or string representing an integer e.g. 5, 5.0 or "5" or the call with fail.
stringThe key associated with the value to decrement.
intThe amount to decrement the value.
mixedOn success, the new value of the item is returned. On
failure, false is returned.delete(string $key) : bool
stringThe key associated with the item to delete.
booltrue if the item was successfully deleted from the cache,
false otherwise. Note that this will return false if $key is
not present in the cache.flush() : bool
booltrue if all items were removed, false otherwise.get(string | string[] $keys, int $flags) : mixed
stringstring[]The key associated with the value to fetch, or an array of keys if fetching multiple values.
intThis parameter is present only for compatibility and is ignored. It should return the stored flag value.
mixedOn success, the string associated with the key, or an array
of key-value pairs when $keys is an array. On failure, false
is returned.increment(string $key, int $value) : mixed
The value must be a int, float or string representing an integer e.g. 5, 5.0 or "5" or the call with fail.
stringThe key associated with the value to increment.
intThe amount to increment the value.
mixedOn success, the new value of the item is returned. On
failure, false is returned.pconnect($host, $port, $timeout)
replace(string $key, mixed $value, int $flag, int $expire) : bool
Will fail if the key is not already present in the cache.
stringThe key associated with the value that will be replaced in the cache.
mixedThe new cache value.
intThis parameter is present only for compatibility and is ignored.
intThe delay before the item is removed from the cache. If $expire <= 2592000 then it is interpreted as the number of seconds from the time of the call to wait before removing the item from the cache. If $expire > 2592000 then it is interpreted as the absolute Unix epoch time when the value will expire.
booltrue if the item was successfully replaced in the cache,
false otherwise.set(string $key, mixed $value, int $flag, int $expire) : bool
stringThe key associated with the value that will be replaced in the cache.
mixedThe new cache value.
intThis parameter is present only for compatibility and is ignored.
intThe delay before the item is removed from the cache. If $expire <= 2592000 then it is interpreted as the number of seconds from the time of the call to wait before removing the item from the cache. If $expire > 2592000 then it is interpreted as the absolute Unix epoch time when the value will expire.
booltrue if the item was successfully replaced the cache, false
otherwise.setCompressThreshold($threshold, $min_savings)