ThinkPHP5与GatewayWorker集成(windows环境)

1. 安装GatewayWorker类库

composer require workerman/workerman-for-win
composer require workerman/GatewayWorker-for-win

安装完成后,目录结构如下:

ThinkPHP5与GatewayWorker集成(windows环境)_第1张图片

2. 编写代码

在application目录下,创建一个应用模块,模块名称为gatewayapp,其目录结构如下:

ThinkPHP5与GatewayWorker集成(windows环境)_第2张图片

controller/GwEvents.php文件,该文件是业务逻辑处理类,实际开发中,只需要关注这个文件即可。

 
 

你可能感兴趣的:(PHP,GatewayWorker,GatewayWorker,workerman,thinkphp)