Skip to content

Commit

Permalink
Update check_client_dependencies to check for Relay
Browse files Browse the repository at this point in the history
This PR fixes 2 cases where `WP_REDIS_USE_RELAY=true`

- The class is not checked for existence.
- The drop-in will not run if Redis extension is not installed.

The fix:

- Relay\Relay is correctly checked for existence.
- The drop-in still works if the Redis extension is not installed.
  • Loading branch information
EarthlingDavey authored Oct 16, 2024
1 parent 446514b commit cd4b5ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion object-cache.php
Original file line number Diff line number Diff line change
Expand Up @@ -1226,7 +1226,7 @@ protected function _connect_redis() {
* not with a message describing the issue.
*/
public function check_client_dependencies() {
if ( ! class_exists( 'Redis' ) ) {
if ( ! class_exists( WP_REDIS_USE_RELAY ? 'Relay\Relay' : 'Redis' ) ) {
return 'Warning! PHPRedis extension is unavailable, which is required by WP Redis object cache.';
}
return true;
Expand Down

0 comments on commit cd4b5ee

Please sign in to comment.