Dutch PHP Conference 2025 - Call For Papers

Memcached::deleteByKey

(PECL memcached >= 0.1.0)

Memcached::deleteByKeyDelete an item from a specific server

Опис

public Memcached::deleteByKey(string $server_key, string $key, int $time = 0): bool

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

Параметри

server_key

Ключ, що визначає сервер, на якому зберігатиметься значення або з якого його можна отримати. Замість гешування ключа елемента, гешується ключ сервера, з яким буде взаємодіяти memcached. Це дозволяє об'єднувати пов'язані елементи на єдиному сервері для пришвидшення одночасних операцій.

key

The key to be deleted.

time

The amount of time the server will wait to delete the item.

Зауваження: Починаючи з memcached 1.3.0 (випущено в 2009) цей функціонал більше не підтримується. Використання ненульового time спричинить помилку під час видалення. Memcached::getResultCode() поверне MEMCACHED_INVALID_ARGUMENTS.

Значення, що повертаються

Повертає true у разі успіху або false в разі помилки. The Memcached::getResultCode() will return Memcached::RES_NOTFOUND if the key does not exist.

Прогляньте також

add a note

User Contributed Notes

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