Memcache
在线手册:中文  英文

Memcache类

(PECL memcache >= 0.2.0)

简介

表示连接到一个服务器组的连接。

类摘要

Memcache {
bool 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 [, callback $failure_callback [, int $timeoutms ]]]]]]]] )
bool close ( void )
bool connect ( string $host [, int $port [, int $timeout ]] )
int decrement ( string $key [, int $value = 1 ] )
bool delete ( string $key [, int $timeout = 0 ] )
bool flush ( void )
string get ( string $key [, int &$flags ] )
array getExtendedStats ([ string $type [, int $slabid [, int $limit = 100 ]]] )
int getServerStatus ( string $host [, int $port = 11211 ] )
array getStats ([ string $type [, int $slabid [, int $limit = 100 ]]] )
string getVersion ( void )
int increment ( string $key [, int $value = 1 ] )
mixed pconnect ( string $host [, int $port [, int $timeout ]] )
bool 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 [, callback $failure_callback ]]]]] )
}

Table of Contents


Memcache
在线手册:中文  英文

用户评论:

chris at NOSPAM dot xeneco dot co dot uk (2013-01-09 21:40:42)

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

易百教程