Download the PHP package gw123/laravel-swoole without Composer
On this page you can find all versions of the php package gw123/laravel-swoole. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Please rate this library. Is it a good library?
Informations about the package laravel-swoole
[
]()
[
]()
目录说明
使用swoole加速laravel ,原有的项目代码无需变动! 原有的项目代码无需变动! 原有的项目代码无需变动!!!
- 使用swoole加速laravel
- 实现websocket和http会话同步机制 ,在websocket断线重连后可以方便的恢复原来的会话
安装
- 直接 composer require gw123/laravel-swoole
- 修改根目录下的脚本文件 smallApi 修改为自己的安装位置
运行方式1
- 修改app/Console/Kernel ,在$commands数组中添加 LaravelServer\ServerCommand::class.
- php artisan server 启动服务器
- php artisan stop 停止服务器
- php artisan restart 重启服务器
运行方式2
- chmod +x server
- ./smallApi start 启动服务
- ./smallApi stop 关闭服务
- ./smallApi reload 热重启服务,类似nginx reload
- ./smallApi restart 请求服务
- ./smallApi check 检测服务是否正常,这个命令可以配合一个 定时脚本用来检测服务是否正常,服务异常可以自动重启
可以将脚本放到 /etc/init.d目录下面 配合 chkconfig 命令实现开机自动运行 chkconfig --add smallApi
配置文件
demo文件夹 示例代码说明(下面代码直接 php scriptname 方式运行)
- baseServer 基础服务
- laravelServer 基于laravel框架的swoole服务器
- wsClient 模拟测试laraveServer服务器的websocket请求
webscoket 请求协议详细参考 wsClient代码
调试
- 将resource/debug.html 放到web目录下面
- http://youhost/debug.html
- 输入服务端网址 点击连接
- 发送调试信息到浏览器: \LaravelServer\SwooleLog::debug('not foung');
All versions of laravel-swoole with dependencies
PHP Build Version
Package Version
The package gw123/laravel-swoole contains the following files
Loading the files please wait ....