PHP Conference Japan 2024

Memcached 类

(PECL memcached >= 0.1.0)

简介

表示与一组 memcached 服务器的连接。

类概要

class Memcached {
/* 方法 */
public __construct(?string $persistent_id = null, ?callable $callback = null, ?string $connection_str = null)
public add(string $key, mixed $value, int $expiration = 0): bool
public addByKey(
    string $server_key,
    string $key,
    mixed $value,
    int $expiration = 0
): bool
public addServer(string $host, int $port, int $weight = 0): bool
public addServers(array $servers): bool
public append(string $key, string $value): ?bool
public appendByKey(string $server_key, string $key, string $value): ?bool
public cas(
    string|int|float $cas_token,
    string $key,
    mixed $value,
    int $expiration = 0
): bool
public casByKey(
    string|int|float $cas_token,
    string $server_key,
    string $key,
    mixed $value,
    int $expiration = 0
): bool
public decrement(
    string $key,
    int $offset = 1,
    int $initial_value = 0,
    int $expiry = 0
): int|false
public decrementByKey(
    string $server_key,
    string $key,
    int $offset = 1,
    int $initial_value = 0,
    int $expiry = 0
): int|false
public delete(string $key, int $time = 0): bool
public deleteByKey(string $server_key, string $key, int $time = 0): bool
public deleteMulti(array $keys, int $time = 0): array
public deleteMultiByKey(string $server_key, array $keys, int $time = 0): array
public fetch(): array|false
public fetchAll(): array|false
public flush(int $delay = 0): bool
public get(字符串 $key, ?可调用 $cache_cb = null, 整数 $get_flags = 0): 混合
public getByKey(
    string $server_key,
    string $key,
    ?可调用 $cache_cb = null,
    整数 $get_flags = 0
): 混合
public getDelayed(数组 $keys, 布尔值 $with_cas = false, ?可调用 $value_cb = null): 布尔值
public getDelayedByKey(
    string $server_key,
    数组 $keys,
    布尔值 $with_cas = false,
    ?可调用 $value_cb = null
): bool
public getMulti(数组 $keys, 整数 $get_flags = 0): 数组|false
public getMultiByKey(字符串 $server_key, 数组 $keys, 整数 $get_flags = 0): 数组|false
public getOption(整数 $option): 混合
public getServerByKey(字符串 $server_key): 数组|false
public increment(
    string $key,
    int $offset = 1,
    int $initial_value = 0,
    int $expiry = 0
): int|false
public incrementByKey(
    string $server_key,
    string $key,
    int $offset = 1,
    int $initial_value = 0,
    int $expiry = 0
): int|false
public prepend(字符串 $key, 字符串 $value): ?布尔值
public prependByKey(字符串 $server_key, 字符串 $key, 字符串 $value): ?布尔值
public quit(): 布尔值
public replace(字符串 $key, 混合 $value, 整数 $expiration = 0): 布尔值
public replaceByKey(
    string $server_key,
    string $key,
    mixed $value,
    int $expiration = 0
): bool
public set(字符串 $key, 混合 $value, 整数 $expiration = 0): 布尔值
public setByKey(
    string $server_key,
    string $key,
    mixed $value,
    int $expiration = 0
): bool
public setMulti(数组 $items, 整数 $expiration = 0): 布尔值
public setMultiByKey(字符串 $server_key, 数组 $items, 整数 $expiration = 0): 布尔值
public setOption(整数 $option, 混合 $value): 布尔值
public setOptions(数组 $options): 布尔值
public setSaslAuthData(字符串 $username, 字符串 $password): 布尔值
public touch(字符串 $key, 整数 $expiration = 0): 布尔值
public touchByKey(字符串 $server_key, 字符串 $key, 整数 $expiration = 0): 布尔值
}

目录

添加注释

用户贡献的注释

此页面没有用户贡献的注释。
To Top