Skip to content

Commit

Permalink
Check WP_REDIS_USE_RELAY is true too
Browse files Browse the repository at this point in the history
  • Loading branch information
pwtyler committed Dec 6, 2024
1 parent a3281f8 commit 2d838be
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ There's a known issue with WordPress `alloptions` cache design. Specifically, a
## Changelog ##

### 1.4.5-dev ###
* Support Relay in `check_client_dependencies()` correctly [[#471](https://github.com/pantheon-systems/wp-redis/pull/471)] (props @EarthlingDavey)

### 1.4.4 (November 27, 2023) ###
* Updates Pantheon WP Coding Standards to 2.0 [[#445](https://github.com/pantheon-systems/wp-redis/pull/445)]
Expand Down
8 changes: 6 additions & 2 deletions object-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -1226,8 +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' ) && class_exists( 'Relay\Relay' );
if ( ! $has_relay || ! class_exists( 'Redis' ) ) {
$class_to_check = 'Redis';
if ( defined( 'WP_REDIS_USE_RELAY' ) && WP_REDIS_USE_RELAY ) {
$class_to_check = 'Relay\Relay';
}

if ( ! class_exists( $class_to_check ) ) {
return 'Warning! PHPRedis extension is unavailable, which is required by WP Redis object cache.';
}
return true;
Expand Down
1 change: 1 addition & 0 deletions readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ Please report security bugs found in the source code of the WP Redis plugin thro
== Changelog ==

= 1.4.5-dev =
* Support Relay in check_client_dependencies() with the WP_REDIS_USE_RELAY constant [[#471](https://github.com/pantheon-systems/wp-redis/pull/471)]

= 1.4.4 (November 27, 2023) =
* Updates Pantheon WP Coding Standards to 2.0 [[#445](https://github.com/pantheon-systems/wp-redis/pull/445)]
Expand Down

0 comments on commit 2d838be

Please sign in to comment.