Skip to content

Commit

Permalink
Check one or the other not both
Browse files Browse the repository at this point in the history
  • Loading branch information
pwtyler committed Dec 6, 2024
1 parent 66189b3 commit 9d9f0b3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions object-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -1226,9 +1226,12 @@ protected function _connect_redis() {
* not with a message describing the issue.
*/
public function check_client_dependencies() {
$has_relay = defined( 'WP_REDIS_USE_RELAY' ) && WP_REDIS_USE_RELAY && class_exists( 'Relay\Relay' );
$class_to_check = 'Redis';
if (defined( 'WP_REDIS_USE_RELAY' ) && WP_REDIS_USE_RELAY ) {
$class_to_check = 'Relay\Relay';
}

if ( ! $has_relay || ! class_exists( 'Redis' ) ) {
if ( ! class_exists( $class_to_check ) ) {
return 'Warning! PHPRedis extension is unavailable, which is required by WP Redis object cache.';
}
return true;
Expand Down

0 comments on commit 9d9f0b3

Please sign in to comment.