Skip to content

Commit

Permalink
Fix Relay support in check_client_dependencies (#473)
Browse files Browse the repository at this point in the history
---------

Co-authored-by: EarthlingDavey <15802017+EarthlingDavey@users.noreply.github.com>
Co-authored-by: Chris Reynolds <chris@jazzsequence.com>
  • Loading branch information
3 people authored Dec 9, 2024
1 parent 4ddd127 commit c4e5971
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
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
7 changes: 6 additions & 1 deletion object-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -1226,7 +1226,12 @@ protected function _connect_redis() {
* not with a message describing the issue.
*/
public function check_client_dependencies() {
if ( ! 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 c4e5971

Please sign in to comment.