diff --git a/.gitignore b/.gitignore index 8823c742..c44fa39b 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,7 @@ zm.json /zm_data/ composer.lock /resources/server.phar +/distribute/ +/bin/.phpunit.result.cache +/resources/zhamao.service +.phpunit.result.cache diff --git a/Dockerfile b/Dockerfile index c1cc7cfb..0225d218 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,28 +1,3 @@ -FROM ubuntu:18.04 -WORKDIR /app/ -RUN echo "Asia/Shanghai" > /etc/timezone -ENV LANG C.UTF_8 -ENV LC_ALL C.UTF-8 -ENV LANGUAGE C.UTF-8 +FROM zmbot/swoole:latest -RUN apt-get update && apt-get install -y software-properties-common tzdata -RUN dpkg-reconfigure -f noninteractive tzdata -VOLUME ["/app/zhamao-framework/"] -RUN add-apt-repository ppa:ondrej/php && - apt-get update && \ - apt-get install php php-dev php-mbstring gcc make openssl php-mbstring php-json php-curl php-mysql -y && \ - apt-get install wget composer -y && \ - wget https://github.com/swoole/swoole-src/archive/v4.5.0.tar.gz && \ - tar -zxvf v4.5.0.tar.gz && \ - cd swoole-src-4.5.0/ && \ - phpize && ./configure --enable-openssl --enable-mysqlnd && make -j2 && make install && \ - (echo "extension=swoole.so" >> $(php -i | grep "Loaded Configuration File" | awk '{print $5}')) - - -ADD . /app/zhamao-framework -ADD . /app/zhamao-framework-bak -#RUN cd /app/zhamao-framework && composer update && composer clearcache -#RUN mv zhamao-framework-master zhamao-framework -WORKDIR /app/zhamao-framework - -CMD ["/bin/bash", "-i", "/app/zhamao-framework-bak/.entry.sh"] +# TODO: auto-setup entrypoint diff --git a/SECURITY.md b/SECURITY.md index 8b5a29f6..ceccc54f 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -4,8 +4,9 @@ | Version | Supported | | ------- | ------------------ | -| 1.2.x | :white_check_mark: | -| 1.1.x | :x: | +| 2.0 | :white_check_mark: | +| 1.6.x | :white_check_mark: | +| 1.1.x | :x: | | 1.0.x | :x: | ## Reporting a Vulnerability diff --git a/composer.json b/composer.json index 351e3bdd..4df1d2fb 100644 --- a/composer.json +++ b/composer.json @@ -3,7 +3,7 @@ "description": "High performance QQ robot and web server development framework", "minimum-stability": "stable", "license": "Apache-2.0", - "version": "2.0.0-b1", + "version": "2.0.0-b3", "authors": [ { "name": "whale", @@ -66,10 +66,6 @@ { "type": "path", "url": "/Users/jerry/project/git-project/zhamao-console" - }, - { - "type": "path", - "url": "/Users/jerry/project/git-project/zhamao-lock" } ] } diff --git a/docker_mixed/Dockerfile b/docker_mixed/Dockerfile deleted file mode 100644 index ca2291e8..00000000 --- a/docker_mixed/Dockerfile +++ /dev/null @@ -1,17 +0,0 @@ -FROM richardchien/cqhttp:latest -RUN apt-get update && apt-get install -y software-properties-common tzdata -RUN dpkg-reconfigure -f noninteractive tzdata -RUN add-apt-repository ppa:ondrej/php && \ - apt-get update && \ - apt-get install php php-dev php-mbstring gcc make openssl php-mbstring php-json php-curl php-mysql -y && \ - apt-get install wget composer -y && \ - wget https://github.com/swoole/swoole-src/archive/v4.5.0.tar.gz && \ - tar -zxvf v4.5.0.tar.gz && \ - cd swoole-src-4.5.0/ && \ - phpize && ./configure --enable-openssl --enable-mysqlnd && make -j2 && make install && \ - (echo "extension=swoole.so" >> $(php -i | grep "Loaded Configuration File" | awk '{print $5}')) -ADD start.sh /home/user/start.sh -RUN chown user:user /home/user/start.sh && chmod +x /home/user/start.sh -ADD https://github.com/zhamao-robot/zhamao-framework/archive/master.zip /home/user/master.zip -RUN chown user:user /home/user/master.zip && chmod 777 /home/user/master.zip -VOLUME ["/home/user/coolq","/home/user/zhamao-framework"] diff --git a/docker_mixed/start.sh b/docker_mixed/start.sh deleted file mode 100644 index adf73f0f..00000000 --- a/docker_mixed/start.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -unzip master.zip -mv zhamao-framework-master/* zhamao-framework/ -cd zhamao-framework -php bin/start diff --git a/docs/guide/我需要做什么.md b/docs/guide/我需要做什么.md deleted file mode 100644 index 7aaa2981..00000000 --- a/docs/guide/我需要做什么.md +++ /dev/null @@ -1,3 +0,0 @@ -# 我需要做什么 - -文档还在写,不急!! \ No newline at end of file diff --git a/docs/index.md b/docs/index.md index f8c5dc91..83711962 100644 --- a/docs/index.md +++ b/docs/index.md @@ -1,22 +1,39 @@ # 介绍 -炸毛框架由 php-swoole 构建而来,主要面向 API 服务,聊天机器人(CQHTTP 对接),包含 websocket、http 等监听和请求库,用户代码采用模块化处理,可以方便地编写各类功能。 +炸毛框架使用 PHP 编写,采用 Swoole 扩展为基础,主要面向 API 服务,聊天机器人(CQHTTP 对接),包含 websocket、http 等监听和请求库,用户代码采用模块化处理,使用注解可以方便地编写各类功能。 框架主要用途为 HTTP 服务器,机器人搭建框架。尤其对于 QQ 机器人消息处理较为方便和全面,提供了众多会话机制和内部调用机制,可以以各种方式设计你自己的模块。 在 HTTP 和 WebSocket 服务器上,PHP 的扩展 Swoole 提供了高性能的支持,使其效率可媲美 nginx 静态网页处理的效率。 -此外,QQ 机器人方面此框架基于 OneBot 标准 的反向 WebSocket 连接,比传统 HTTP 通信更快,未来也会兼容微信公众号开发者模式。 +此外,QQ 机器人方面此框架基于 OneBot 标准的反向 WebSocket 连接,比传统 HTTP 通信更快,未来也会兼容微信公众号开发者模式。 + +```php +/** + * @CQCommand("你好") + */ +public function hello() { + ctx()->reply("你好,我是炸毛!"); +} +/** + * @RequestMapping("/index") + */ +public function index() { + return "