vakata/session
最新稳定版本:4.1.1
Composer 安装命令:
composer require vakata/session
包简介
A simple key-value storage class
README 文档
README
A simple key-value storage class. used for configurations and extended in vakata/session.
Install
Via Composer
$ composer require vakata/session
Usage
Using the $_SESSION superglobal is perfectly fine and works well with this class.
$session = new \vakata\session\Session(); // autostarts session and applies useful defaults $session->get('value'); // same as $_SESSION['value']; $session->set('val.ue', 2); // same as $_SESSION['val'] = [ 'ue' => 1 ]; $session->del('value'); // same as unset($_SESSION['value']); // optionally sessions can be stored in a database $sessionDB = new \vakata\session\Session( true, // autostart new \vakata\sessions\handler\SessionDatabase( new \vakata\database\DB('mysqli://user:pass@host/database'), 'table' ) ); // optionally sessions can be stored in memcached / filecache / database $sessionDB = new \vakata\session\Session( true, // autostart new \vakata\sessions\handler\SessionCache( new \vakata\cache\Memcache(), 'namespace' // this allows easy clearing ) );
For more on setting, getting and deleting values read here: https://github.com/vakata/kvstore
For more on the database class read here: https://github.com/vakata/database
For more on the memcached class read here: https://github.com/vakata/cache
Testing
$ composer test
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email github@vakata.com instead of using the issue tracker.
Credits
License
The MIT License (MIT). Please see License File for more information.
统计信息
- 总下载量: 5.61k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2015-12-04