diff --git a/.devilbox/www/htdocs/db_redis.php b/.devilbox/www/htdocs/db_redis.php
index 18ffab4e..5c07cf92 100644
--- a/.devilbox/www/htdocs/db_redis.php
+++ b/.devilbox/www/htdocs/db_redis.php
@@ -24,16 +24,26 @@
+ DB |
Key |
Value |
- getKeys() as $key => $value): ?>
-
- |
- |
+ getKeys() as $db_name => $keys): ?>
+
+
+
+ |
+ $val): ?>
+
+ |
+ |
+
|
+
+
+
diff --git a/.devilbox/www/include/lib/container/Redis.php b/.devilbox/www/include/lib/container/Redis.php
index 078bd322..e2f142b5 100644
--- a/.devilbox/www/include/lib/container/Redis.php
+++ b/.devilbox/www/include/lib/container/Redis.php
@@ -80,13 +80,29 @@ class Redis extends BaseClass implements BaseInterface
}
}
+ public function getDatabases()
+ {
+ $databases = array();
+
+ foreach ($this->getInfo() as $key => $val) {
+ if (preg_match('/db[0-9]+/', $key)) {
+ $databases[] = str_replace('db', '', $key);
+ }
+ }
+ return ($databases);
+ }
+
public function getKeys()
{
$store = array();
if ($this->_redis) {
- $keys = $this->_redis->keys('*');
- foreach ($keys as $key) {
- $store[$key] = $this->_redis->get($key);
+ $databases = $this->getDatabases();
+ foreach ($databases as $db) {
+ $this->_redis->select($db);
+ $keys = $this->_redis->keys('*');
+ foreach ($keys as $key) {
+ $store[$db][$key] = $this->_redis->get($key);
+ }
}
}
return $store;