- 服务启动与管理
- 帮助命令
- HTTP 服务器
- WebSocket服务器
- RPC 服务器
服务启动与管理
Swoft 拥有完善的命令行工具,和相应的服务器管理命令
帮助命令
[root@swoft]# php bin/swoft -hConsole application description (Version: 2.0.0)Usage:bin/swoft COMMAND [arg0 arg1 arg2 ...] [--opt -v -h ...]Options:--debug Setting the application runtime debug level(0 - 4)--no-color Disable color/ANSI for message output-h, --help Display this help message-V, --version Show application version information--expand Expand sub-commands for all command groupsAvailable Commands:docs Class DocsCommandhttp Provide some commands to manage the swoft HTTP Server(alias: httpserver,httpServer,http-server)rpc Class ServiceServerCommandtest Class TestCommandws Provide some commands to operate swoft WebSocket Server(alias: ws-server,wsserver,websocket)More command information, please use: bin/swoft COMMAND -h
HTTP 服务器
// 启动服务php bin/swoft start// 守护进程启动php bin/swoft start -d// 重启php bin/swoft restart// 重新加载php bin/swoft reload// 关闭服务php bin/swoft stop
WebSocket服务器
启动WebSocket服务器,可选是否 同时支持http处理
// 启动服务php bin/swoft ws:start// 守护进程启动php bin/swoft ws:start -d// 重启php bin/swoft ws:restart// 重新加载php bin/swoft ws:reload// 关闭服务php bin/swoft ws:stop
RPC 服务器
使用独立的RPC服务器
// 启动服务php bin/swoft rpc:start// 守护进程启动php bin/swoft rpc:start -d// 重启php bin/swoft rpc:restart// 重新加载php bin/swoft rpc:reload// 关闭服务php bin/swoft rpc:stop
