代码拉取完成,页面将自动刷新
兼容OneBot标准的机器人接口,使用Yaf框架实现(C语言编写的PHP框架)。
名称 | 说明 | 版本 |
---|---|---|
Nginx | 高性能的HTTP和反向代理web服务器 | 1.17.3 |
PHP | “超文本预处理器”,是在服务器端执行的脚本语言,尤其适用于Web开发并可嵌入HTML中。 | 7.4.21 |
MySQL | 最流行的关系型数据库管理系统。 | 5.7.34 |
Redis | 一个开源的使用ANSI C语言编写、支持网络、可基于内存亦可持久化的日志型、Key-Value数据库,并提供多种语言的API。 | 6.2.4 |
Yaf | Yaf 是一个 C 语言编写的 PHP 框架。 | 3.2.5 |
框架部分
应用标识:go-cqhttp
应用版本:v1.0.0-beta5
应用完整名称:go-cqhttp-v1.0.0-beta5_linux_amd64-go1.16.2
OneBot标准版本:v11
运行时:linux / go1.16.2
接口部分
SDK版本:Author David v1.0.0
SDK时间:20210802100000
操作系统:Linux 3.10.0-1160.21.1.el7.x86_64 #1 SMP Tue Mar 16 18:28:22 UTC 2021
运行时:Nginx 1.17.3 -Tengine 2.3.2 / Redis 6.2.4 / MySQL 5.7.34 / PHP 7.4.21
PHP扩展:Yaf 3.2.5
通过本Demo,可以整体提高对Yaf框架的认知,熟悉并掌握以下知识点:
composer install
http://127.0.0.1/index/Bot/index/qq/qq
cd ./conf/product/go-cqhttp && ./go-cqhttp -d -c ./config.yml
cd ./conf/product/bin && ./queue -c ./queue.conf
extension = yaf.so
yaf.environ = "product"
yaf.cache_config = 1
yaf.use_namespace = On
yaf.use_spl_autoload = On
location / {
if (!-e $request_filename) {
rewrite ^/(.*) /index.php/$1 last;
}
}
+ public
|- index.php //入口文件
|- .htaccess //重写规则
|+ css
|+ img
|+ js
+ conf
|- application.ini //配置文件
|- route.php //路由协议
+ application
|+ controllers
|- Index.php //默认控制器
|+ views
|+ index //控制器
|- index.phtml //默认视图
|+ modules //其他模块
|+ library //本地类库
|+ models //model目录
|+ plugins //插件目录
PHP官方文档:https://www.php.net/manual/zh/intro.yaf.php
鸟哥官方文档:https://www.laruence.com/manual/index.html
配置文件:https://www.laruence.com/manual/yaf.config.optional.html
注册其他命名空间:https://www.laruence.com/manual/yaf.autoloader.html
类的加载方法:https://www.laruence.com/manual/yaf.autoloader.rule.html
路由协议:https://www.laruence.com/manual/yaf.routes.static.html
Seaslog扩展仓库:https://github.com/SeasX/SeasLog
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。