소스 검색

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

visuddhinanda 4 년 전
부모
커밋
b6ba1af322
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  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;