PHP Conference Japan 2024

Memcache 類別

(PECL memcache >= 0.2.0)

簡介

表示與一組 memcache 伺服器的連線。

類別概要

類別 Memcache {
add(
    字串 $key,
    混合 $var,
    整數 $flag = ?,
    整數 $expire = ?
): 布林值
addServer(
    字串 $host,
    整數 $port = 11211,
    布林值 $persistent = ?,
    整數 (int) $weight = ?,
    整數 (int) $timeout = ?,
    整數 (int) $retry_interval = ?,
    布林值 (bool) $status = ?,
    可呼叫 (callable) $failure_callback = ?,
    整數 (int) $timeoutms = ?
): 布林值
getServerStatus(字串 $host, 整數 $port = 11211): 整數
getStats(字串 $type = ?, 整數 $slabid = ?, 整數 $limit = 100): 陣列|false
increment(字串 $key, 整數 $value = 1): 整數|false
pconnect(字串 $host, 整數 $port = ?, 整數 $timeout = ?): 混合
取代(
    字串 $key,
    混合 $var,
    整數 $flag = ?,
    整數 $expire = ?
): 布林值
設定(
    字串 $key,
    混合 $var,
    整數 $flag = ?,
    整數 $expire = ?
): 布林值
setCompressThreshold(整數 $threshold, 浮點數 $min_savings = ?): 布林值
設定伺服器參數(
    字串 $host,
    整數 $port = 11211,
    整數 (int) $timeout = ?,
    整數 $retry_interval = false,
    布林值 (bool) $status = ?,
    可呼叫 (callable) $failure_callback = ?
): 布林值
}

目錄

新增註解

使用者貢獻的註解 1 則註解

chris at NOSPAM dot xeneco dot co dot uk
11 年前
要知道,要讓此擴充功能正常運作,您需要一台安裝了「Memcached」(一項獨立於 PHP 的服務)並以服務形式執行的伺服器。

此處的說明文件多次提及「memcache_host」。這不是任意字串,而應該是執行 memcached 的伺服器的主機名稱(例如 localhost)或 IP 位址。

如果您剛安裝 php memcache 擴充功能,則不一定也安裝了 memcached
To Top