Класс Memcache
(PECL memcache >= 0.2.0)
Введение
Представляет подключение к множесту memcache серверов.
Обзор классов
Memcache
{
bool addServer
( string
$host
[, int $port
= 11211
[, bool $persistent
[, int $weight
[, int $timeout
[, int $retry_interval
[, bool $status
[, callable $failure_callback
[, int $timeoutms
]]]]]]]] )
bool setServerParams
( string
}$host
[, int $port
= 11211
[, int $timeout
[, int $retry_interval
= false
[, bool $status
[, callable $failure_callback
]]]]] )Содержание
- Memcache::add — Add an item to the server
- Memcache::addServer — Add a memcached server to connection pool
- Memcache::close — Close memcached server connection
- Memcache::connect — Open memcached server connection
- Memcache::decrement — Decrement item's value
- Memcache::delete — Delete item from the server
- Memcache::flush — Flush all existing items at the server
- Memcache::get — Retrieve item from the server
- Memcache::getExtendedStats — Get statistics from all servers in pool
- Memcache::getServerStatus — Returns server status
- Memcache::getStats — Get statistics of the server
- Memcache::getVersion — Return version of the server
- Memcache::increment — Increment item's value
- Memcache::pconnect — Open memcached server persistent connection
- Memcache::replace — Replace value of the existing item
- Memcache::set — Store data at the server
- Memcache::setCompressThreshold — Enable automatic compression of large values
- Memcache::setServerParams — Changes server parameters and status at runtime
Коментарии
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