rhubarbgroup / redis-cache

A persistent object cache backend for WordPress powered by Redis. Supports Predis, PhpRedis, Relay, replication, sentinels, clustering and WP-CLI.
https://wordpress.org/plugins/redis-cache/
GNU General Public License v3.0
428 stars 149 forks source link

Check for WP_REDIS_DISABLED environment variable #548

Closed SpiZeak closed 1 week ago

SpiZeak commented 1 week ago

I am using a .env file in my projects and I would like WP_REDIS_DISABLED=true to disable Redis.

tillkruss commented 1 week ago

You can use:

define('WP_REDIS_DISABLED', getenv('WP_REDIS_DISABLED') ?: false);