array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'uk', ), 'this' => array ( 0 => 'memcached.replacebykey.php', 1 => 'Memcached::replaceByKey', 2 => 'Replace the item under an existing key on a specific server', ), 'up' => array ( 0 => 'class.memcached.php', 1 => 'Memcached', ), 'prev' => array ( 0 => 'memcached.replace.php', 1 => 'Memcached::replace', ), 'next' => array ( 0 => 'memcached.resetserverlist.php', 1 => 'Memcached::resetServerList', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/memcached/memcached/replacebykey.xml', ), 'history' => array ( ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); contributors($setup); ?>
(PECL memcached >= 0.1.0)
Memcached::replaceByKey — Replace the item under an existing key on a specific server
$server_key,$key,$value,$expiration = 0
Memcached::replaceByKey() is functionally equivalent to
Memcached::replace(), 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.
server_keyКлюч, що визначає сервер, на якому зберігатиметься значення або з якого його можна отримати. Замість гешування ключа елемента, гешується ключ сервера, з яким буде взаємодіяти memcached. Це дозволяє об'єднувати пов'язані елементи на єдиному сервері для пришвидшення одночасних операцій.
keyКлюч, під яким зберігається значення.
valueЗначення для зберігання.
expirationТермін зберігання, стандарно — 0. Докладніше: Терміни зберігання.
Повертає true у разі успіху або false в разі помилки.
The Memcached::getResultCode() will return
Memcached::RES_NOTSTORED if the key does not exist.