-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle Predis Exception when Database is Out of Bounds. #376
Changes from 3 commits
6946181
f9d43b9
3e41f75
08db871
1dd31f2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -43,7 +43,7 @@ public function __construct() { | |||||
$username = $nginx_helper_admin->options['redis_username']; | ||||||
$password = $nginx_helper_admin->options['redis_password']; | ||||||
|
||||||
if( empty( $nginx_helper_admin->options['redis_unix_socket'] ) ) { | ||||||
if( !empty( $nginx_helper_admin->options['redis_unix_socket'] ) ) { | ||||||
$predis_args['path'] = $nginx_helper_admin->options['redis_unix_socket']; | ||||||
} else { | ||||||
$predis_args['host'] = $nginx_helper_admin->options['redis_hostname'];; | ||||||
|
@@ -60,14 +60,16 @@ public function __construct() { | |||||
|
||||||
try { | ||||||
$this->redis_object->connect(); | ||||||
|
||||||
if( $nginx_helper_admin->options['redis_database'] !== 0 ) { | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
$this->redis_object->select($nginx_helper_admin->options['redis_database']); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
} | ||||||
} catch ( Exception $e ) { | ||||||
$this->log( $e->getMessage(), 'ERROR' ); | ||||||
return; | ||||||
} | ||||||
|
||||||
if( $nginx_helper_admin->options['redis_database'] !== 0 ) { | ||||||
$this->redis_object->select($nginx_helper_admin->options['redis_database']); | ||||||
} | ||||||
|
||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove additional new line. |
||||||
|
||||||
} | ||||||
|
||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.