dxw / session-handler-redis
Installs: 1 156
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 13
Forks: 0
Open Issues: 0
Requires
- php: ^7.4||^8.1
- predis/predis: ^1.1
Requires (Dev)
- dxw/php-cs-fixer-config: ^2.0
- kahlan/kahlan: ^5.2
- vimeo/psalm: ^5.14
This package is auto-updated.
Last update: 2024-12-09 12:13:49 UTC
README
This package allows you to replace PHP's default session handling with a Redis-based alternative.
How to use
- Require this package in your project:
composer require dxw/session-handler-redis
- Before you start your session, configure your Predis client, pass it to the Handler class, and call
session_set_handler()
with that Handler, e.g.$client = new \Predis\Client([ 'scheme' => 'tcp', 'host' => 'redis', 'port' => 6379, ]); session_set_save_handler(new \SessionHandlerRedis\Handler($client));
- Then call
session_start()
when needed
Development
This package implements the script-to-rule-them-all pattern.
script/update
to install the dependencies
script/test
to run the tests