{"id":13700111,"url":"https://github.com/zhamao-robot/zhamao-framework","last_synced_at":"2026-01-11T13:52:44.437Z","repository":{"id":38238131,"uuid":"126986080","full_name":"zhamao-robot/zhamao-framework","owner":"zhamao-robot","description":"协程、高性能、灵活的聊天机器人 \u0026 Web 开发框架（炸毛框架）","archived":false,"fork":false,"pushed_at":"2025-03-17T06:33:31.000Z","size":12382,"stargazers_count":163,"open_issues_count":8,"forks_count":25,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-04-25T01:03:18.932Z","etag":null,"topics":["bot","chatbot","cmdline","coolq","coroutine","cqhttp","cqhttp-php-sdk","framework","http-server","onebot","php","qqbot","robot","swoole"],"latest_commit_sha":null,"homepage":"https://framework.zhamao.xin","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zhamao-robot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-27T12:54:30.000Z","updated_at":"2025-03-29T04:45:43.000Z","dependencies_parsed_at":"2023-12-23T18:36:52.085Z","dependency_job_id":"59e04410-cdfe-437d-a508-94b1ba9f1100","html_url":"https://github.com/zhamao-robot/zhamao-framework","commit_stats":{"total_commits":1349,"total_committers":17,"mean_commits":79.3529411764706,"dds":"0.39288361749444034","last_synced_commit":"7ba81611f9f196651c4e6c0645213a8b686b92c2"},"previous_names":[],"tags_count":131,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhamao-robot%2Fzhamao-framework","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhamao-robot%2Fzhamao-framework/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhamao-robot%2Fzhamao-framework/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhamao-robot%2Fzhamao-framework/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhamao-robot","download_url":"https://codeload.github.com/zhamao-robot/zhamao-framework/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252382934,"owners_count":21739241,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bot","chatbot","cmdline","coolq","coroutine","cqhttp","cqhttp-php-sdk","framework","http-server","onebot","php","qqbot","robot","swoole"],"created_at":"2024-08-02T20:00:48.714Z","updated_at":"2026-01-11T13:52:44.423Z","avatar_url":"https://github.com/zhamao-robot.png","language":"PHP","funding_links":[],"categories":["Web Applications"],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"https://cdn.jsdelivr.net/gh/zhamao-robot/zhamao-framework/resources/images/logo_trans.png\" width = \"150\" height = \"150\" alt=\"炸毛框架\"\u003e\u003cbr\u003e\n  \u003ch2\u003e炸毛框架\u003c/h2\u003e\n  炸毛框架 (zhamao-framework) 是一个高性能的聊天机器人 + Web 服务器开发框架\u003cbr\u003e\u003cbr\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://onebot.dev/\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/OneBot-12-black?style=flat-square\" alt=\"OneBot\"\u003e\n  \u003c/a\u003e\n\n  \u003ca href=\"https://github.com/zhamao-robot/zhamao-framework/actions\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/zhamao-robot/zhamao-framework/test.yml?branch=v3-develop\u0026label=Test\u0026style=flat-square\" alt=\"Integration Test\"\u003e\n  \u003c/a\u003e\n\n  \u003ca href=\"https://packagist.org/packages/zhamao/framework\"\u003e\n    \u003cimg src=\"https://img.shields.io/packagist/dt/zhamao/framework?label=Downloads\u0026style=flat-square\" alt=\"下载数\"\u003e\n  \u003c/a\u003e\n\n  \u003ca href=\"https://github.com/zhamao-robot/zhamao-framework/releases\"\u003e\n    \u003cimg src=\"https://img.shields.io/packagist/v/zhamao/framework?include_prereleases\u0026label=Release\u0026style=flat-square\" alt=\"最新版本\"\u003e\n  \u003c/a\u003e\n\n  \u003ca href=\"https://github.com/zhamao-robot/zhamao-framework/blob/master/LICENSE\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/license/zhamao-robot/zhamao-framework?label=License\u0026style=flat-square\" alt=\"开源协议\"\u003e\n  \u003c/a\u003e\n\n  \u003ca href=\"https://github.com/zhamao-robot/zhamao-framework/search?q=TODO\"\u003e\n    \u003cimg src=\"https://img.shields.io/github/search/zhamao-robot/zhamao-framework/TODO?label=TODO%20Counter\u0026style=flat-square\" alt=\"TODO\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003c/div\u003e\n\n开发者 QQ 群：**670821194** [点击加入群聊](https://jq.qq.com/?_wv=1027\u0026k=YkNI3AIr)\n\n**如果有愿意一起开发框架本身的开发者，请提出 PR 或 Issue 参与开发！如果对框架本身的核心设计有更好的想法，可与作者成立开发组（目前仅 2 人），参与 OneBot V12 生态和框架本身的开发。**\n\n**相关正在进行的版本任务见 Projects 一栏！**\n\n## 简介\n\n炸毛框架使用 PHP 编写，主要面向 API 服务，聊天机器人，包含 Websocket、HTTP\n等监听和请求库，用户代码采用模块化处理，使用注解可以方便地编写各类功能。\n\n框架主要用途为 HTTP 服务器，机器人搭建框架。尤其对于聊天机器人消息处理较为方便和全面，提供了众多会话机制和内部调用机制，可以以各种方式设计你自己的插件。\n\n```php\n#[\\BotCommand('你好')]\npublic function hello(\\BotContext $ctx) {\n  $ctx-\u003ereply(\"你好，我是炸毛！\"); // 简单的命令式回复\n}\n#[\\Route('/index')]\npublic function index() {\n  return \"\u003ch1\u003ehello!\u003c/h1\u003e\"; // 快速的 HTTP 服务开发\n}\n```\n\n## 开始\n\n框架目前支持 Linux、WSL、macOS、Windows 环境直接运行，其中 Linux、macOS 环境可直接使用下方一键安装脚本。\n\n\u003e 如果你想在其他环境安装部署，可使用 Docker 快速部署或手动安装环境后安装框架，详见文档。\n\n```bash\n# Linux、macOS 下一键检测 PHP 环境、安装框架\nbash \u003c(curl -fsSL https://zhamao.xin/v3.sh)\n\n# 启动框架\ncd zhamao-v3\n./zhamao server\n```\n\n一键安装脚本还有可以自定义参数的方式，比如：\n\n```bash\n# 脚本默认会检测系统的PHP，如果想直接跳过检测，安装独立的PHP版本，则添加此环境变量\nexport ZM_NO_LOCAL_PHP=\"yes\"\n# 脚本如果安装独立版本PHP，默认版本为8.1，如果想使用其他版本，则添加此环境变量指定版本\nexport ZM_DOWN_PHP_VERSION=\"8.2\"\n# 脚本默认会将框架在当前目录下的 `zhamao-app` 目录进行安装，如果想使用其他目录，则添加此环境变量\nexport ZM_CUSTOM_DIR=\"my-custom-app\"\n# 脚本默认会对本项目使用阿里云国内加速镜像，如果想使用packagist源，则添加此环境变量\nexport ZM_COMPOSER_PACKAGIST=\"yes\"\n# 执行完前面的环境变量再执行一键安装脚本，就可以实现自定义参数！\nbash \u003c(curl -fsSL https://zhamao.xin/v3.sh)\n```\n\n关于其他安装方式，请参阅 [文档](https://framework.zhamao.xin/guide/installation.html) 。\n\n## 文档\n\n查看文档（国内自建）：\u003chttps://framework.zhamao.xin/\u003e\n\n备用链接（国外托管）：\u003chttps://framework.zhamao.me/\u003e\n\n## 特点\n\n- 原生支持多个机器人客户端同时连接\n- 灵活的注解事件绑定机制，可同时使用 Annotation 和原生 Attribute 注解\n- 完善的插件系统，可编写插件后打包或分发，供他人使用\n- 采用插件化编写，可自由搭配其他 Composer 组件，也可单文件面向过程编写\n- 支持模块打包、热加载，分享模块更方便\n- 常驻内存，全局缓存变量随处使用，提供多种缓存方案\n- 自带 MySQL、SQLite、Redis 等数据库连接池\n- 本身为 HTTP 服务器、WebSocket 服务器，可以构建属于自己的 HTTP API 接口\n- 可选自带 PHP 环境，无需手动编译安装，by [crazywhalecc/static-php-cli](https://github.com/crazywhalecc/static-php-cli)\n\n## 贡献和捐赠\n\n如果你在使用过程中发现任何问题，可以提交 Issue 或自行 Fork 后修改并提交 Pull Request。\n\n目前项目仅两人维护，耗费精力较大，所以非常欢迎对框架的贡献。\n\n本项目为作者闲暇时间开发，如果觉得好用，不妨进行捐助～你的捐助会让我更加有动力完善插件，感谢你的支持！\n\n我们会将捐赠的资金用于本项目驱动的炸毛机器人和框架文档的服务器开销上。[捐赠列表](https://github.com/zhamao-robot/thanks)\n\n如果您不想直接参与框架的开发，也可以分享你编写的模块，帮助完善框架生态。\n\n### 支付宝\n\n![支付宝二维码](https://cdn.jsdelivr.net/gh/zhamao-robot/zhamao-framework/resources/images/alipay_img.jpg)\n\n## 关于\n\n框架和 SDK 是 炸毛机器人 项目的核心框架开源部分。炸毛机器人是作者写的一个高性能机器人，曾获全国计算机设计大赛一等奖。\n\n作者的炸毛机器人已从2018年初起稳定运行了**七年**，并且持续迭代。\n\n可以提交 [Issue](https://github.com/zhamao-robot/zhamao-framework/issues/new/choose) 或 [加群(670821194)](https://jq.qq.com/?_wv=1027\u0026k=YkNI3AIr) 进行疑难解答。\n\n本项目在更新内容时，请及时关注 GitHub 动态，更新前请将自己的插件或项目代码做好备份。\n\n项目框架采用 Apache-2.0 协议开源，在分发或重写修改等操作时需遵守协议。项目插件部分(除 `src/Globals`、`src/ZM` 文件夹外的其他文件夹) 在非借鉴框架内代码时可不遵守 Apache-2.0 协议进行分发和修改(声明版权)。\n\n**注意**：在你使用 mirai 等 `AGPL-3.0` 协议的机器人软件与框架连接时，使用本框架需要将你编写或修改的部分使用 `AGPL-3.0` 协议重新分发。\n\n在贡献代码时，请保管好自己的全局配置文件中的敏感信息，请勿将带有个人信息的配置文件上传 GitHub 等网站。\n\n感谢 JetBrains 为此开源项目提供 PhpStorm 开发工具支持：\n\n\u003cimg src=\"https://resources.jetbrains.com/storage/products/company/brand/logos/PhpStorm.svg\" width=\"300\"\u003e\n\n感谢开发者 @sunxyw 中为项目开发规范化提出的一些建议。\n\n![star](https://starchart.cc/zhamao-robot/zhamao-framework.svg)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhamao-robot%2Fzhamao-framework","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhamao-robot%2Fzhamao-framework","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhamao-robot%2Fzhamao-framework/lists"}