update plugin docs and add some helper functions

This commit is contained in:
Jerry
2023-03-31 21:44:48 +08:00
committed by GitHub
parent f85719ac8b
commit baa6ce9fc1
10 changed files with 161 additions and 12 deletions

View File

@@ -18,12 +18,14 @@ use ZM\Framework;
use ZM\Logger\ConsoleLogger;
use ZM\Middleware\MiddlewareHandler;
use ZM\Plugin\OneBot\BotMap;
use ZM\Plugin\ZMPlugin;
use ZM\Schedule\Timer;
use ZM\Store\Database\DBException;
use ZM\Store\Database\DBQueryBuilder;
use ZM\Store\Database\DBWrapper;
use ZM\Store\KV\KVInterface;
use ZM\Store\KV\Redis\RedisWrapper;
use ZM\ZMApplication;
// 防止重复引用引发报错
if (function_exists('zm_internal_errcode')) {
@@ -345,3 +347,19 @@ function ws_socket(int $flag = 1): WSServerSocketBase
}
return $a;
}
/**
* 创建炸毛框架应用
*/
function zm_create_app(): ZMApplication
{
return new ZMApplication();
}
/**
* 创建炸毛框架的插件对象
*/
function zm_create_plugin(): ZMPlugin
{
return new ZMPlugin();
}