okayinc/stateless-session
最新稳定版本:v0.0.10
Composer 安装命令:
composer require okayinc/stateless-session
包简介
Library that allows Telegram Bots to have short term memory without using database access
README 文档
README
This library that allows Telegram Bots (or any stateless connection) to have short term memory without using database access.
Installation
This project using composer.
$ composer require okayinc/stateless_session
How to Use it?
<?php use OKayInc; $session_id = md5($from_user_id.'@'.$chat_id); // something unique \OKayInc\StatelessSession::start($session_id); // To restart the session (forget the pass) \OKayInc\StatelessSession::reset(); // To get/remember a value in different HTTP sessions. If $index does not exist, $default_value is returned. // $default_value is optional, if omited, NULL is used insted. $setup_step = \OKayInc\StatelessSession::get($index, $default_value); // To set $index to $value \OKayInc\StatelessSession::set($index, $value);
Where:
- setup_step is something you want to remember between HTTP calls
- value is the actual value to remember
统计信息
- 总下载量: 30
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 2
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-3.0-or-later
- 更新时间: 2023-01-21