|
| get ($keys, $flags=null) |
|
| set ($key, $value, $flag=null, $expire=0) |
|
| add ($key, $value, $flag=null, $expire=0) |
|
| addServer ($host) |
|
| close () |
|
| connect ($host, $port=null, $timeout=1) |
|
| decrement ($key, $value=1) |
|
| delete ($key) |
|
| flush () |
|
| get ($keys, $flags=null) |
|
| increment ($key, $value=1) |
|
| pconnect ($host, $port=null, $timeout=1) |
|
| replace ($key, $value, $flag=null, $expire=0) |
|
| set ($key, $value, $flag=null, $expire=0) |
|
| setCompressThreshold ($threshold, $min_savings=0.2) |
|
|
static | setMockMemcache ($mock) |
|
|
static | $mock_memcache = null |
|
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.
Memcache::add |
( |
|
$key, |
|
|
|
$value, |
|
|
|
$flag = null , |
|
|
|
$expire = 0 |
|
) |
| |
Adds a new item to the cache. Will fail if the key is already present in the cache.
- Parameters
-
string | $key | The key associated with the value added to the cache. |
mixed | $value | The value to add to the cache. |
int | $flag | This parameter is present only for compatibility and is ignored. |
int | $expire | The 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. |
- Returns
- bool true if the item was successfully added to the cache, false otherwise.
Memcache::addServer |
( |
|
$host | ) |
|
This function is present only for compatibility and does nothing.
This function is present only for compatibility and does nothing.
Memcache::connect |
( |
|
$host, |
|
|
|
$port = null , |
|
|
|
$timeout = 1 |
|
) |
| |
This function is present only for compatibility and does nothing.
Memcache::decrement |
( |
|
$key, |
|
|
|
$value = 1 |
|
) |
| |
Decrements a cached item's value. The value must be a int, float or string representing an integer e.g. 5, 5.0 or "5" or the call with fail.
- Parameters
-
string | $key | The key associated with the value to decrement. |
int | $value | The amount to decrement the value. |
- Returns
- mixed On success, the new value of the item is returned. On failure, false is returned.
Deletes an item from the cache.
- Parameters
-
string | $key | The key associated with the item to delete. |
- Returns
- bool true 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.
Removes all items from cache.
- Returns
- bool true if all items were removed, false otherwise.
Memcache::get |
( |
|
$keys, |
|
|
|
$flags = null |
|
) |
| |
Fetches previously stored data from the cache.
- Parameters
-
| string|string[] | $keys The key associated with the value to fetch, or an array of keys if fetching multiple values. |
int | $flags | This parameter is present only for compatibility and is ignored. It should return the stored flag value. |
- Returns
- mixed On success, the string associated with the key, or an array of key-value pairs when $keys is an array. On failure, false is returned.
Memcache::increment |
( |
|
$key, |
|
|
|
$value = 1 |
|
) |
| |
Increments a cached item's value. The value must be a int, float or string representing an integer e.g. 5, 5.0 or "5" or the call with fail.
- Parameters
-
string | $key | The key associated with the value to decrement. |
int | $value | The amount to increment the value. |
- Returns
- mixed On success, the new value of the item is returned. On failure, false is returned.
Memcache::pconnect |
( |
|
$host, |
|
|
|
$port = null , |
|
|
|
$timeout = 1 |
|
) |
| |
This function is present only for compatibility and does nothing.
Memcache::replace |
( |
|
$key, |
|
|
|
$value, |
|
|
|
$flag = null , |
|
|
|
$expire = 0 |
|
) |
| |
Replaces an existing item in the cache. Will fail if the key is not already present in the cache.
- Parameters
-
string | $key | The key associated with the value that will be replaced in the cache. |
mixed | $value | The new cache value. |
int | $flag | This parameter is present only for compatibility and is ignored. |
int | $expire | The 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. |
- Returns
- bool true if the item was successfully replaced in the cache, false otherwise.
Memcache::set |
( |
|
$key, |
|
|
|
$value, |
|
|
|
$flag = null , |
|
|
|
$expire = 0 |
|
) |
| |
Sets the value of a key in the cache regardless of whether it is currently present or not.
- Parameters
-
string | $key | The key associated with the value that will be replaced in the cache. |
mixed | $value | The new cache value. |
int | $flag | This parameter is present only for compatibility and is ignored. |
int | $expire | The 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. |
- Returns
- bool true if the item was successfully replaced the cache, false otherwise.
Memcache::setCompressThreshold |
( |
|
$threshold, |
|
|
|
$min_savings = 0.2 |
|
) |
| |
This function is present only for compatibility and does nothing.
The documentation for this class was generated from the following files:
- code/googleappengine-read-only/python/php/sdk/google/appengine/ext/cloud_storage_streams/CloudStorageStreamWrapperTest.php
- code/googleappengine-read-only/python/php/sdk/google/appengine/runtime/Memcache.php