摘要:
一,result类 <?php /* 统一格式的返回json数据 */ namespace App\Lib\Result; class Result { //success:code值为0,data:数据 static public function Success($data, $code = 2 阅读全文
posted @ 2025-02-15 11:08
刘宏缔的架构森林
阅读(99)
评论(0)
推荐(0)
摘要:
一,查看现有路由: $ php bin/hyperf.php describe:route [DEBUG] [command] Commands registered by Hyperf\Command\Listener\RegisterCommandListener [DEBUG] Event H 阅读全文
posted @ 2025-02-15 11:08
刘宏缔的架构森林
阅读(139)
评论(0)
推荐(0)
摘要:
一,官方文档地址 https://hyperf.wiki/3.1/#/zh-cn/validation 安装: 这个第三方库默认没有安装,需要我们手动安装 $ composer require hyperf/validation 二,封装要用的类 1,app/Lib/BaseValidator.ph 阅读全文
posted @ 2025-02-15 11:07
刘宏缔的架构森林
阅读(266)
评论(0)
推荐(0)
摘要:
一,配置nginx 官方文档地址: https://hyperf.wiki/3.1/#/zh-cn/tutorial/nginx 配置文件: /etc/nginx/site-enabled/hyperf.conf upstream hyperf { # Hyperf HTTP Server 的 IP 阅读全文
posted @ 2025-02-15 11:07
刘宏缔的架构森林
阅读(248)
评论(0)
推荐(0)
摘要:
一,配置数据库 .env中数据库的配置: DB_DRIVER=mysql DB_HOST=localhost DB_PORT=3306 DB_DATABASE=mybase DB_USERNAME=root DB_PASSWORD=mypassword DB_CHARSET=utf8mb4 DB_C 阅读全文
posted @ 2025-02-15 11:06
刘宏缔的架构森林
阅读(125)
评论(0)
推荐(0)
摘要:
一,报错信息: SQLSTATE[HY000] [2002] No such file or directory (SQL: select * from `news` where `news_id` = 3 limit 1) sql语句从mysql客户端命令可以正常执行,判断问题出在数据库的连接上 阅读全文
posted @ 2025-02-15 11:06
刘宏缔的架构森林
阅读(187)
评论(0)
推荐(0)
浙公网安备 33010602011771号