shish 2 лет назад
Родитель
Сommit
8436abc409
1 измененных файлов с 10 добавлено и 1 удалено
  1. 10 1
      app-ghs/controllers/TestController.php

+ 10 - 1
app-ghs/controllers/TestController.php

@@ -40,9 +40,13 @@ class TestController extends BaseController
 
     public function actionOn()
     {
+        echo "<pre>";
         $cacheKey = 'test';
         Yii::$app->redis->executeCommand('HSET', [$cacheKey, 'shish', 1]);
-        echo Yii::$app->redis->executeCommand('HGET', [$cacheKey,'shish']);
+        echo Yii::$app->redis->executeCommand('HGET', [$cacheKey, 'shish']);
+
+        $return = Yii::$app->redis->executeCommand('HEXISTS', [$cacheKey, 'shish']);
+        var_dump($return);
 
         Yii::$app->redis->executeCommand('HSET', [$cacheKey, 'sofashi', 2]);
 
@@ -50,6 +54,11 @@ class TestController extends BaseController
 
         $arr = Yii::$app->redis->executeCommand('HKEYS', [$cacheKey]);
         print_r($arr);
+
+        Yii::$app->redis->executeCommand('HDEL', [$cacheKey, 'lgl']);
+
+        $arr = Yii::$app->redis->executeCommand('HKEYS', [$cacheKey]);
+        print_r($arr);
     }
 
     public function actionIn()