Sfoglia il codice sorgente

:bug: 密码非空时调用$redis->auth

visuddhinanda 4 anni fa
parent
commit
b6ba1af322
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  1. 3 1
      public/app/redis/function.php

+ 3 - 1
public/app/redis/function.php

@@ -6,8 +6,10 @@ function redis_connect()
 		//code...
 		$redis = new redis();
 		$r_conn = $redis->connect(Redis["host"], Redis["port"]);
-		$redis->auth(Redis["password"]);
 		if ($r_conn) {
+			if(Redis["password"] !== ""){
+				$redis->auth(Redis["password"]);
+			}		
 			return $redis;
 		} else {
 			return false;