diff --git a/composer.json b/composer.json index 0373fe34..e6d7e182 100644 --- a/composer.json +++ b/composer.json @@ -13,14 +13,14 @@ } ], "require": { - "php": "^8.0 || ^8.1", + "php": "^8.0 || ^8.1 || ^8.2", "ext-json": "*", "ext-tokenizer": "*", "doctrine/dbal": "^2.13.1", "dragonmantank/cron-expression": "^3.3", "jelix/version": "^2.0", "koriym/attributes": "^1.0", - "onebot/libonebot": "dev-develop", + "onebot/libonebot": "^0.5", "php-di/php-di": "^7", "psr/container": "^2.0", "psy/psysh": "^0.11.8", diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js index c5dd3dc1..7fea3620 100644 --- a/docs/.vuepress/config.js +++ b/docs/.vuepress/config.js @@ -1,5 +1,5 @@ module.exports = { - title: '炸毛框架', + title: '炸毛框架 v3', description: '一个高性能聊天机器人 + Web 框架', theme: 'antdocs', markdown: { @@ -26,8 +26,8 @@ module.exports = { activeHeaderLinks: false, nav: [ { text: '指南', link: '/guide/' }, - { text: 'API', link: '/doxy/', target: '_blank' }, - { text: '炸毛框架 v1', link: 'https://docs-v1.zhamao.xin/' } + { text: 'API 文档', link: '/doxy/', target: '_blank' }, + { text: '炸毛框架 v2', link: 'https://docs-v2.zhamao.xin/' } ], sidebar: { '/guide/': [ diff --git a/docs/guide/README.md b/docs/guide/README.md index 77528412..d03ded72 100644 --- a/docs/guide/README.md +++ b/docs/guide/README.md @@ -25,6 +25,5 @@ - WebSocket 服务器、HTTP 服务器兼容运行,一个框架多个用处 - 支持命令、自然语言处理等多种插件形式 - 支持多个机器人账号负载均衡 -- 协程 + TaskWorker 进程重度任务处理机制,保证高效,单个请求响应时间为 0.1 ms 左右 - 模块分离和自由组合,可根据自身需求自己建立模块内的目录结构和代码结构 - 灵活的注释和注解注册事件方式,支持 PHP 原生注解,提示更为友好 diff --git a/docs/guide/installation.md b/docs/guide/installation.md index 7e367608..6e0a3527 100644 --- a/docs/guide/installation.md +++ b/docs/guide/installation.md @@ -13,8 +13,8 @@ 如果检测到本机未安装 PHP 或不符合运行要求,脚本将会自动拉取提前编译好的静态 PHP 运行时。 ```shell -# 将静态 PHP 和框架安装在当前目录 -bash <(curl -fsSL https://zhamao.xin/go.sh) +# 将静态 PHP 和框架安装在当前目录(适用于 Linux、macOS) +bash <(curl -fsSL https://zhamao.xin/v3.sh) # 安装完成后启动 ./zhamao server @@ -41,6 +41,12 @@ composer require zhamao/framework ./zhamao server ``` +## Windows 安装方法 + +由于 Windows 系统下的 PHP 环境配置较为复杂,我们推荐使用 Docker 或一键脚本来进行安装。 + +如果你打算在 Windows 使用原生的 Win 环境 PHP,你需要先安装 PHP 和 Composer,然后在任意目录下执行上方 composer 的安装方法即可。 + ## 更多的环境部署和开发方式 除了上述方式之外,框架还支持源码模式、守护进程等运行方式,详情请参阅 [进阶开发]。 diff --git a/src/ZM/Context/BotContext.php b/src/ZM/Context/BotContext.php index 3502dbd7..023460b2 100644 --- a/src/ZM/Context/BotContext.php +++ b/src/ZM/Context/BotContext.php @@ -145,7 +145,8 @@ class BotContext implements ContextInterface self::$echo_id_list[$a->echo] = $a; // 调用事件在回复之前的回调 $handler = new AnnotationHandler(BotAction::class); - $handler->setRuleCallback(fn (BotAction $act) => $act->action === $action && !$act->need_response); + container()->set(Action::class, $a); + $handler->setRuleCallback(fn (BotAction $act) => $act->action === '' || $act->action === $action && !$act->need_response); $handler->handleAll($a); // 被阻断时候,就不发送了 if ($handler->getStatus() === AnnotationHandler::STATUS_INTERRUPTED) { diff --git a/src/ZM/Framework.php b/src/ZM/Framework.php index 4ac46d25..1b3dd8bf 100644 --- a/src/ZM/Framework.php +++ b/src/ZM/Framework.php @@ -46,7 +46,7 @@ class Framework public const VERSION_ID = 646; /** @var string 版本名称 */ - public const VERSION = '3.0.0-beta1'; + public const VERSION = '3.0.0-beta2'; /** @var array 传入的参数 */ protected array $argv;