Intermédiaire
This commit is contained in:
23
Sources/webAduc/www/redis.php
Normal file
23
Sources/webAduc/www/redis.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?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");
|
||||
Reference in New Issue
Block a user