Example #1
0
 /**
  * add value.
  * @param key             (string)
  * @param value           (string)
  * @param expire time     (int)
  * @return [success|fail] (bool)
  */
 public function add($key, $value, $exptime)
 {
     $result = rmc_add($key, $value, $exptime);
     return $result == RomaClient::STORED ? True : False;
 }
Example #2
0
 /**
  * @brief Add value.(Issue 'add' command).
  * @param key
  * @param value
  * @param exptime Specify the value of expire second.
  * @return Returns True if success.
  */
 public function add($key, $value, $exptime)
 {
     $result = rmc_add($this->client_id, $key, $value, $exptime, $this->default_timeout);
     if (is_null($result) || $result == RomaClient::RMC_RET_EXCEPTION) {
         throw new Exception("rmc_add() failure");
     } else {
         if ($result == RomaClient::RMC_RET_ERROR) {
             return False;
         }
     }
     return True;
 }