Beispiel #1
0
 /**
  * Sets a new value if a key has a certain value.
  * 
  * Sets a new value if a key has a certain value. This function only works
  * when $old and $new are longs.
  * 
  * @param string $key Key of the value to compare and set.
  * @param int    $old The value to compare the key against.
  * @param int    $new The value to set the key to.
  * 
  * @return bool TRUE on success, FALSE on failure. 
  */
 public function cas($key, $old, $new)
 {
     return wincache_ucache_cas($this->persistentId . $key, $old, $new);
 }
Beispiel #2
0
 /**
  * Store a value in the WinCache object cache, race condition-safe
  *
  * @param int $casToken Cas token
  * @param string $key Cache key
  * @param int $value Object to store
  * @param int $exptime Expiration time
  * @return bool
  */
 public function cas($casToken, $key, $value, $exptime = 0)
 {
     return wincache_ucache_cas($key, $casToken, serialize($value));
 }