Beispiel #1
0
 /**
  * @param $query
  *
  * @return bool
  */
 protected function _destroyCache($query)
 {
     $this->_cacheSetConnection();
     if (isset($this->cache_con) && !empty($this->cache_con)) {
         return $this->cache_con->delete($query);
     }
     return false;
 }
Beispiel #2
0
 public static function zsetAddAndReturn(Predis\Client $client, $keyName, array $values, $wipeOut = 0)
 {
     // $values: array(SCORE => VALUE, ...);
     if ($wipeOut == true) {
         $client->delete($keyName);
     }
     foreach ($values as $value => $score) {
         $client->zsetAdd($keyName, $score, $value);
     }
     return $values;
 }