Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

init #2

Open
wants to merge 82 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
82 commits
Select commit Hold shift + click to select a range
dbd2a36
init
ice-leng Jul 5, 2020
f429645
init
ice-leng Jul 5, 2020
fce8399
add hyperf-common
ice-leng Aug 23, 2020
5aed9b0
add auth
ice-leng Aug 29, 2020
9f28822
add exception handle
ice-leng Sep 4, 2020
a564966
解决 favicon.ico not 问题
ice-leng Sep 21, 2020
6f770a1
添加 错误码 类
ice-leng Oct 5, 2020
e0911c6
修改 sh 脚本
ice-leng Oct 5, 2020
f0cdecf
修改 sh 脚本
ice-leng Oct 5, 2020
d3b9191
修改 基础database 配置
ice-leng Oct 22, 2020
91bf1d8
fix bug
ice-leng Oct 22, 2020
6db041b
README.md
ice-leng Oct 25, 2020
c27a1db
fix bug
ice-leng Oct 30, 2020
ff2bce8
add apidog and fix apidog bug
ice-leng Nov 10, 2020
2511058
rbac
ice-leng Nov 14, 2020
4a57064
add function getValidateData
ice-leng Nov 15, 2020
65993ef
add rabc
ice-leng Nov 15, 2020
af00bba
add rabc
ice-leng Nov 15, 2020
3bbb95d
add migration
ice-leng Nov 15, 2020
179d43d
add migration
ice-leng Nov 15, 2020
69508f1
登录
ice-leng Nov 16, 2020
dcb57de
登录
ice-leng Nov 17, 2020
f23b106
登录
ice-leng Nov 17, 2020
9887ed0
修改 auth 结构
ice-leng Nov 20, 2020
f1d7b4d
AntDesign demo test
ice-leng Nov 25, 2020
7c0125b
重新定义 Colunn
ice-leng Nov 29, 2020
55754b3
重新定义 Colunn 2.0
ice-leng Nov 30, 2020
14dcdad
重新定义 Colunn 2.0
ice-leng Nov 30, 2020
dd4d681
重新定义 Colunn 2.0
ice-leng Nov 30, 2020
8e87ce5
调整结构
ice-leng Nov 30, 2020
bb7d1c8
调整结构
ice-leng Nov 30, 2020
cf3cb10
调整结构
ice-leng Dec 1, 2020
33b8729
form 表单
ice-leng Dec 2, 2020
cc226fd
哎,一言难尽
ice-leng Dec 3, 2020
3392e3d
修修改改又一年
ice-leng Dec 3, 2020
2d6f0af
修修改改又一年
ice-leng Dec 3, 2020
01cb773
脚手架 - 模版
ice-leng Dec 4, 2020
3ca8ee3
fix bug
ice-leng Dec 7, 2020
2dfbae5
脚手架 - 模版
ice-leng Dec 7, 2020
a0d7f1d
脚手架 - 模版
ice-leng Dec 8, 2020
0136377
脚手架 - 模版
ice-leng Dec 8, 2020
9c6a283
脚手架 - 模版
ice-leng Dec 8, 2020
b1df628
脚手架 - 模版
ice-leng Dec 8, 2020
aaabf8e
脚手架 - 模版
ice-leng Dec 8, 2020
ee55033
脚手架 - 模版
ice-leng Dec 8, 2020
cc6297f
脚手架 - 模版
ice-leng Dec 9, 2020
8f67047
脚手架 - 模版
ice-leng Dec 15, 2020
4b3bc5e
class 文件 生成 1
ice-leng Dec 15, 2020
1906f1b
class 文件 生成 2, 去掉模版引擎 自己写
ice-leng Dec 15, 2020
04680cb
class 文件 生成 3, 添加类的 其他属性
ice-leng Dec 16, 2020
e81d84b
class 文件 生成 4, 差 方法
ice-leng Dec 16, 2020
fa281c0
class 文件 生成 4, 差 方法
ice-leng Dec 16, 2020
8ea18c0
class 文件 生成5, 优化一下
ice-leng Dec 17, 2020
6b027d9
class 文件生成
ice-leng Dec 17, 2020
2e2cdbf
fix bug
ice-leng Dec 26, 2020
0c983b3
fix bug
ice-leng Dec 27, 2020
26063af
add model class
ice-leng Dec 28, 2020
0b0e3b3
fix bug
ice-leng Dec 28, 2020
5f39007
代码生成器 准备前 demo
ice-leng Dec 31, 2020
a5ee320
代码生成器 准备前 demo
ice-leng Dec 31, 2020
630156d
代码生成器 准备前 demo
ice-leng Jan 2, 2021
833d2ce
菜单管理
ice-leng Jan 4, 2021
3e9bb1e
角色 权限 管理
ice-leng Jan 6, 2021
090f7a5
角色 权限 管理
ice-leng Jan 6, 2021
c1295ad
角色 权限 管理
ice-leng Jan 6, 2021
1eba7d6
fix menu manager
ice-leng Jan 7, 2021
365fc89
管理员
ice-leng Jan 8, 2021
950b776
代码生成 - action demo
ice-leng Jan 8, 2021
7806aff
代码生成 - 缺失 前端 表单相关, 可以生成文件
ice-leng Jan 14, 2021
4b2d543
代码生成 - 缺失 前端 表单相关,可以生成文件
ice-leng Jan 14, 2021
e4cab41
修复 迁移文件
ice-leng Jan 15, 2021
1bb4ab8
fix bug
ice-leng Jan 15, 2021
ba2f52a
代码生成 - 缺失 前端 表单相关,可以生成文件
ice-leng Jan 23, 2021
8353eed
代码生成 - 缺失 前端 表单相关,可以生成文件
ice-leng Jan 23, 2021
5ede23e
升级 2.2
ice-leng Aug 31, 2021
90f2a88
设置基础
ice-leng Sep 2, 2021
ba49cb7
base model
ice-leng Sep 2, 2021
46a3dc3
核心
ice-leng Sep 2, 2021
b105862
核心
ice-leng Sep 3, 2021
11a9e8c
核心
ice-leng Sep 11, 2021
92f3880
Create data.js
ice-leng Jun 7, 2023
ebbcefa
Delete data.js
ice-leng Jun 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions .env

