Memcache
class Memcache extends MemcachePool (View source)
Represents a connection to a set of memcache servers.
Methods
(PECL memcache >= 0.2.0)
Open memcached server connection
(PECL memcache >= 2.0.0)
Add a memcached server to connection pool
(PECL memcache >= 2.1.0)
Changes server parameters and status at runtime
(PECL memcache >= 2.1.0)
Returns server status
(PECL memcache >= 2.0.0)
Add an item to the server. If the key already exists, the value will not be added and FALSE will be returned.
(PECL memcache >= 0.2.0)
Stores an item var with key on the memcached server. Parameter expire is expiration time in seconds.
(PECL memcache >= 0.2.0)
Replace value of the existing item
(PECL memcache >= 0.2.0)
Retrieve item from the server
(PECL memcache >= 0.2.0)
Delete item from the server
https://secure.php.net/manual/en/memcache.delete.php
(PECL memcache >= 0.2.0)
Get statistics of the server
(PECL memcache >= 2.0.0)
Get statistics from all servers in pool
(PECL memcache >= 2.0.0)
Enable automatic compression of large values
(PECL memcache >= 0.2.0)
Increment item's value
(PECL memcache >= 0.2.0)
Decrement item's value
(PECL memcache >= 0.4.0)
Open memcached server persistent connection
Details
bool
connect(string $host, int $port, int $timeout = 1)
(PECL memcache >= 0.2.0)
Open memcached server connection
bool
addServer(string $host, int $port = 11211, bool $persistent = true, int $weight = null, int $timeout = 1, int $retry_interval = 15, bool $status = true, callable $failure_callback = null, int $timeoutms = null)
(PECL memcache >= 2.0.0)
Add a memcached server to connection pool
bool
setServerParams(string $host, int $port = 11211, int $timeout = 1, int $retry_interval = 15, bool $status = true, callable $failure_callback = null)
(PECL memcache >= 2.1.0)
Changes server parameters and status at runtime
setFailureCallback()
No description
int
getServerStatus(string $host, int $port = 11211)
(PECL memcache >= 2.1.0)
Returns server status
findServer()
No description
string|false
getVersion()
(PECL memcache >= 0.2.0)
Return version of the server
bool
add(string $key, mixed $var, int $flag = null, int $expire = null)
(PECL memcache >= 2.0.0)
Add an item to the server. If the key already exists, the value will not be added and FALSE will be returned.
bool
set(string $key, mixed $var, int $flag = null, int $expire = null)
(PECL memcache >= 0.2.0)
Stores an item var with key on the memcached server. Parameter expire is expiration time in seconds.
If it's 0, the item never expires (but memcached server doesn't guarantee this item to be stored all the time, it could be deleted from the cache to make place for other items). You can use MEMCACHE_COMPRESSED constant as flag value if you want to use on-the-fly compression (uses zlib).
bool
replace(string $key, mixed $var, int $flag = null, int $expire = null)
(PECL memcache >= 0.2.0)
Replace value of the existing item
cas()
No description
append()
No description
string
prepend()
No description
string|array|false
get(string|array $key, int|array $flags = null)
(PECL memcache >= 0.2.0)
Retrieve item from the server
bool
delete(string $key, int $timeout = 0)
(PECL memcache >= 0.2.0)
Delete item from the server
https://secure.php.net/manual/en/memcache.delete.php
array|false
getStats(string $type = null, int $slabid = null, int $limit = 100)
(PECL memcache >= 0.2.0)
Get statistics of the server
array|false
getExtendedStats(string $type = null, int $slabid = null, int $limit = 100)
(PECL memcache >= 2.0.0)
Get statistics from all servers in pool
bool
setCompressThreshold(int $thresold, float $min_saving = 0.2)
(PECL memcache >= 2.0.0)
Enable automatic compression of large values
int|false
increment(string $key, int $value = 1)
(PECL memcache >= 0.2.0)
Increment item's value
int|false
decrement(string $key, int $value = 1)
(PECL memcache >= 0.2.0)
Decrement item's value
bool
close()
(PECL memcache >= 0.4.0)
Close memcached server connection
bool
flush()
(PECL memcache >= 1.0.0)
Flush all existing items at the server
mixed
pconnect(string $host, int $port, int $timeout = 1)
(PECL memcache >= 0.4.0)
Open memcached server persistent connection