瀏覽代碼

fix: 以 cache 的方式启用 redis, 并修改一个 bug

joe 4 年之前
父節點
當前提交
3b2fe42441
共有 2 個文件被更改,包括 8 次插入1 次删除
  1. 7 0
      config/cache.php
  2. 1 1
      crmeb/utils/Redis.php

+ 7 - 0
config/cache.php

@@ -35,6 +35,13 @@ return [
             'serialize'  => [],
         ],
         // 更多的缓存连接
+        'redis' => [
+            'type' => 'redis',
+            'host' => '127.0.0.1',
+            'port' => '6379',
+            'password' => '123456',
+            'select' => 1,
+        ],
     ],
 ];
 //crmeb

+ 1 - 1
crmeb/utils/Redis.php

@@ -139,7 +139,7 @@ class Redis
      */
     public static function __callStatic($name, $arguments)
     {
-        if (method_exists($instance->redis, $name)) {
+        if (method_exists(self::$instance->redis, $name)) {
             return self::instance()->redis->{$name}(...$arguments);
         }
     }