Skip to content

Commit

Permalink
FMAINT-326 explicitly require the string true in order for REDIS_SESS…
Browse files Browse the repository at this point in the history
…ION_STORAGE to be applied
  • Loading branch information
josepfrantic committed Aug 8, 2017
1 parent 32b6604 commit 42b7b89
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# wp-env-heroku-redis

Expose Heroku redis addon configuration to WordPress.

Accepted env keys:

- REDIS_URL: If you are using heroku-redis addon
- REDISCLOUD_URL: If you are using rediscloud addon
- 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.

## Incompatible changes from 1.0.0

In v2.0.0, `REDIS_SESSION_STORAGE` explicitly needs to be set to the string "true" instead of a truthy value.
2 changes: 1 addition & 1 deletion src/Redis.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
define('WP_REDIS_PORT', trim( $url['port'] ));
define('WP_REDIS_PASSWORD', trim( $url['pass'] ));

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

0 comments on commit 42b7b89

Please sign in to comment.