Zend Framework
3.0
|
This is a resource manager for memcached. More...
Public Member Functions | |
getServers ($id) | |
Get servers. | |
hasResource ($id) | |
Check if a resource exists. | |
getResource ($id) | |
Gets a memcached resource. | |
setResource ($id, $resource) | |
Set a resource. | |
removeResource ($id) | |
Remove a resource. | |
setPersistentId ($id, $persistentId) | |
Set the persistent id. | |
getPersistentId ($id) | |
Get the persistent id. | |
setLibOptions ($id, array $libOptions) | |
Set Libmemcached options. | |
getLibOptions ($id) | |
Get Libmemcached options. | |
setLibOption ($id, $key, $value) | |
Set one Libmemcached option. | |
getLibOption ($id, $key) | |
Get one Libmemcached option. | |
setServers ($id, $servers) | |
Set servers. | |
addServers ($id, $servers) | |
Add servers. | |
addServer ($id, $server) | |
Add one server. | |
Protected Member Functions | |
normalizeServer (&$server) | |
Normalize one server into the following format: array('host' => <host>, 'port' => <port>, 'weight' => <weight>) | |
normalizePersistentId (&$persistentId) | |
Normalize the persistent id. | |
normalizeLibOptions (&$libOptions) | |
Normalize libmemcached options. | |
normalizeLibOptionKey (&$key) | |
Convert option name into it's constant value. | |
normalizeServers (&$servers) | |
Normalize a list of servers into the following format: array(array('host' => <host>, 'port' => <port>, 'weight' => <weight>)[, ...]) | |
compareServers (array $serverA, array $serverB) | |
Compare 2 normalized server arrays (Compares only the host and the port) | |
Protected Attributes | |
$resources = [] | |
This is a resource manager for memcached.
addServer | ( | $id, | |
$server | |||
) |
addServers | ( | $id, | |
$servers | |||
) |
|
protected |
Compare 2 normalized server arrays (Compares only the host and the port)
array | $serverA | |
array | $serverB |
getLibOption | ( | $id, | |
$key | |||
) |
Get one Libmemcached option.
string | $id | |
string | int | $key |
Exception\RuntimeException |
getLibOptions | ( | $id | ) |
Get Libmemcached options.
string | $id |
Exception\RuntimeException |
getPersistentId | ( | $id | ) |
Get the persistent id.
string | $id |
Exception\RuntimeException |
getResource | ( | $id | ) |
Gets a memcached resource.
string | $id |
Exception\RuntimeException |
getServers | ( | $id | ) |
Get servers.
string | $id |
Exception\RuntimeException |
hasResource | ( | $id | ) |
Check if a resource exists.
string | $id |
|
protected |
Convert option name into it's constant value.
string | int | $key |
Exception\InvalidArgumentException |
|
protected |
Normalize libmemcached options.
array | Traversable | $libOptions |
Exception\InvalidArgumentException |
|
protected |
Normalize the persistent id.
string | $persistentId |
|
protected |
Normalize one server into the following format: array('host' => <host>, 'port' => <port>, 'weight' => <weight>)
string | array | &$server |
Exception\InvalidArgumentException |
|
protected |
Normalize a list of servers into the following format: array(array('host' => <host>, 'port' => <port>, 'weight' => <weight>)[, ...])
string | array | $servers |
removeResource | ( | $id | ) |
setLibOption | ( | $id, | |
$key, | |||
$value | |||
) |
Set one Libmemcached option.
string | $id | |
string | int | $key | |
mixed | $value |
setLibOptions | ( | $id, | |
array | $libOptions | ||
) |
Set Libmemcached options.
string | $id | |
array | $libOptions |
setPersistentId | ( | $id, | |
$persistentId | |||
) |
Set the persistent id.
string | $id | |
string | $persistentId |
Exception\RuntimeException |
setResource | ( | $id, | |
$resource | |||
) |
Set a resource.
string | $id | |
array | Traversable | MemcachedResource | $resource |
setServers | ( | $id, | |
$servers | |||
) |
Set servers.
$servers can be an array list or a comma separated list of servers. One server in the list can be descripted as follows:
string | $id | |
string | array | $servers |
|
protected |