rapidwebltd/zebra-session-loader
Composer 安装命令:
composer require rapidwebltd/zebra-session-loader
包简介
This library automatically starts Zebra sessions (database powered sessions) wherever vendor/autoload.php is included. It can be useful if you need to add database powered sessions to a bespoke PHP application that lacks an existing framework.
README 文档
README
This library automatically starts Zebra sessions (database powered sessions) wherever vendor/autoload.php is included. It can be useful if you need to add database powered sessions to a bespoke PHP application that lacks an existing framework.
Installation
-
Run
composer require rapidwebltd/zebra-session-loader. -
Create a
session_datatable in your MySQL database to hold session data. You can use the SQL below to do this.
CREATE TABLE `session_data` ( `session_id` varchar(32) NOT NULL default '', `hash` varchar(32) NOT NULL default '', `session_data` blob NOT NULL, `session_expire` int(11) NOT NULL default '0', PRIMARY KEY (`session_id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Configuration
Add the following to your .env file, changing the database connection details to point at the database containing your session_data table.
You should also ensure the security code is changed to a random string.
ZEBRA_SESSION_SECURITY_CODE=random_string_of_chars_og4bf42kh07odgh20gjwe
ZEBRA_SESSION_DATABASE_CONNECTION_NAME=main
DCOM_MAIN_OBJECT_TYPE=mysqli # Must be a mysqli object
DCOM_MAIN_DATABASE_TYPE=mysql
DCOM_MAIN_DATABASE_HOST=localhost
DCOM_MAIN_DATABASE_USERNAME=root
DCOM_MAIN_DATABASE_PASSWORD=password
DCOM_MAIN_DATABASE_NAME=dbname
Now any page that includes vendor/autoload.php will automatically use database powered sessions, provided by Zebra sessions.
rapidwebltd/zebra-session-loader 适用场景与选型建议
rapidwebltd/zebra-session-loader 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 373 次下载、GitHub Stars 达 1, 最近一次更新时间为 2017 年 10 月 10 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 rapidwebltd/zebra-session-loader 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 rapidwebltd/zebra-session-loader 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 373
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: LGPL-3.0-only
- 更新时间: 2017-10-10