Explorar o código

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

joe %!s(int64=4) %!d(string=hai) anos
pai
achega
3b2fe42441
Modificáronse 2 ficheiros con 8 adicións e 1 borrados
  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);
         }
     }