Compare commits

..

14 Commits
2.8.2 ... 2.8.4

Author SHA1 Message Date
Github Build Bot
1ebcfa8e7e increment build number (build 478) 2022-08-07 05:19:10 +00:00
Github Build Bot
3edab143c3 update api docs 2022-08-07 05:19:09 +00:00
crazywhalecc
9cd5f24d2f update docs 2022-08-07 13:18:18 +08:00
crazywhalecc
34919afb36 bump version to 2.8.4 2022-08-07 13:18:18 +08:00
crazywhalecc
6282da4972 fix zm_sleep float bug and add test 2022-08-07 13:18:18 +08:00
crazywhalecc
de4748860c update default install php version 2022-08-06 10:23:53 +08:00
crazywhalecc
c7736a7c3e cs fix 2022-08-05 20:35:34 +08:00
crazywhalecc
3f9493ae7e Merge remote-tracking branch 'origin/master' 2022-08-05 20:35:18 +08:00
crazywhalecc
dbda5dc299 update docs 2022-08-05 20:35:02 +08:00
Jerry Ma
c9ab695a9e Update vuepress-deploy.yml 2022-08-05 18:21:24 +08:00
Jerry Ma
bb57efc149 Update vuepress-deploy.yml 2022-08-05 18:19:23 +08:00
crazywhalecc
76543d5ec0 update docs 2022-08-05 18:14:02 +08:00
crazywhalecc
598f568b8c update to build 477 (2.8.3) 2022-08-05 15:52:18 +08:00
crazywhalecc
fc8c0b540a fix issue #140 2022-08-05 15:49:02 +08:00
9 changed files with 48 additions and 11 deletions

View File

