File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ public function __construct() {
4343 $ username = $ nginx_helper_admin ->options ['redis_username ' ];
4444 $ password = $ nginx_helper_admin ->options ['redis_password ' ];
4545
46- if ( empty ( $ nginx_helper_admin ->options ['redis_unix_socket ' ] ) ) {
46+ if ( ! empty ( $ nginx_helper_admin ->options ['redis_unix_socket ' ] ) ) {
4747 $ predis_args ['path ' ] = $ nginx_helper_admin ->options ['redis_unix_socket ' ];
4848 } else {
4949 $ predis_args ['host ' ] = $ nginx_helper_admin ->options ['redis_hostname ' ];;
@@ -60,14 +60,15 @@ public function __construct() {
6060
6161 try {
6262 $ this ->redis_object ->connect ();
63+
64+ if ( 0 !== $ nginx_helper_admin ->options ['redis_database ' ] ) {
65+ $ this ->redis_object ->select ( $ nginx_helper_admin ->options ['redis_database ' ] );
66+ }
6367 } catch ( Exception $ e ) {
6468 $ this ->log ( $ e ->getMessage (), 'ERROR ' );
6569 return ;
6670 }
6771
68- if ( $ nginx_helper_admin ->options ['redis_database ' ] !== 0 ) {
69- $ this ->redis_object ->select ($ nginx_helper_admin ->options ['redis_database ' ]);
70- }
7172
7273 }
7374
You can’t perform that action at this time.
0 commit comments