Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/swoole/debugger
Swoole 远程调试器
https://github.com/swoole/debugger
Last synced: 2 months ago
JSON representation
Swoole 远程调试器
- Host: GitHub
- URL: https://github.com/swoole/debugger
- Owner: swoole
- License: apache-2.0
- Created: 2016-04-18T08:37:27.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2021-05-20T09:28:50.000Z (over 3 years ago)
- Last Synced: 2024-08-19T02:53:38.204Z (5 months ago)
- Language: PHP
- Homepage:
- Size: 28.3 KB
- Stars: 78
- Watchers: 9
- Forks: 16
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-swoole - swoole/debugger - A remote debugger of Swoole. By adding one-line of code, you can debug your application remotely using a rich list of commands. :globe_with_meridians: (Debugging and Profiling)
README
# 为 Swoole Server 设计的远程终端
基于`swoole-1.8`的多协议特性实现,业务无需做任何修改,只需要加一行代码即可引入一个功能强大的远程终端。
## 安装
```shell
composer require swoole/debugger
```## 注册 Shell 到 Swoole Server 对象
* 建议只监听本机`127.0.0.1`或局域网`192.168.1.100`
```php
\Swoole\Debugger\RemoteShell::listen($serv, '127.0.0.1', 9599);
```## 连接到远程终端
```shell
htf@htf-All-Series:~/workspace/proj/remote-shell/tests$ telnet 127.0.0.1 9599
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
p|print [variable] 打印一个PHP变量的值
e|exec [code] 执行一段PHP代码
w|worker [id] 切换Worker进程
l|list 打印服务器所有连接的fd
s|stats 打印服务器状态
c|coros 打印协程列表
cs|costats 打印协程状态
el|elapsed [cid] 打印某个协程运行的时间
tl|timer_list 打印当前进程中所有定时器ID
ti|timer_info [timer_id] 打印某个定时器信息
ts|timer_stats 打印当前进程中的定时器状态
b|bt [cid] 打印某个协程调用栈
i|info [fd] 显示某个连接的信息
h|help 显示帮助界面
q|quit 退出终端
#2>
```