2025-09-15 17:09:00 +08:00
2025-09-12 15:23:08 +08:00
2025-09-12 15:23:08 +08:00
2025-09-15 17:09:00 +08:00
2025-09-12 15:23:08 +08:00
2025-09-12 15:23:08 +08:00
2025-09-14 22:33:32 +08:00
2025-09-12 15:23:08 +08:00
2025-09-12 15:23:08 +08:00
2025-09-12 15:23:08 +08:00
2025-09-12 15:23:08 +08:00
2025-09-12 15:23:08 +08:00
2025-09-12 15:23:08 +08:00
2025-09-12 15:23:08 +08:00
2025-09-12 15:23:08 +08:00
2025-09-12 15:23:08 +08:00
2025-09-12 15:23:08 +08:00
2025-09-12 15:23:08 +08:00
2025-09-12 15:23:08 +08:00
2025-09-12 15:23:08 +08:00
2025-09-12 15:23:08 +08:00
2025-09-12 15:23:08 +08:00
2025-09-12 15:23:08 +08:00
2025-09-12 15:23:08 +08:00
2025-09-12 15:23:08 +08:00

仓库

特性

  • 最新技术栈:使用 PHP8.3/hyperf3.1/swoole5.1.4/phpredis 6.0.2 等后端前沿技术开发

文档

文档地址 Github

前序准备

  • php8.3git - 项目开发环境
  • swoole - 熟悉 swoole 特性
  • php8.3 - 熟悉 php 基础语法
  • hyperf - 熟悉 hyperf 基本语法

安装和使用

  • 安装 swoole 和 phpredis 扩展
自行搜索安装教程
  • 获取代码
git clone https://codeup.aliyun.com/67039465d8d1ada68263f984/hhl/rewrite/hyperf_service.git

mkdir uploads
  • vendor
composer install
  • 运行
cp .env.example .env

vim .env

php bin/hyperf.php start
  • command 函数
#框架自有
php bin/hyperf.php gen:controller LoginController
php bin/hyperf.php gen:model UserModel
php bin/hyperf.php gen:request LoginRequest
php bin/hyperf.php gen:command TestCommand
php bin/hyperf.php gen:job TestJob
php bin/hyperf.php gen:listener TestListener
php bin/hyperf.php gen:middleware AuthMiddleware
php bin/hyperf.php gen:amqp-consumer DemoConsumer
php bin/hyperf.php gen:amqp-producer DemoProducer
php bin/hyperf.php gen:constant ErrorCode --type enum

#新增命令
php bin/hyperf.php gen:service LoginService
php bin/hyperf.php gen:cron OssTask
php bin/hyperf.php gen:event TestEvent

Git 贡献提交规范

  • feat 新功能
  • fix 修补 bug
  • docs 文档
  • style 格式、样式(不影响代码运行的变动)
  • refactor 重构(即不是新增功能,也不是修改 BUG 的代码)
  • perf 优化相关,比如提升性能、体验
  • test 添加测试
  • build 编译相关的修改,对项目构建或者依赖的改动
  • ci 持续集成修改
  • chore 构建过程或辅助工具的变动
  • revert 回滚到上一个版本
  • workflow 工作流改进
  • mod 不确定分类的修改
  • wip 开发中
  • types 类型

cache

不允许使用序列化,为跨语言做准备

日志(合理安排)

分组名称 用途 日志级别 保留天数 备注
app 应用业务日志 DEBUG/INFO 7 主要业务逻辑日志
error 错误日志 ERROR 30 只记录错误
cache CACHE日志 DEBUG 3 开发调试用
request 请求访问日志 INFO 15 记录所有请求
cron 定时任务日志 INFO 30 定时任务执行记录
payment 支付相关日志 INFO 90 重要财务数据
audit 审计日志 INFO 365 重要操作记录
Description
No description provided
Readme MIT 303 KiB
Languages
PHP 98.6%
Dockerfile 1.2%
Lua 0.2%