This file was deleted.

43 changes: 34 additions & 9 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,16 +1,41 @@
APP_NAME=skeleton
# 环境
APP_ENV=dev

DB_DRIVER=mysql
DB_HOST=localhost
DB_PORT=3306
DB_DATABASE=hyperf
# 项目名称
APP_NAME=hyperf-advanced

# 是否缓存扫描注解
SCAN_CACHEABLE=false

CRONTAB_ENABLE=false

# 监听端口
HTTP_PORT=9501
# RPC_PORT=9503

# 日志等级,默认DEBUG
LOG_LEVEL=200

# Swoole进程数配置
WORKER_NUM=2
TASK_WORKER_NUM=2

# MySQL数据库配置
DB_READ_HOST=127.0.0.1
DB_WRITE_HOST=127.0.0.1
DB_USERNAME=root
DB_PORT=3306
DB_DATABASE=hyperf_admin
DB_PASSWORD=
DB_CHARSET=utf8mb4
DB_COLLATION=utf8mb4_unicode_ci
DB_PREFIX=
DB_PREFIX=t_

REDIS_HOST=localhost
REDIS_AUTH=(null)

# Redis配置
REDIS_HOST=127.0.0.1
REDIS_PORT=6379
REDIS_DB=0
REDIS_DB=3
REDIS_AUTH=

HOST=http://127.0.0.1:9501
41 changes: 41 additions & 0 deletions .env.online
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# 环境
APP_ENV=prod

# 项目名称
APP_NAME=hyperf-advanced

# 是否缓存扫描注解
SCAN_CACHEABLE=false

CRONTAB_ENABLE=true

# 监听端口
HTTP_PORT=9501
# RPC_PORT=9503

# 日志等级,默认DEBUG
LOG_LEVEL=200

# Swoole进程数配置
WORKER_NUM=2
TASK_WORKER_NUM=2

# MySQL数据库配置
DB_READ_HOST=127.0.0.1
DB_WRITE_HOST=127.0.0.1
DB_USERNAME=root
DB_PORT=3306
DB_DATABASE=hyperf_admin
DB_PASSWORD=
DB_CHARSET=utf8mb4
DB_COLLATION=utf8mb4_unicode_ci
DB_PREFIX=t_


# Redis配置
REDIS_HOST=127.0.0.1
REDIS_PORT=6379
REDIS_DB=3
REDIS_AUTH=

HOST=http://127.0.0.1:9501
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,7 @@ vendor/
.phpintel/
.env
.DS_Store
*.lock
.phpunit*
.phpunit*
*.cache
public
composer.lock
12 changes: 7 additions & 5 deletions .php_cs → .php-cs-fixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,20 @@
This file is part of Hyperf.

