shish il y a 2 ans
Parent
commit
8436abc409
1 fichiers modifiés avec 10 ajouts et 1 suppressions
  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()
     public function actionOn()
     {
     {
+        echo "<pre>";
         $cacheKey = 'test';
         $cacheKey = 'test';
         Yii::$app->redis->executeCommand('HSET', [$cacheKey, 'shish', 1]);
         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]);
         Yii::$app->redis->executeCommand('HSET', [$cacheKey, 'sofashi', 2]);
 
 
@@ -50,6 +54,11 @@ class TestController extends BaseController
 
 
         $arr = Yii::$app->redis->executeCommand('HKEYS', [$cacheKey]);
         $arr = Yii::$app->redis->executeCommand('HKEYS', [$cacheKey]);
         print_r($arr);
         print_r($arr);
+
+        Yii::$app->redis->executeCommand('HDEL', [$cacheKey, 'lgl']);
+
+        $arr = Yii::$app->redis->executeCommand('HKEYS', [$cacheKey]);
+        print_r($arr);
     }
     }
 
 
     public function actionIn()
     public function actionIn()