Skip to content

Commit 42b7b89

Browse files
committed
FMAINT-326 explicitly require the string true in order for REDIS_SESSION_STORAGE to be applied
1 parent 32b6604 commit 42b7b89

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

README.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# wp-env-heroku-redis
2+
3+
Expose Heroku redis addon configuration to WordPress.
4+
5+
Accepted env keys:
6+
7+
- REDIS_URL: If you are using heroku-redis addon
8+
- REDISCLOUD_URL: If you are using rediscloud addon
9+
- REDIS_SESSION_STORAGE: Set to "true" (without quotes) if you want PHP sessions to be persisted in Redis storage, instead of PHP's default of using machine's temporary directory. This is useful when you need to persist sessions across multiple dynos.
10+
11+
## Incompatible changes from 1.0.0
12+
13+
In v2.0.0, `REDIS_SESSION_STORAGE` explicitly needs to be set to the string "true" instead of a truthy value.

src/Redis.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
define('WP_REDIS_PORT', trim( $url['port'] ));
1010
define('WP_REDIS_PASSWORD', trim( $url['pass'] ));
1111

12-
if (getenv('REDIS_SESSION_STORAGE')) {
12+
if (getenv('REDIS_SESSION_STORAGE') && getenv('REDIS_SESSION_STORAGE') === 'true') {
1313
ini_set('session.save_handler','redis');
1414
ini_set('session.save_path',"tcp://$url[host]:$url[port]?auth=$url[pass]");
1515
}

0 commit comments

Comments
 (0)