Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/erikdubbelboer/phpRedisAdmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Dubbelboer <erik@dubbelboer.com>2014-08-07 05:25:34 +0400
committerErik Dubbelboer <erik@dubbelboer.com>2014-08-07 05:25:34 +0400
commit6c1e10212596b576f142414cf7667616727961ac (patch)
tree4587a7dec64982c3914e8d223e9a4ea843b9ec8d
parentc7d22a1ecd638b80e26e66978410f5943877e958 (diff)
Fix issue #55
-rw-r--r--index.php6
-rw-r--r--view.php4
2 files changed, 4 insertions, 6 deletions
diff --git a/index.php b/index.php
index d142f99..61323f4 100644
--- a/index.php
+++ b/index.php
@@ -71,13 +71,11 @@ if($redis) {
break;
case 'set':
- // This is currently the only way to do this, this can be slow since we need to retrieve all keys
- $len = count($redis->sMembers($fullkey));
+ $len = count($redis->sCard($fullkey));
break;
case 'zset':
- // This is currently the only way to do this, this can be slow since we need to retrieve all keys
- $len = count($redis->zRange($fullkey, 0, -1));
+ $len = count($redis->zCard($fullkey));
break;
}
}
diff --git a/view.php b/view.php
index 8d86371..1fba1a2 100644
--- a/view.php
+++ b/view.php
@@ -76,12 +76,12 @@ switch ($type) {
break;
case 'set':
- $values = $redis->sMembers($_GET['key']);
+ $values = $redis->sCard($_GET['key']);
$size = count($values);
break;
case 'zset':
- $values = $redis->zRange($_GET['key'], 0, -1);
+ $values = $redis->zCard($_GET['key']);
$size = count($values);
break;
}