swoft修改文件后重启

a.Swoft-cli
1.下载

wget https://github.com/swoft-cloud/swoft-cli/releases/download/{VERSION}/swoftcli.phar
注意:你需要替换 {VERSION} 部分为最新版本。

wget https://github.com/swoft-cloud/swoft-cli/releases/download/v0.2.0/swoftcli.phar

2.测试
命令:

php swoftcli.phar -V

结果:

Command line tool application for quick use swoft (Version: 0.1.6)


/ / ______ / _/ / / / / / /
_
| /| / / __ / /
/ / / / / / / /
__/ / |/ |/ / // / / / / /
/ /
/ /
/
/|/|/_// _/ _///

PHP: 7.2.30, Swoft: 2.0.8, Swoole: 4.5.0

3.文件转移到bin目录
命令:

mv swoftcli.phar /usr/local/bin/swoftcli

测试报错

swoftcli -V
-bash: /usr/local/bin/swoftcli: Permission denied

修改权限
命令:

chmod a+x /usr/local/bin/swoftcli

再次测试

swoftcli -V
?? Command line tool application for quick use swoft (Version: 0.1.6)


/ / ______ / _/ / / / / / /
_
| /| / / __ / /
/ / / / / / / /
__/ / |/ |/ / // / / / / /
/ /
/ /
/
/|/|/_// _/ _///

PHP: 7.2.30, Swoft: 2.0.8, Swoole: 4.5.0

b. 热重启
命令:

swoftcli run -c http:start
结果:

Work Information
current pid 2592
current dir /root/Swoft
php binFile /usr/l
**/bin/php
target path /root//Swoft
watch dirs app, config
entry file /root/
/bin/swoft
execute cmd /usr/l
*******Swoft/bin/swoft http:start

Watched Directories
/root//Swoft/app
/root/
*/Swoft/config

2020/05/05-07:04:47 [SWOFTCLI] Start swoft server
2020/05/05-15:04:47 [INFO] SwoftSwoftApplication:setSystemAlias(417) Project path: @base=/root/myproject/Swoft
2020/05/05-15:04:47 [INFO] SwoftSwoftApplication:setSystemAlias(418) Set alias @app=@base/app
2020/05/05-15:04:47 [INFO] SwoftSwoftApplication:setSystemAlias(419) Set alias @config=@base/config
2020/05/05-15:04:47 [INFO] SwoftSwoftApplication:setSystemAlias(420) Set alias @runtime=@base/runtime
2020/05/05-15:04:47 [INFO] SwoftProcessorEnvProcessor:handle(60) Env file(/root/myproject/Swoft/.env) is loaded
2020/05/05-15:04:48 [INFO] SwoftProcessorAnnotationProcessor:handle(45) Annotations is scanned(autoloader 36, annotation 472, parser 93)
2020/05/05-15:04:48 [INFO] SwoftProcessorBeanProcessor:handle(53) Bean is initialized(singleton 330, prototype 79, definition 50)
2020/05/05-15:04:48 [INFO] SwoftProcessorBeanProcessor:handle(57) Config path is /root/myproject/Swoft/config
2020/05/05-15:04:48 [INFO] SwoftProcessorBeanProcessor:handle(62) Config env is not setting
2020/05/05-15:04:48 [INFO] SwoftProcessorEventProcessor:handle(35) Event manager initialized(66 listener, 4 subscriber)
2020/05/05-15:04:48 [INFO] SwoftWebSocketServerListenerAppInitCompleteListener:handle(44) WebSocket server route registered(module 3, message command 14)
2020/05/05-15:04:48 [INFO] SwoftTcpServerListenerAppInitCompleteListener:handle(45) Tcp server route registered(routes 4)
2020/05/05-15:04:48 [INFO] SwoftErrorListenerAppInitCompleteListener:handle(34) Error manager init completed(4 type, 5 handler, 5 exception)
2020/05/05-15:04:48 [INFO] SwoftProcessorConsoleProcessor:handle(36) Console command route registered (group 14, command 44)


/ / _____ / / / / /__ ___ _ ___ _ _____ / / | | / _
_ | |/|/ / _ / / __/ / // __/ _ `/ ‘ / -) |/|/ / _ / __/ ‘/ / __/
/ // /
//|,/_// _/ // // _,////__/|,/__// //_ /()/
SERVER INFORMATION(v2.0.9)


  • HTTP | Listen: 0.0.0.0:9502, Mode: Process, Worker: 6, Task worker: 12

HTTP Server Start Success!
2020/05/05-15:04:48 [INFO] SwoftServerServer:startSwoole(491) SwooleRuntime::enableCoroutine
2020/05/05-15:04:48 [INFO] SwoftListenerBeforeStartListener:handle(27) Server extra info: pidFile @runtime/swoft.pid
2020/05/05-15:04:48 [INFO] SwoftListenerBeforeStartListener:handle(28) Registered swoole events:
start, shutdown, managerStart, managerStop, workerStart, workerStop, workerError, request, task, finish
Server start success (Master PID: 2594, Manager PID: 2600)

文件改变,自动重启

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值