/**
  * @param Extension $extension
  */
 public function remove(Extension $extension)
 {
     $id = $extension->getName();
     $this->redisClient->hdel(self::EXTENSION2USER_HASH_STORE, $id);
     $this->redisClient->hdel(self::EXTENSION_HASH_STORE, $id);
     $this->redisClient->hdel(self::EXTENSIONMETA_HASH_STORE, $id);
 }
Example #2
0
});
$app->get('/messages/:id', function ($id) use($predis, $app) {
    $data = $predis->hget(BULK_HASH, $id);
    if (!$data) {
        $app->response->setStatus(404);
        return;
    }
    $result = json_decode($data, true);
    $result['id'] = $id;
    $app->response->headers->set('Content-Type', 'application/json');
    $app->response->setStatus(200);
    echo json_encode($result);
});
$app->delete('/messages/:id', function ($id) use($predis, $app) {
    $data = $predis->hget(BULK_HASH, $id);
    if (!$data) {
        $app->response->setStatus(404);
        return;
    }
    $predis->hdel(BULK_HASH, $id);
    $app->response->setStatus(204);
});
$app->delete('/messages', function () use($predis, $app) {
    $data = $predis->hgetall(BULK_HASH);
    foreach ($data as $id => $message) {
        $predis->hdel(BULK_HASH, $id);
    }
    $app->response->headers->set('Content-Type', 'application/json');
    $app->response->setStatus(204);
});
$app->run();
 /**
  * Deletes the provided session key.
  *
  * @param  string $id   A session ID
  *
  * @return bool   true, if the session data was deleted
  */
 public function remove($key)
 {
     return $this->db->hdel($this->getHashKey(), $key);
 }
Example #4
0
 /**
  * {@inheritdoc}
  */
 public function remove(string $alias) : StorageInterface
 {
     $this->redis->hdel($this->prefix, [$alias]);
     return $this;
 }
Example #5
0
 public function resetRate($key)
 {
     $this->client->hdel($key);
     return true;
 }