PHP 8.4.0 RC4 available for testing

La clase Memcache

(PECL memcache >= 0.2.0)

Introducción

Representa una conexión a un conjunto de servidores memcache.

Sinopsis de la Clase

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
delete(string $key, int $timeout = 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
increment(string $key, int $value = 1): int
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
}

Tabla de contenidos

add a note

User Contributed Notes 1 note

up
11
chris at NOSPAM dot xeneco dot co dot uk
11 years ago
It helps to know that for this extension to work, you need a server with 'Memcached' (a service independent of PHP) installed and running as a service.

The documentation herein refers a lot to 'memcache_host'. This is not an arbitrary string, but should be a host name (eg localhost) or an IP address of a server running memcached.

If you have just installed the php memcache extension then you will not necessarily have memcached installed as well
To Top