Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function set(Counter $counter)
 {
     apc_store($this->prefix . '/' . $counter->getName(), $counter->getValue());
     return $counter;
 }
Ejemplo n.º 2
0
 /**
  * {@inheritdoc}
  */
 public function set(Counter $counter)
 {
     $this->getCollection()->add($this->prefix . '.' . $counter->getName(), $counter->getValue());
     return $counter;
 }
Ejemplo n.º 3
0
 /**
  * {@inheritdoc}
  */
 public function set(Counter $counter)
 {
     $this->getClient()->set($counter->getName(), $counter->getValue());
     return $counter;
 }
Ejemplo n.º 4
0
 /**
  * {@inheritdoc}
  */
 public function set(Counter $counter)
 {
     $result = $this->getCollection()->findAndModify(array('counter' => $counter->getName()), array('$setOnInsert' => array('value' => $counter->getValue())), array(), array('upsert' => true, 'new' => true));
     return Counter::create($counter->getName(), $result['value']);
 }