Skip to content
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

[SITE-2632] Update check_client_dependencies to check for Relay #471

Closed
wants to merge 3 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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' ) ) {
jazzsequence marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if ( ! class_exists( WP_REDIS_USE_RELAY ? 'Relay\Relay' : 'Redis' ) ) {
$has_relay = defined( 'WP_REDIS_USE_RELAY' ) && class_exists( 'Relay\Relay' );
if ( ! $has_relay || ! class_exists( 'Redis' ) ) {

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah,I applied this change, but in fact we need to check defined('WP_REDIS_USE_RELAY') && WP_REDIS_USE_RELAY && class_exists( 'Relay\Relay' ), in the event the constant is set and false.

return 'Warning! PHPRedis extension is unavailable, which is required by WP Redis object cache.';
}
return true;
Expand Down
Loading