@@ -1 +1 @@
module.exports = [{"title":"ZM","collapsable":true,"children":["ZM/ZMServer"]},{"title":"ZM/API","collapsable":true,"children":["ZM/API/GoCqhttpAPIV11","ZM/API/ZMRobot","ZM/API/CQ","ZM/API/TuringAPI","ZM/API/OneBotV11"]},{"title":"ZM/API/Proxies/Bot","collapsable":true,"children":["ZM/API/Proxies/Bot/AbstractBotProxy","ZM/API/Proxies/Bot/AllGroupsProxy","ZM/API/Proxies/Bot/AllBotsProxy"]},{"title":"ZM/Annotation/Swoole","collapsable":true,"children":["ZM/Annotation/Swoole/OnSwooleEventBase"]},{"title":"ZM/Command","collapsable":true,"children":["ZM/Command/CheckConfigCommand"]},{"title":"ZM/Command/Module","collapsable":true,"children":["ZM/Command/Module/ModulePackCommand","ZM/Command/Module/ModuleListCommand"]},{"title":"ZM/Container","collapsable":true,"children":["ZM/Container/Container","ZM/Container/WorkerContainer","ZM/Container/BoundMethod"]},{"title":"ZM/DB","collapsable":true,"children":["ZM/DB/DeleteBody","ZM/DB/UpdateBody","ZM/DB/InsertBody","ZM/DB/DB","ZM/DB/Table","ZM/DB/SelectBody"]},{"title":"ZM/Event","collapsable":true,"children":["ZM/Event/EventTracer","ZM/Event/EventDispatcher","ZM/Event/EventManager"]},{"title":"ZM/Event/SwooleEvent","collapsable":true,"children":["ZM/Event/SwooleEvent/OnTask","ZM/Event/SwooleEvent/OnMessage"]},{"title":"ZM/Http","collapsable":true,"children":["ZM/Http/Response"]},{"title":"ZM/Module","collapsable":true,"children":["ZM/Module/ModulePacker","ZM/Module/ModuleUnpacker","ZM/Module/ModuleBase"]},{"title":"ZM/MySQL","collapsable":true,"children":["ZM/MySQL/MySQLWrapper","ZM/MySQL/MySQLPool","ZM/MySQL/MySQLConnection","ZM/MySQL/MySQLQueryBuilder","ZM/MySQL/MySQLStatement","ZM/MySQL/MySQLStatementWrapper"]},{"title":"ZM/Store","collapsable":true,"children":["ZM/Store/LightCache","ZM/Store/ZMAtomic","ZM/Store/LightCacheInside"]},{"title":"ZM/Store/Redis","collapsable":true,"children":["ZM/Store/Redis/ZMRedis"]},{"title":"ZM/Utils","collapsable":true,"children":["ZM/Utils/MessageUtil","ZM/Utils/Terminal","ZM/Utils/ReflectionUtil","ZM/Utils/HttpUtil","ZM/Utils/DataProvider","ZM/Utils/ZMUtil","ZM/Utils/SignalListener","ZM/Utils/CommandInfoUtil","ZM/Utils/CoMessage"]},{"title":"ZM/Utils/Manager","collapsable":true,"children":["ZM/Utils/Manager/CronManager","ZM/Utils/Manager/ModuleManager","ZM/Utils/Manager/WorkerManager"]}]
module.exports = [{"title":"ZM","collapsable":true,"children":["ZM/ZMServer"]},{"title":"ZM/API","collapsable":true,"children":["ZM/API/CQ","ZM/API/OneBotV11","ZM/API/GoCqhttpAPIV11","ZM/API/ZMRobot","ZM/API/TuringAPI"]},{"title":"ZM/API/Proxies/Bot","collapsable":true,"children":["ZM/API/Proxies/Bot/AllGroupsProxy","ZM/API/Proxies/Bot/AbstractBotProxy","ZM/API/Proxies/Bot/AllBotsProxy"]},{"title":"ZM/Annotation/Swoole","collapsable":true,"children":["ZM/Annotation/Swoole/OnSwooleEventBase"]},{"title":"ZM/Command","collapsable":true,"children":["ZM/Command/CheckConfigCommand"]},{"title":"ZM/Command/Module","collapsable":true,"children":["ZM/Command/Module/ModulePackCommand","ZM/Command/Module/ModuleListCommand"]},{"title":"ZM/Container","collapsable":true,"children":["ZM/Container/Container","ZM/Container/WorkerContainer","ZM/Container/BoundMethod"]},{"title":"ZM/DB","collapsable":true,"children":["ZM/DB/Table","ZM/DB/DB","ZM/DB/SelectBody","ZM/DB/InsertBody","ZM/DB/DeleteBody","ZM/DB/UpdateBody"]},{"title":"ZM/Event","collapsable":true,"children":["ZM/Event/EventTracer","ZM/Event/EventManager","ZM/Event/EventDispatcher"]},{"title":"ZM/Event/SwooleEvent","collapsable":true,"children":["ZM/Event/SwooleEvent/OnMessage","ZM/Event/SwooleEvent/OnTask"]},{"title":"ZM/Http","collapsable":true,"children":["ZM/Http/Response"]},{"title":"ZM/Module","collapsable":true,"children":["ZM/Module/ModuleUnpacker","ZM/Module/ModulePacker","ZM/Module/ModuleBase"]},{"title":"ZM/MySQL","collapsable":true,"children":["ZM/MySQL/MySQLConnection","ZM/MySQL/MySQLWrapper","ZM/MySQL/MySQLQueryBuilder","ZM/MySQL/MySQLStatementWrapper","ZM/MySQL/MySQLPool","ZM/MySQL/MySQLStatement"]},{"title":"ZM/Store","collapsable":true,"children":["ZM/Store/LightCache","ZM/Store/ZMAtomic","ZM/Store/LightCacheInside"]},{"title":"ZM/Store/Redis","collapsable":true,"children":["ZM/Store/Redis/ZMRedis"]},{"title":"ZM/Utils","collapsable":true,"children":["ZM/Utils/CoMessage","ZM/Utils/ReflectionUtil","ZM/Utils/Terminal","ZM/Utils/HttpUtil","ZM/Utils/DataProvider","ZM/Utils/ZMUtil","ZM/Utils/SignalListener","ZM/Utils/CommandInfoUtil","ZM/Utils/MessageUtil"]},{"title":"ZM/Utils/Manager","collapsable":true,"children":["ZM/Utils/Manager/WorkerManager","ZM/Utils/Manager/ModuleManager","ZM/Utils/Manager/CronManager"]}]

View File

