friendsofhyperf / session-handler
This package is abandoned and no longer maintained.
No replacement package was suggested.
Session handler for Hyperf
dev-main
2021-06-25 09:37 UTC
Requires
- hyperf/di: ^2.0
- hyperf/session: ^2.0
Requires (Dev)
- easyswoole/memcache: dev-master
- friendsofphp/php-cs-fixer: ^3.0
- huizhang/memcache: dev-main
- hyperf/framework: ^2.0
- phpstan/phpstan: ^0.12
- swoole/ide-helper: dev-master
Suggests
- easyswoole/memcache: Required to use MemcachedHandler.
- huizhang/memcache: Required to use MemcacheHandler.
This package is auto-updated.
Last update: 2022-12-25 13:00:26 UTC
README
Installation
composer require friendsofhyperf/session-handler
- memcache
composer require huizhang/memcache
- memcached
composer require easyswoole/memcache
Configure
- Singleton
// config/session.php return [ 'handler' => FriendsOfHyperf\SessionHandler\Handler\MemcacheHandler::class, // or 'handler' => FriendsOfHyperf\SessionHandler\Handler\MemcachedHandler::class, 'options' => [ // tcp://host:port 'path' => 'tcp://127.0.0.1:11211', // or // [host, port] 'path' => ['127.0.0.1', 11211], 'gc_maxlifetime' => 1200, 'session_name' => 'HYPERF_SESSION_ID', 'domain' => null, 'cookie_lifetime' => 5 * 60 * 60, ], ];
- Cluster
// config/session.php return [ 'handler' => FriendsOfHyperf\SessionHandler\Handler\MemcacheHandler::class, // or 'handler' => FriendsOfHyperf\SessionHandler\Handler\MemcachedHandler::class, 'options' => [ 'cluster' => true, 'path' => [ // [host, port, weight] ['127.0.0.1', 11211, 1], ['127.0.0.1', 11212, 1], ], // or // ['tcp://host:port#weight'] 'path' => [ 'tcp://127.0.0.1:11211#1', 'tcp://127.0.0.1:11212#1', ], 'gc_maxlifetime' => 1200, 'session_name' => 'HYPERF_SESSION_ID', 'domain' => null, 'cookie_lifetime' => 5 * 60 * 60, ], ];
Support drivers
- Memcache
- Memcached