Skip to content

Commit

Permalink
support for saving PHP sessions from redis
Browse files Browse the repository at this point in the history
  • Loading branch information
josepfrantic committed Feb 8, 2017
1 parent 123bc3b commit 32b6604
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Redis.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,9 @@
define('WP_REDIS_HOST', trim( $url['host'] ));
define('WP_REDIS_PORT', trim( $url['port'] ));
define('WP_REDIS_PASSWORD', trim( $url['pass'] ));

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

0 comments on commit 32b6604

Please sign in to comment.