@link https://www.hyperf.io
@document https://doc.hyperf.io
@document https://hyperf.wiki
@contact [email protected]
@license https://github.com/hyperf-cloud/hyperf/blob/master/LICENSE
@license https://github.com/hyperf/hyperf/blob/master/LICENSE
EOF;

return PhpCsFixer\Config::create()
return (new PhpCsFixer\Config())
->setRiskyAllowed(true)
->setRules([
'@PSR2' => true,
'@Symfony' => true,
'@DoctrineAnnotation' => true,
'@PhpCsFixer' => true,
'header_comment' => [
'commentType' => 'PHPDoc',
'comment_type' => 'PHPDoc',
'header' => $header,
'separate' => 'none',
'location' => 'after_declare_strict',
Expand Down Expand Up @@ -62,11 +62,13 @@
'multiline_whitespace_before_semicolons' => [
'strategy' => 'no_multi_line',
],
'constant_case' => [
'case' => 'lower',
],
'class_attributes_separation' => true,
'combine_consecutive_unsets' => true,
'declare_strict_types' => true,
'linebreak_after_opening_tag' => true,
'lowercase_constants' => true,
'lowercase_static_reference' => true,
'no_useless_else' => true,
'no_unused_imports' => true,
Expand Down
140 changes: 103 additions & 37 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,59 +1,125 @@
# Default Dockerfile

# hyperf/hyperf:7.4
#
# @link https://www.hyperf.io
# @document https://doc.hyperf.io
# @contact [email protected]
# @license https://github.com/hyperf-cloud/hyperf/blob/master/LICENSE
# @license https://github.com/hyperf/hyperf/blob/master/LICENSE

FROM hyperf/hyperf:7.2-alpine-cli
LABEL maintainer="Hyperf Developers <[email protected]>" version="1.0" license="MIT"
FROM alpine:3.12

##
# ---------- env settings ----------
##
# --build-arg timezone=Asia/Shanghai
ARG timezone

ENV TIMEZONE=${timezone:-"Asia/Shanghai"} \
COMPOSER_VERSION=1.9.0 \
APP_ENV=prod
APP_ENV=prod \
SCAN_CACHEABLE=(true)

ENV SWOOLE_VERSION 4.7.0
ENV PHPIZE_DEPS="autoconf dpkg-dev dpkg file g++ gcc libc-dev make php7-dev php7-pear pkgconf re2c pcre-dev pcre2-dev zlib-dev libtool automake"


LABEL maintainer="Hyperf Developers <[email protected]>" version="1.0" license="MIT"

# trust this project public key to trust the packages.
ADD https://alpine-apk-repository.knowyourself.cc/php-alpine.rsa.pub /etc/apk/keys/php-alpine.rsa.pub

# update
RUN set -ex \
# change apk source repo
&& echo "https://alpine-apk-repository.knowyourself.cc/v3.12/php-7.4" >> /etc/apk/repositories \
&& echo "@php https://alpine-apk-repository.knowyourself.cc/v3.12/php-7.4" >> /etc/apk/repositories \
&& apk update \
# install composer
&& cd /tmp \
&& wget https://github.com/composer/composer/releases/download/${COMPOSER_VERSION}/composer.phar \
&& chmod u+x composer.phar \
&& mv composer.phar /usr/local/bin/composer \
# show php version and extensions
&& php -v \
&& php -m \
# ---------- some config ----------
&& cd /etc/php7 \
# - config PHP
&& apk add --no-cache \
# Install base packages ('ca-certificates' will install 'nghttp2-libs')
ca-certificates \
curl \
wget \
tar \
xz \
libressl \
tzdata \
pcre \
php7 \
php7-bcmath \
php7-curl \
php7-ctype \
php7-dom \
php7-gd \
php7-iconv \
php7-json \
php7-mbstring \
php7-mysqlnd \
php7-openssl \
php7-pdo \
php7-pdo_mysql \
php7-pdo_sqlite \
php7-phar \
php7-posix \
php7-redis \
php7-sockets \
php7-sodium \
php7-sysvshm \
php7-sysvmsg \
php7-sysvsem \
php7-zip \
php7-zlib \
php7-xml \
php7-xmlreader \
php7-pcntl \
php7-opcache \
&& ln -sf /usr/bin/php7 /usr/bin/php

RUN set -ex \
&& apk update \
# for swoole extension libaio linux-headers
&& apk add --no-cache libstdc++ openssl git bash \
&& apk add --no-cache --virtual .build-deps $PHPIZE_DEPS libaio-dev openssl-dev curl-dev

# composer
RUN curl -O https://mirrors.aliyun.com/composer/composer.phar \
&& chmod +x composer.phar \
&& mv composer.phar /usr/bin/composer
# use aliyun composer
RUN composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/

# swoole ext
RUN cd /tmp \
&& wget https://github.com/swoole/swoole-src/archive/v${SWOOLE_VERSION}.tar.gz -O swoole.tar.gz \
&& mkdir -p swoole \
&& tar -xf swoole.tar.gz -C swoole --strip-components=1 \
&& rm swoole.tar.gz \
&& ln -s /usr/bin/phpize7 /usr/local/bin/phpize \
&& ln -s /usr/bin/php-config7 /usr/local/bin/php-config \
&& ( \
cd swoole \
&& phpize \
&& ./configure --enable-openssl --enable-http2 --enable-swoole-curl --enable-swoole-json \
&& make -s -j$(nproc) && make install \
) \
&& { \
echo "upload_max_filesize=100M"; \
echo "post_max_size=108M"; \
echo "memory_limit=1024M"; \
echo "upload_max_filesize=128M"; \
echo "post_max_size=128M"; \
echo "memory_limit=1G"; \
echo "date.timezone=${TIMEZONE}"; \
} | tee conf.d/99-overrides.ini \
# - config timezone
} | tee /etc/php7/conf.d/99_overrides.ini \
&& ln -sf /usr/share/zoneinfo/${TIMEZONE} /etc/localtime \
&& echo "${TIMEZONE}" > /etc/timezone \
# ---------- clear works ----------
&& rm -rf /var/cache/apk/* /tmp/* /usr/share/man \
&& echo "opcache.enable_cli = 'On'" >> /etc/php7/conf.d/00_opcache.ini \
&& echo "extension=swoole.so" > /etc/php7/conf.d/50_swoole.ini \
&& echo "swoole.use_shortname = 'Off'" >> /etc/php7/conf.d/50_swoole.ini \
&& rm -r swoole \
&& php -v \
&& php -m \
&& php --ri swoole \
&& composer \
&& apk del --purge *-dev \
&& rm -rf /var/cache/apk/* /tmp/* /usr/share/man /usr/share/php7 \
&& echo -e "\033[42;37m Build Completed :).\033[0m\n"

WORKDIR /opt/www

# Composer Cache
# COPY ./composer.* /opt/www/
# RUN composer install --no-dev --no-scripts
WORKDIR /hyperf

COPY . /opt/www
RUN composer install --no-dev -o
COPY . /hyperf
RUN composer install --no-dev -o && php bin/hyperf.php

EXPOSE 9501

ENTRYPOINT ["php", "/opt/www/bin/hyperf.php", "start"]
ENTRYPOINT ["php", "/hyperf/bin/hyperf.php", "start"]
24 changes: 4 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@

If You Like This Please Give Me Star

基于 yii 扩展的高级hyerf框架
基于 Hyperf 2.0

目前还在研发中,请慎用
目前还在重构中,看看就行,别拉下来

安装
------------
Expand All @@ -20,25 +20,9 @@ The preferred way to install this extension is through [composer](http://getcomp
Either run

```
git clone https://github.com/ice-leng/hyperf-advanced.git
git clone -b 2.0 https://github.com/ice-leng/hyperf-advanced.git
```
使用扩展
--------------
- [ ] API
- [x] [接口文档](https://github.com/ice-leng/hyperf-swagger)
- [x] [帮助类](https://github.com/ice-leng/hyperf-helper)
- [x] [token机制](https://github.com/ice-leng/hyperf-jwt)
- [x] [auth访问权限](https://github.com/ice-leng/hyperf-auth)
- [x] [Yii Db](https://github.com/ice-leng/hyperf-yii-db)
- [ ] ActiveRecode 文件生成脚手架
- [ ] elk 接入日志分析系统
- [ ] jaeger tracing
- [ ] Backend
- [x] [permission 权限](https://github.com/ice-leng/hyperf-yii-rbac)
- [ ] [session访问权限](https://github.com/ice-leng/hyperf-auth)
- [ ] 导航menu
- [ ] 混编模版



- [swagger,路由](https://github.com/daodao97/apidog)

Loading