Memcache 类

(PECL memcache >= 0.2.0)

简介

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

类摘要

class Memcache {
add(
    string $key,
    mixed $var,
    int $flag = ?,
    int $expire = ?
): bool
addServer(
    string $host,
    int $port = 11211,
    bool $persistent = ?,
    int $weight = ?,
    int $timeout = ?,
    int $retry_interval = ?,
    bool $status = ?,
    callable $failure_callback = ?,
    int $timeoutms = ?
): bool
connect(string $host, int $port = ?, int $timeout = ?): bool
decrement(string $key, int $value = 1): int|false
delete(string $key, int $exptime = 0): bool
get(string $key, int &$flags = ?): string
getExtendedStats(string $type = ?, int $slabid = ?, int $limit = 100): array
getServerStatus(string $host, int $port = 11211): int
getStats(string $type = ?, int $slabid = ?, int $limit = 100): array|false
increment(string $key, int $value = 1): int|false
pconnect(string $host, int $port = ?, int $timeout = ?): mixed
replace(
    string $key,
    mixed $var,
    int $flag = ?,
    int $expire = ?
): bool
set(
    string $key,
    mixed $var,
    int $flag = ?,
    int $expire = ?
): bool
setCompressThreshold(int $threshold, float $min_savings = ?): bool
setServerParams(
    string $host,
    int $port = 11211,
    int $timeout = ?,
    int $retry_interval = false,
    bool $status = ?,
    callable $failure_callback = ?
): bool
}

目录