yii2 获取redis缓存信息

//获取redis 缓存个数
$cache = Yii::$app->cache->redis;
$size = $cache->executeCommand('DBSIZE');

//根据key获取redis值
$key = '*';
if($name = trim($_GET['name'])) {
    $key = $name . $key;
}
$data = $cache->keys($key);

其他参数位置,请参考文件:/vendor/yiisoft/yii2-redis/src/Connection.php

public $redisCommands = [

 

你可能感兴趣的:(php,redis,yii2)