![]() |
App Engine PHP SDK
v1 rev.445
The PHP runtime is available as an experimental Preview feature.
|
Public Member Functions | |
deleteMulti ($keys, $time=0) | |
__construct ($persistent_id=null) | |
add ($key, $value, $expiration=0) | |
addByKey ($server_key, $key, $value, $expiration=0) | |
addServer ($host, $port, $weight=0) | |
addServers ($servers) | |
append ($key, $value) | |
appendByKey (string $server_key, string $key, string $value) | |
cas ($cas_token, $key, $value, $expiration=0) | |
casByKey ($cas_token, $server_key, $key, $value, $expiration=0) | |
decrement ($key, $offset=1, $initial_value=0, $expiration=0) | |
decrementByKey ($server_key, $key, $offset=1, $initial_value=0, $expiration=0) | |
delete ($key, $time=0) | |
deleteByKey ($server_key, $key, $time=0) | |
deleteMulti ($keys, $time=0) | |
deleteMultiByKey ($server_key, $keys, $time=0) | |
fetch () | |
fetchAll () | |
flush ($delay=0) | |
get ($key, $cache_cb=null, &$cas_token=null) | |
getAllKeys () | |
getByKey ($server_key, $key, $cache_cb, &$cas_token) | |
getDelayed ($keys, $with_cas=false, $value_cb=null) | |
getDelayedByKey ($server_key, $keys, $with_cas=false, $value_cb=null) | |
getMulti ($keys, &$cas_tokens=null, $flags=0) | |
getMultiByKey ($server_key, $keys, $with_cas=false, $value_cb=null) | |
getOption ($option) | |
getResultCode () | |
getResultMessage () | |
getServerByKey ($server_key) | |
getServerList () | |
getStats () | |
getVersion () | |
increment ($key, $offset=1, $initial_value=0, $expiry=0) | |
incrementByKey ($server_key, $key, $offset=1, $initial_value=0, $expiry=0) | |
isPersistent () | |
isPristine () | |
prepend ($key, $value) | |
prependByKey ($server_key, $key, $value) | |
quit () | |
replace ($key, $value, $expiration=0) | |
replaceByKey ($server_key, $key, $value, $expiration=0) | |
resetServerList () | |
set ($key, $value, $expiration=0) | |
setByKey ($server_key, $key, $value, $expiration=0) | |
setMulti ($items, $expiration=0) | |
setMultiByKey ($server_key, $items, $expiration=0) | |
setOption ($option, $value) | |
setOptions ($options) | |
setSaslAuthData ($username, $password) | |
touch ($key, $expiration=0) | |
touchByKey ($server_key, $key, $expiration=0) | |
Static Public Member Functions | |
static | setMockMemcached ($mock) |
Public Attributes | |
const | OPT_PREFIX_KEY = 1 |
const | OPT_COMPRESSION = 2 |
const | OPT_HASH = 3 |
const | OPT_DISTRIBUTION = 4 |
const | OPT_BUFFER_WRITES = 5 |
const | OPT_BINARY_PROTOCOL = 6 |
const | OPT_NO_BLOCK = 7 |
const | OPT_TCP_NODELAY = 8 |
const | OPT_SOCKET_SEND_SIZE = 9 |
const | OPT_SOCKET_RECV_SIZE = 10 |
const | OPT_CONNECT_TIMEOUT = 11 |
const | OPT_RETRY_TIMEOUT = 12 |
const | OPT_SEND_TIMEOUT = 13 |
const | OPT_RECV_TIMEOUT = 14 |
const | OPT_POLL_TIMEOUT = 15 |
const | OPT_CACHE_LOOKUPS = 16 |
const | OPT_SERVER_FAILURE_LIMIT = 17 |
const | OPT_SERIALIZER = 18 |
const | HAVE_IGBINARY = 20 |
const | HAVE_JSON = 21 |
const | SERIALIZER_PHP = 100 |
const | SERIALIZER_IGBINARY = 101 |
const | SERIALIZER_JSON = 102 |
const | HASH_DEFAULT = 200 |
const | HASH_MD5 = 201 |
const | HASH_CRC = 202 |
const | HASH_FNV1_64 = 203 |
const | HASH_FNV1A_64 = 204 |
const | HASH_FNV1_32 = 205 |
const | HASH_FNV1A_32 = 206 |
const | HASH_HSIEH = 207 |
const | HASH_MURMUR = 208 |
const | DISTRIBUTION_MODULA = 300 |
const | DISTRIBUTION_CONSISTENT = 301 |
const | OPT_LIBKETAMA_COMPATIBLE = 302 |
const | GET_PRESERVE_ORDER = 10 |
const | RES_SUCCESS = 0 |
const | RES_FAILURE = 1 |
const | RES_HOST_LOOKUP_FAILURE = 2 |
const | RES_UNKNOWN_READ_FAILURE = 7 |
const | RES_PROTOCOL_ERROR = 8 |
const | RES_CLIENT_ERROR = 9 |
const | RES_SERVER_ERROR = 10 |
const | RES_WRITE_FAILURE = 5 |
const | RES_DATA_EXISTS = 12 |
const | RES_NOTSTORED = 14 |
const | RES_NOTFOUND = 16 |
const | RES_PARTIAL_READ = 18 |
const | RES_SOME_ERRORS = 19 |
const | RES_NO_SERVERS = 20 |
const | RES_END = 21 |
const | RES_ERRNO = 26 |
const | RES_BUFFERED = 32 |
const | RES_TIMEOUT = 31 |
const | RES_BAD_KEY_PROVIDED = 33 |
const | RES_CONNECTION_SOCKET_CREATE_FAILURE = 11 |
const | RES_PAYLOAD_FAILURE = -1001 |
Static Public Attributes | |
static | $mock_memcached = null |
Memcached::add | ( | $key, | |
$value, | |||
$expiration = 0 |
|||
) |
add is similar to set(), but the operation fails if the key already exists on the server.
string | $key | The key under which to store the value. |
mixed | $value | The value to store. |
int | $expiration | The expiration time, defaults to 0. |
Memcached::addByKey | ( | $server_key, | |
$key, | |||
$value, | |||
$expiration = 0 |
|||
) |
Memcached::addByKey() is functionally equivalent to Memcached::add(), except that the free-form server_key can be used to map the key to a specific server. This is useful if you need to keep a bunch of related keys on a certain server.
string | $server_key | This parameter is ignored. |
string | $key | The key under which to store the value. |
mixed | $value | The value to store. |
int | $expiration | The expiration time, defaults to 0. |
Memcached::addServer | ( | $host, | |
$port, | |||
$weight = 0 |
|||
) |
This function is present only for compatibility and does nothing.
Memcached::addServers | ( | $servers | ) |
This function is present only for compatibility and does nothing.
Memcached::append | ( | $key, | |
$value | |||
) |
Memcached::append() appends the given value string to the value of an existing item. The reason that value is forced to be a string is that appending mixed types is not well-defined.
string | $key | The key under which to append the value. |
string | $value | The value to append |
Memcached::appendByKey | ( | string | $server_key, |
string | $key, | ||
string | $value | ||
) |
string | $server_key | This parameter is ignored. |
string | $key | The key under which to append the value. |
string | $value | The value to append |
Memcached::cas | ( | $cas_token, | |
$key, | |||
$value, | |||
$expiration = 0 |
|||
) |
Performs a set and check operation, so that the item will be stored only if no other client has updated it since it was last fetched by this client.
mixed | $cas_token | Unique memcached assigned value. |
string | $key | The key under which to store the value. |
mixed | $value | The value to store. |
int | $expiration | The expiration time, defaults to 0. |
Memcached::casByKey | ( | $cas_token, | |
$server_key, | |||
$key, | |||
$value, | |||
$expiration = 0 |
|||
) |
mixed | $cas_token | Unique memcached assigned value. |
string | $server_key | Ignored. |
string | $key | The key under which to store the value. |
mixed | $value | The value to store. |
int | $expiration | The expiration time, defaults to 0. |
Memcached::decrement | ( | $key, | |
$offset = 1 , |
|||
$initial_value = 0 , |
|||
$expiration = 0 |
|||
) |
Decrements a numeric item's value by $offset.
string | $key | The key under which to store the value. |
int | $offset | The amount by which to decrement the item's value. |
int | $initial_value | The value to set the item to if it does not currently exist. |
int | $expiration | The expiration time, defaults to 0. |
Memcached::decrementByKey | ( | $server_key, | |
$key, | |||
$offset = 1 , |
|||
$initial_value = 0 , |
|||
$expiration = 0 |
|||
) |
string | $server_key | This parameter is ignored. |
string | $key | The key under which to store the value. |
int | $offset | The amount by which to decrement the item's value. |
int | $initial_value | The value to set the item to if it does not currently exist. |
int | $expiration | The expiration time, defaults to 0. |
Memcached::delete | ( | $key, | |
$time = 0 |
|||
) |
deletes the $key from the server.
string | $key | The key to delete from the server. |
int | $time | The time parameter is the amount of time in seconds the client wishes the server to refuse add and replace commands for this key. |
Memcached::deleteByKey | ( | $server_key, | |
$key, | |||
$time = 0 |
|||
) |
string | $server_key | This parameter is ignored. |
string | $key | The key to delete from the server. |
int | $time | The time parameter is the amount of time in seconds the client wishes the server to refuse add and replace commands for this key. |
Memcached::deleteMulti | ( | $keys, | |
$time = 0 |
|||
) |
deletes an array of $keys from the server.
array | $keys | The keys to delete from the server. |
int | $time | The time parameter is the amount of time in seconds the client wishes the server to refuse add and replace commands for this key. |
Memcached::deleteMultiByKey | ( | $server_key, | |
$keys, | |||
$time = 0 |
|||
) |
string | $server_key | This parameter is ignored. |
array | $keys | The keys to delete from the server. |
int | $time | The time parameter is the amount of time in seconds the client wishes the server to refuse add and replace commands for this key. |
Memcached::fetch | ( | ) |
fetch retrieves the next result from the last getDelayed() request.
Note that currently getDelayed is a synchronous call.
Memcached::fetchAll | ( | ) |
Fetch all of the remaining results from the last getDelayed() request.
Note that currently getDelayed is a synchronous call.
Memcached::flush | ( | $delay = 0 | ) |
Invalidates all existing cache items immediately.
int | $delay | This parameter is ignored. |
Memcached::get | ( | $key, | |
$cache_cb = null , |
|||
& | $cas_token = null |
||
) |
Returns the item that was previously stored under the $key.
string | $key | The key under which to store the value. |
callable | $cache_cb | Read through caching callback. |
mixed | $cas_token | The variable to store the CAS token in. This value is opaque to the application. |
Memcached::getAllKeys | ( | ) |
This function is present only for compatibility and does nothing.
Memcached::getByKey | ( | $server_key, | |
$key, | |||
$cache_cb, | |||
& | $cas_token | ||
) |
string | $server_key | This parameter is ignored. |
string | $key | The key under which to store the value. |
callable | $cache_cb | Read through caching callback. |
mixed | $cas_token | The variable to store the CAS token in. This value is opaque to the application. |
Memcached::getDelayed | ( | $keys, | |
$with_cas = false , |
|||
$value_cb = null |
|||
) |
Issues a request to memcache for multiple items the keys of which are specified in the keys array. Currently this method executes synchronously.
array | $keys | Array of keys to retrieve. |
bool | $with_cas | If true, retrieve the CAS tokens for the keys. |
callable | $value_cb | The result callback. |
Memcached::getDelayedByKey | ( | $server_key, | |
$keys, | |||
$with_cas = false , |
|||
$value_cb = null |
|||
) |
string | $server_key | This parameter is ignored. |
array | $keys | Array of keys to retrieve. |
bool | $with_cas | If true, retrieve the CAS tokens for the keys. |
callable | $value_cb | The result callback. |
Memcached::getMulti | ( | $keys, | |
& | $cas_tokens = null , |
||
$flags = 0 |
|||
) |
Similar to Memcached::get(), but instead of a single key item, it retrieves multiple items the keys of which are specified in the keys array.
array | $keys | Array of keys to retrieve. |
array | $cas_tokens | The variable to store the CAS tokens for found items. |
int | $flags | The flags for the get operation. |
Memcached::getMultiByKey | ( | $server_key, | |
$keys, | |||
$with_cas = false , |
|||
$value_cb = null |
|||
) |
string | $server_key | This parameter is ignored. |
array | $keys | Array of keys to retrieve. |
array | $cas_tokens | The variable to store the CAS tokens for found items. |
int | $flags | The flags for the get operation. |
Memcached::getOption | ( | $option | ) |
Retrieve a Memcached option value.
int $option One of the Memcached::OPT_* constants.
Memcached::getResultCode | ( | ) |
Returns one of the Memcached::RES_* constants that is the result of the last executed Memcached method.
Memcached::getResultMessage | ( | ) |
Return the message describing the result of the last operation.
Memcached::getServerByKey | ( | $server_key | ) |
This function is present only for compatibility and does nothing.
Memcached::getServerList | ( | ) |
This function is present only for compatibility and does nothing.
Memcached::getStats | ( | ) |
This function is present only for compatibility and does nothing.
Memcached::getVersion | ( | ) |
This function is present only for compatibility and does nothing.
Memcached::increment | ( | $key, | |
$offset = 1 , |
|||
$initial_value = 0 , |
|||
$expiry = 0 |
|||
) |
Increments a numeric item's value by the specified offset. If the item's value is not numeric, and error will result.
string | $key | The key of the item to increment |
int | $offset | The amount by which to increment the item's value |
int | $initial_value | The value to set the item to if it doesn't exist. |
int | $expiry | The expiry time to set on the item. |
Memcached::incrementByKey | ( | $server_key, | |
$key, | |||
$offset = 1 , |
|||
$initial_value = 0 , |
|||
$expiry = 0 |
|||
) |
string | $server_key | This parameter is ignored. |
string | $key | The key of the item to increment |
int | $offset | The amount by which to increment the item's value |
int | $initial_value | The value to set the item to if it doesn't exist. |
int | $expiry | The expiry time to set on the item. |
Memcached::isPersistent | ( | ) |
This function is present only for compatibility and does nothing.
Memcached::isPristine | ( | ) |
This function is present only for compatibility and does nothing.
Memcached::prepend | ( | $key, | |
$value | |||
) |
Prepends the given value string to an existing item.
string | $key | The key under which to store the value. |
string | $value | The string to prepend. |
Memcached::prependByKey | ( | $server_key, | |
$key, | |||
$value | |||
) |
string | $server_key | This parameter is ignored. |
string | $key | The key under which to store the value. |
string | $value | The string to prepend. |
Memcached::quit | ( | ) |
This function is present only for compatibility and does nothing.
Memcached::replace | ( | $key, | |
$value, | |||
$expiration = 0 |
|||
) |
Replace is similar to Memcache::set(), but the operation will fail if the key is not found on the server.
string | $key | The key under which to store the value. |
mixed | $value | The value to store. |
int | $expiration | The expiration time, defaults to 0. |
Memcached::replaceByKey | ( | $server_key, | |
$key, | |||
$value, | |||
$expiration = 0 |
|||
) |
string | $server_key | This parameter is ignored. |
string | $key | The key under which to store the value. |
mixed | $value | The value to store. |
int | $expiration | The expiration time, defaults to 0. |
Memcached::resetServerList | ( | ) |
This function is present only for compatibility and does nothing.
Memcached::set | ( | $key, | |
$value, | |||
$expiration = 0 |
|||
) |
Stores the value on a memcache server under the specified key. The expiration parameters can be used to control when the value is considered expired.
string | $key | The key under which to store the value. |
mixed | $value | The value to store. |
int | $expiration | The expiration time, defaults to 0. |
Memcached::setByKey | ( | $server_key, | |
$key, | |||
$value, | |||
$expiration = 0 |
|||
) |
string | $server_key | This parameter is ignored. |
string | $key | The key under which to store the value. |
mixed | $value | The value to store. |
int | $expiration | The expiration time, defaults to 0. |
Memcached::setMulti | ( | $items, | |
$expiration = 0 |
|||
) |
Is similar to Memcached::set(), but instead of a single key/value item, it works on multiple items specified in items.
array | $items | An array of key value pairs to set. |
int | $expiration | The expiration time to set for the value. |
returns bool true if the call succeeds, false otherwise.
Memcached::setMultiByKey | ( | $server_key, | |
$items, | |||
$expiration = 0 |
|||
) |
string | $server_key | This parameter is ignored. |
array | $items | An array of key value pairs to set. |
int | $expiration | The expiration time to set for the value. |
Memcached::setOption | ( | $option, | |
$value | |||
) |
This method sets the vaue of a memcached option.
int | $option | The option to set. |
mixed | $value | The value to set the option to. |
Memcached::setOptions | ( | $options | ) |
This is a varion of Memcached::setOption() that takes an array of options to be set.
mixed | $options | An associated array of options. |
Memcached::setSaslAuthData | ( | $username, | |
$password | |||
) |
This function is present only for compatibility and does nothing.
Memcached::touch | ( | $key, | |
$expiration = 0 |
|||
) |
Sets a new expiration time on an item.
string | $key | The key under which to append the value. |
int | $expiration | The expiration time, defaults to 0. |
Memcached::touchByKey | ( | $server_key, | |
$key, | |||
$expiration = 0 |
|||
) |
Functionally equivalent to Memcached::touch().
string | $server_key | This parameter is ignored. |
string | $key | The key under which to append the value. |
int | $expiration | The expiration time, defaults to 0. |
const Memcached::OPT_PREFIX_KEY = 1 |
Constants taken from http://www.php.net/manual/en/memcached.constants.php