Key
This line was removed.
This word was removed. This word was added.
This line was added.

Changes (24)

View Page History
* class *ZendServerShm* extends AbstractZendServer
* class *ZendServerDisk* extends AbstractZendServer
* class *SysvShm* extends AbstractZendServer

*Storage Plugins:*
{code}
// set an item (replace or add)
$cache->setItem($value, $key);

// replace an existing item
$cache->replaceItem($value, $key);

// add a new item
$cache->addItem($value, $key);

// get item value
$cache->getItem($key);

// check existence
$cache->exists($key); $cache->hasItem($key);

// get additional item information (like mtime, atime, ctime, ...)
$cache->info($key); $cache->getMetadata($key);

// remove an item
$cache->removeItem($key);
{code}
{card}
{card:label=Increment/Decrement}
{code}
$cache->setItem(10, 'counter');

// increment
$cache->incrementItem(5, 'counter');
$cache->getItem('counter'); // -> 15

// decrement
$cache->decrementItem(9, 'counter');
$cache->getItem('counter'); // -> 6
{code}
{card}
// get value and CAS-token
$token = null;
$cache->getItem('key', array('token' => &$token)); // !! set $token as reference !!
// set a new value using CAS
$cache->cas($token, $cache->checkAndSetItem($token, 'newValue', 'key');
{code}
{card}
{code}
// the most simple methods have a additional multiple brother
$cache->setMulti(array('key1' $cache->setItems(array('key1' => 'value1', 'key2' => 'value2'));
$cache->replaceMulti(array('key1' $cache->replaceItems(array('key1' => 'value1', 'key2' => 'value2'));
$cache->addMulti(array('key1' $cache->addItems(array('key1' => 'value1', 'key2' => 'value2'));

$cache->incrementMulti(array('key1' $cache->incrementItems(array('key1' => 'value1', 'key2' => 'value2'));
$cache->decrementMulti(array('key1' $cache->decrementItems(array('key1' => 'value1', 'key2' => 'value2'));

$cache->getMulti(array('key1', $cache->getItems(array('key1', 'key2'));
$cache->existsMulti(array('key1', $cache->hasItems(array('key1', 'key2'));
$cache->infoMulti(array('key1', $cache->getMetadatas(array('key1', 'key2'));

$cache->removeMulti(array('key1', $cache->removeItems(array('key1', 'key2'));
{code}
{card}