随笔分类 -  hyperf

hyperf
摘要:安装hyperf/websocket-server组件 composer require hyperf/websocket-server websocket服务配置 config/autoload/server.php <?php declare(strict_types=1); use Hyper 阅读全文
posted @ 2021-10-08 01:34 胡勇健 阅读(949) 评论(0) 推荐(0) 编辑
摘要:UDPServer类 app/Server/UdpServer.php <?php declare(strict_types=1); namespace App\Server; use Hyperf\Contract\OnPacketInterface; class UdpServer implem 阅读全文
posted @ 2021-10-07 17:18 胡勇健 阅读(132) 评论(0) 推荐(0) 编辑
摘要:TcpServer类 app/Server/TcpServer.php <?php declare(strict_types=1); namespace App\Server; use Hyperf\Contract\OnReceiveInterface; class TcpServer imple 阅读全文
posted @ 2021-10-07 13:37 胡勇健 阅读(556) 评论(0) 推荐(0) 编辑
摘要:访问器 Index控制器 app/Controller/IndexController.php <?php namespace App\Controller; use Hyperf\HttpServer\Contract\RequestInterface; use Hyperf\HttpServer 阅读全文
posted @ 2021-10-01 08:22 胡勇健 阅读(410) 评论(0) 推荐(0) 编辑
摘要:安装模型缓存组件 composer require hyperf/model-cache 控制器 app/Controller/IndexController.php <?php namespace App\Controller; use Hyperf\HttpServer\Contract\Req 阅读全文
posted @ 2021-09-29 01:15 胡勇健 阅读(638) 评论(0) 推荐(0) 编辑
摘要:sql执行日志 控制器 app/Controller/IndexController.php <?php namespace App\Controller; use Hyperf\HttpServer\Annotation\AutoController; use App\Model\User; /* 阅读全文
posted @ 2021-09-29 00:35 胡勇健 阅读(862) 评论(0) 推荐(0) 编辑
摘要:查询构造器分页 控制器 app/Controller/IndexController.php <?php namespace App\Controller; use Hyperf\HttpServer\Annotation\AutoController; use Hyperf\DbConnectio 阅读全文
posted @ 2021-09-28 20:14 胡勇健 阅读(404) 评论(0) 推荐(0) 编辑
摘要:一对一 控制器 app/Controller/IndexController.php <?php namespace App\Controller; use Hyperf\HttpServer\Annotation\AutoController; use App\Model\User; /** * 阅读全文
posted @ 2021-09-28 19:33 胡勇健 阅读(270) 评论(0) 推荐(0) 编辑
摘要:生成model php bin/hyperf.php gen:model user User model app/Model/User.php <?php declare (strict_types=1); namespace App\Model; use Hyperf\DbConnection\M 阅读全文
posted @ 2021-09-26 15:52 胡勇健 阅读(1081) 评论(0) 推荐(0) 编辑
摘要:查询 查询 use Hyperf\DbConnection\Db; $users = Db::select('SELECT * FROM user;'); $users = Db::table('user')->get(); $users = Db::table('user')->select('n 阅读全文
posted @ 2021-09-26 15:00 胡勇健 阅读(1248) 评论(0) 推荐(0) 编辑
摘要:安装数据库组件 composer require hyperf/db-connection 数据库配置 <?php declare(strict_types=1); return [ 'default' => [ 'driver' => env('DB_DRIVER', 'mysql'), 'hos 阅读全文
posted @ 2021-09-26 00:34 胡勇健 阅读(422) 评论(0) 推荐(0) 编辑
摘要:安装filesystem composer require hyperf/filesystem 生成filesystem配置文件 config/autoload/file.php php bin/hyperf.php vendor:publish hyperf/filesystem 控制器 app/ 阅读全文
posted @ 2021-09-24 17:02 胡勇健 阅读(710) 评论(0) 推荐(0) 编辑
摘要:安装session组件 composer require hyperf/session 生成session配置文件 config/autoload/session.php php bin/hyperf.php vendor:publish hyperf/session <?php declare(s 阅读全文
posted @ 2021-09-23 17:37 胡勇健 阅读(361) 评论(0) 推荐(0) 编辑
摘要:安装validation composer require hyperf/validation 安装translation composer require hyperf/translation 生成translation配置文件 php bin/hyperf.php vendor:publish 阅读全文
posted @ 2021-09-23 15:58 胡勇健 阅读(665) 评论(0) 推荐(0) 编辑
摘要:安装视图 composer require hyperf/view 安装 Smarty 引擎 composer require smarty/smarty 安装task composer require hyperf/task 控制器 app/Controller/ViewController.ph 阅读全文
posted @ 2021-09-23 13:15 胡勇健 阅读(321) 评论(0) 推荐(0) 编辑
摘要:查看命令列表 php bin/hyperf.php 启动hyperf服务 php bin/hyperf.php start 生成控制器 php bin/hyperf.php gen:Controller UserController 添加注解 use Hyperf\HttpServer\Annota 阅读全文
posted @ 2021-09-23 01:11 胡勇健 阅读(394) 评论(0) 推荐(0) 编辑
摘要:安装 composer require hyperf/paginator paginator控制器 app/Controller/PaginatorController.php <?php namespace App\Controller; use Hyperf\HttpServer\Annotat 阅读全文
posted @ 2021-09-23 00:32 胡勇健 阅读(520) 评论(0) 推荐(0) 编辑
摘要:配置 config/autoload/logger.php <?php declare(strict_types=1); return [ 'default' => [ 'handler' => [ 'class' => Monolog\Handler\StreamHandler::class, ' 阅读全文
posted @ 2021-09-22 19:29 胡勇健 阅读(802) 评论(0) 推荐(0) 编辑
摘要:Cache代理类 Cache代理类 app/Utils/Cache.php <?php namespace App\Utils; use Hyperf\Utils\ApplicationContext; use Psr\SimpleCache\CacheInterface; class Cache 阅读全文
posted @ 2021-09-22 17:12 胡勇健 阅读(1147) 评论(0) 推荐(0) 编辑
摘要:控制器 app/Controller/IndexController.php <?php namespace App\Controller; use Hyperf\HttpServer\Annotation\AutoController; use App\Exception\FooException 阅读全文
posted @ 2021-09-18 16:08 胡勇健 阅读(628) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示