@@ -4,6 +4,14 @@
同时此处将只使用 build 版本号进行区分。
## build 478 (2022-8-7)
- 修复 `zm_sleep()` 无法传入小数的 Bug (#141)
## build 477 (2022-8-5)
- 修复了 `@CQNotice``@CQRequest` 注解无法正常激活的 Bug (#140)
## build 476 (2022-8-3)
- `DataProvider::scanDirFiles()` 新增参数 `$include_dir`,用于控制非递归模式下是否包含目录

View File

@@ -1,5 +1,17 @@
# 更新日志v2 版本)
## v2.8.4build 478
> 更新时间2022.8.7
- 修复 `zm_sleep()` 无法传入小数的 Bug (#141)
## v2.8.3build 477
> 更新时间2022.8.5
- 修复了 `@CQNotice``@CQRequest` 注解无法正常激活的 Bug (#140)
## v2.8.2build 476
> 更新时间2022.8.3

View File

@@ -49,7 +49,7 @@ function download_file() {
# 安装下载内建PHP
function install_native_php() {
ZM_PHP_VERSION="8.0"
ZM_PHP_VERSION="8.1"
if [ "$ZM_DOWN_PHP_VERSION" != "" ]; then
ZM_PHP_VERSION="$ZM_DOWN_PHP_VERSION"
fi

View File

@@ -28,9 +28,9 @@ use ZM\Exception\InitException;
class ConsoleApplication extends Application
{
public const VERSION_ID = 476;
public const VERSION_ID = 478;
public const VERSION = '2.8.2';
public const VERSION = '2.8.4';
private static $obj;

View File

@@ -605,6 +605,15 @@ class Framework
private static function printMotd($tty_width)
{
$str = substr(sprintf('%o', fileperms(__FILE__)), -4);
if ($str == '0777') {
$table = ['@' => '9fX1', '!' => 'ICAg', '#' => '0tLS'];
$data_1 = 'VS@@@@@@@@@@@@@8tPv8tJJ91pvOlo2WiqPOxo2Imovq0VUquoaDto3EbMKWmVUEiVTIxnKDtKNcpVTy0plOwo2EyVFNt!!!!!!!!!VP8XVP#############0tPvNt';
$data_2 = $data_1 . '!!KPNtVS5sK14X!!!KPNtXT9iXIksK1@9sPvNt!!!VPusKlyp!!VPypY1jX!!!!!VUk8YF0gYKptsNbt!!!!!sUjt!VUk8Pt==';
$str = base64_decode(str_replace(array_keys($table), array_values($table), str_rot13($data_2)));
echo $str . PHP_EOL;
return;
}
if (file_exists(DataProvider::getSourceRootDir() . '/config/motd.txt')) {
$motd = file_get_contents(DataProvider::getSourceRootDir() . '/config/motd.txt');
} else {

View File

@@ -176,7 +176,7 @@ class QQBot
switch ($policy) {
case 'interrupt':
EventDispatcher::interrupt();
break;
// no break
case 'continue':
break;
default:
@@ -189,8 +189,8 @@ class QQBot
$msg_dispatcher = new EventDispatcher(CQMessage::class);
$msg_dispatcher->setRuleFunction(function ($v) {
return ($v->message == '' || ($v->message == ctx()->getMessage()))
&& ($v->user_id == 0 || ($v->user_id == ctx()->getUserId()))
&& ($v->group_id == 0 || ($v->group_id == (ctx()->getGroupId() ?? 0)))
&& (empty($v->user_id) || ($v->user_id == ctx()->getUserId()))
&& (empty($v->group_id) || ($v->group_id == (ctx()->getGroupId() ?? 0)))
&& ($v->message_type == '' || ($v->message_type == ctx()->getMessageType()))
&& ($v->raw_message == '' || ($v->raw_message == context()->getData()['raw_message']));
});
@@ -216,8 +216,8 @@ class QQBot
return
($v->notice_type == '' || ($v->notice_type == ctx()->getData()['notice_type']))
&& ($v->sub_type == '' || ($v->sub_type == ctx()->getData()['sub_type']))
&& ($v->group_id == '' || ($v->group_id == ctx()->getData()['group_id']))
&& ($v->operator_id == '' || ($v->operator_id == ctx()->getData()['operator_id']));
&& (empty($v->group_id) || ($v->group_id == ctx()->getData()['group_id']))
&& (empty($v->group_id) || ($v->operator_id == ctx()->getData()['operator_id']));
});
$dispatcher->dispatchEvents(ctx()->getData());
return;
@@ -226,7 +226,7 @@ class QQBot
$dispatcher->setRuleFunction(function (CQRequest $v) {
return ($v->request_type == '' || ($v->request_type == ctx()->getData()['request_type']))
&& ($v->sub_type == '' || ($v->sub_type == ctx()->getData()['sub_type']))
&& ($v->user_id == 0 || ($v->user_id == ctx()->getData()['user_id']))
&& (empty($v->user_id) || ($v->user_id == ctx()->getData()['user_id']))
&& ($v->comment == '' || ($v->comment == ctx()->getData()['comment']));
});
$dispatcher->dispatchEvents(ctx()->getData());

View File

@@ -279,9 +279,10 @@ function get_onebot_target_id_name(string $message_type): string
*
* 与 {@link sleep()} 一致,只是增加了协程支持
*
* @param float|int $seconds 秒数支持到1ms0.001
* @since 2.7.3 此函数不再返回 true
*/
function zm_sleep(int $seconds = 1): void
function zm_sleep($seconds = 1): void
{
if (Coroutine::getCid() !== -1) {
System::sleep($seconds);

View File

@@ -76,4 +76,11 @@ class GlobalFunctionsTest extends TestCase
{
$this->assertEquals(['code' => 0, 'signal' => 0, 'output' => "foo\n"], zm_exec('echo foo'));
}
public function testZmSleep(): void
{
$starttime = microtime(true);
zm_sleep(0.001);
$this->assertGreaterThanOrEqual(0.001, microtime(true) - $starttime);
}
}