Skip to content

Commit

Permalink
Merge pull request #206 from zhamao-robot/v3-beta2
Browse files Browse the repository at this point in the history
发布 beta2
  • Loading branch information
crazywhalecc authored Dec 26, 2022
2 parents 81a5e48 + 80ba343 commit d1f6955
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 10 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions docs/.vuepress/config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module.exports = {
title: '炸毛框架',
title: '炸毛框架 v3',
description: '一个高性能聊天机器人 + Web 框架',
theme: 'antdocs',
markdown: {
Expand All @@ -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/': [
Expand Down
1 change: 0 additions & 1 deletion docs/guide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,5 @@
- WebSocket 服务器、HTTP 服务器兼容运行,一个框架多个用处
- 支持命令、自然语言处理等多种插件形式
- 支持多个机器人账号负载均衡
- 协程 + TaskWorker 进程重度任务处理机制,保证高效,单个请求响应时间为 0.1 ms 左右
- 模块分离和自由组合,可根据自身需求自己建立模块内的目录结构和代码结构
- 灵活的注释和注解注册事件方式,支持 PHP 原生注解,提示更为友好
10 changes: 8 additions & 2 deletions docs/guide/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -41,6 +41,12 @@ composer require zhamao/framework
./zhamao server
```

## Windows 安装方法

由于 Windows 系统下的 PHP 环境配置较为复杂,我们推荐使用 Docker 或一键脚本来进行安装。

如果你打算在 Windows 使用原生的 Win 环境 PHP,你需要先安装 PHP 和 Composer,然后在任意目录下执行上方 composer 的安装方法即可。

## 更多的环境部署和开发方式

除了上述方式之外,框架还支持源码模式、守护进程等运行方式,详情请参阅 [进阶开发]
3 changes: 2 additions & 1 deletion src/ZM/Context/BotContext.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ private function sendAction(string $action, array $params = [], ?array $self = n
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) {
Expand Down
2 changes: 1 addition & 1 deletion src/ZM/Framework.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d1f6955

Please sign in to comment.