Files
EasyCloud/Sources/webAduc/www/redis.php
2021-04-02 11:26:26 +02:00

23 lines
647 B
PHP

<?php
include_once("src/config/config.php");
$redis = new Redis();
$redis->connect($Cfg['redishost'], 6379);
/* Without enabling Redis::SCAN_RETRY (default condition) */
$it = NULL;
do {
// Scan for some keys
$arr_keys = $redis->scan($it);
// Redis may return empty results, so protect against that
if ($arr_keys !== FALSE) {
foreach($arr_keys as $str_key) {
echo nl2br("Here is a key: $str_key -- ");
$value = $redis->get($str_key);
echo nl2br($value."\n");
}
}
} while ($it > 0);
echo nl2br("No more keys to scan!\n");
echo nl2br("\n<a href='/index.php'>Accueil</a>\n");