-
Notifications
You must be signed in to change notification settings - Fork 70
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
Exit the script early if the class doesn't exist, or it's been manually disabled. #468
base: main
Are you sure you want to change the base?
Conversation
* re-add missing else * use the already-defined value of $port instead of hard-coding * remove ternary in favor of elseif
…er issues (pantheon-systems#434) * fix: Fixes incorrect order of array_replace_recursive arguments & other issues * Fixes pantheon-systems#433 * Fixes pantheon-systems#432 * Fixes pantheon-systems#431 * Further clean-up & standardization between object-cache.php & wp-redis.php. * Fixes incorrect order of array_replace_recursive arguments. * Addresses issue with port still not being null for socket connections due to defaults array_repalce_recursive use. * fix: Fixes sanitization methods and linting issues * Adjusts some items to use type-based sanitization. * Adds linting expection handling with comments for cases that require it. * fix: Removes invalid change made in pantheon-systems#437 * Reverts this incorrect change that was made due to the incorrect use of `array_replace_recursive()`. * update changelog * Update wp-redis.php * update language in changelogs * fix missing closing ) --------- Co-authored-by: Chris Reynolds <[email protected]> Co-authored-by: Phil Tyler <[email protected]>
* Bump behat/behat from 3.13.0 to 3.14.0 Bumps [behat/behat](https://github.com/Behat/Behat) from 3.13.0 to 3.14.0. - [Release notes](https://github.com/Behat/Behat/releases) - [Changelog](https://github.com/Behat/Behat/blob/master/CHANGELOG.md) - [Commits](Behat/Behat@v3.13.0...v3.14.0) --- updated-dependencies: - dependency-name: behat/behat dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <[email protected]> * Upgrade yoast/phpunit-polyfills to 1.1.0 --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Phil Tyler <[email protected]>
5af0f99
to
880f667
Compare
Cleaned up the PR & merge conflicts |
} | ||
|
||
// Conditionally run the script if: the correct class exists, and the script has not been disabled. | ||
if ( ! class_exists( WP_REDIS_USE_RELAY ? 'Relay\Relay' : 'Redis' ) && ( defined( 'WP_REDIS_DISABLED' ) && WP_REDIS_DISABLED ) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this have an || in the middle?
if ( ! class_exists( WP_REDIS_USE_RELAY ? 'Relay\Relay' : 'Redis' ) || ( defined( 'WP_REDIS_DISABLED' ) && WP_REDIS_DISABLED ) ) {
In other words, if the class doesn't exist or WP Redis is disabled, then return.
A PR for your consideration:
There may be cases where the correct Redis class does not exist, this case will be handled gracefully.
Or there may be a case where the script needs to be disabled quickly without re-deployment, the ENV VAR
WP_REDIS_DISABLED
can be used for this case.