nofw/session-handlers
Composer 安装命令:
composer require nofw/session-handlers
包简介
Package providing various SessionHandlerInterface implementations
README 文档
README
Package providing various SessionHandlerInterface implementations.
Install
Via Composer
$ composer require nofw/session-handlers
Usage
This package provides three Session Handler implementations:
- PSR-6
- PSR-16
- Doctrine Cache
Choose your backend and instantiate and register handler.
$cache = new ImaginaryCacheItemPool(); $handler = new \Nofw\Session\CacheSessionHandler($cache); session_set_save_handler($handler);
Use your session as usual.
Logging
The SessionHandlerInterface does not allow throwing exceptions to indicate failure. Instead it expects the handler to return empty values (empty string or false). However, the PSR-X implementations do throw exceptions. To adhere the interface and to not lose the ability to detect failures, these implementations accept a PSR-3 logger as their second constructor argument and also implement the LoggerAwareInterface.
$cache = new ImaginaryCacheItemPool(); $logger = new Monolog\Logger('nofw') $handler = new \Nofw\Session\CacheSessionHandler($cache, $logger);
The caught exceptions are logged as errors.
Testing
$ make test
Security
If you discover any security related issues, please contact us at mark.sagikazar@gmail.com.
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 24
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 1
其他信息
- 授权协议: MIT
- 更新时间: 2017-04-15