klsoft/yii3-cache-session-handler
最新稳定版本:1.0.0
Composer 安装命令:
composer require klsoft/yii3-cache-session-handler
包简介
The package implements the SessionHandlerInterface using the PSR-16 cache for storage
README 文档
README
The package implements the SessionHandlerInterface using the PSR-16 cache for storage.
See also:
- YII3-CACHE-REDIS - The package provides the PSR-16 cache using the Redis PHP extension
Requirement
- PHP 8.1 or higher.
Installation
composer require klsoft/yii3-cache-session-handler
How to use
Configure the SessionInterface.
Example:
use Yiisoft\Session\SessionInterface; use Yiisoft\Session\Session; use Klsoft\Yii3CacheSessionHandler\SessionHandler; use Yiisoft\Cache\CacheInterface; use Yiisoft\Cache\Cache; use Klsoft\Yii3CacheRedis\RedisCache; return [ // ... SessionInterface::class => [ 'class' => Session::class, '__construct()' => [ 'options' => $params['session']['options'] ?? [], 'handler' => new SessionHandler( new RedisCache( new Redis([ 'host' => $params['redisHost'], 'port' => $params['redisPort'], 'database' => $params['redisDatabaseSession'] ]) ) ) ] ], CacheInterface::class => [ 'class' => Cache::class, '__construct()' => [ 'handler' => new RedisCache( new Redis([ 'host' => $params['redisHost'], 'port' => $params['redisPort'], 'database' => $params['redisDatabaseCache'] ]) ) ] ], ];
统计信息
- 总下载量: 0
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 4
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-02-16