Memcached::getByKey

(PECL memcached >= 0.1.0)

Memcached::getByKeyRetrieve an item from a specific server

Descrição

public Memcached::getByKey ( string $server_key , string $key , callable $cache_cb = ? , int $flags = ? ) : mixed

Memcached::getByKey() is functionally equivalent to Memcached::get(), except that the free-form server_key can be used to map the key to a specific server.

Parâmetros

server_key

A chave identificando o servidor onde armazenar ou recuperar o valor. Em vez de fazer o hash do item, é feito o hash da chave do servidor quando decidindo com qual servidor memcached conectar. Isto permite que itens relacionados sejam agrupados em um único servidor para maior eficiência de operações múltiplas.

key

The key of the item to fetch.

cache_cb

Read-through caching callback or null

flags

Flags to control the returned result. When value of Memcached::GET_EXTENDED is given will return the CAS token.

Valor Retornado

Returns the value stored in the cache or false otherwise. The Memcached::getResultCode() will return Memcached::RES_NOTFOUND if the key does not exist.

Changelog

Versão Descrição
PECL memcached 3.0.0 The &cas_token parameter was removed. Instead flags was added and when it is given the value of Memcached::GET_EXTENDED it will ensure the CAS token to be fetched.

Veja Também

add a note add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top