catpaw/dialog

A php CatPaw Dialog 辅助工具

该软件包的官方仓库似乎已丢失,因此软件包已被冻结。

1.0.9 2023-12-23 19:40 UTC

This package is auto-updated.

Last update: 2023-12-23 19:41:20 UTC


README

为了使用 vscode 进行调试,您需要配置 vscode 和 xdebug (3.x)。

VSCode 配置

在您的项目中创建一个新的 ./.vscode/launch.json 文件,并添加以下配置(如果您还没有的话)

{
  "version": "0.2.0",
  "configurations": [
    {
      "name": "Listen (paw)",
      "type": "php",
      "request": "launch",
      "port": 9003,
      "runtimeArgs": ["-dxdebug.start_with_request=yes", "-dxdebug.mode=debug"]
    },
    {
      "name": "Launch (paw)",
      "type": "php",
      "request": "launch",
      "program": "${workspaceFolder}/vendor/catpaw/core/scripts/start.php",
      "cwd": "${workspaceFolder}",
      "args": ["${file}"],
      "port": 0,
      "runtimeArgs": ["-dxdebug.start_with_request=yes", "-dxdebug.mode=debug"],
      "env": {
        "XDEBUG_MODE": "debug",
        "XDEBUG_CONFIG": "client_port=${port}"
      }
    }
  ]
}

第一个配置将被动监听 xdebug,而第二个配置将启动当前打开的脚本。

VSCode 的 XDebug 3.x 配置

在您的 php.ini 文件中添加

[xdebug]
xdebug.client_host=127.0.0.1
xdebug.client_port=9003

使用 PHPStorm 进行调试

如果您正在使用 PHPStorm,您需要开始监听 PHP Xdebug 连接。

首先选择您的 php 解释器

image

然后开始监听 xdebug 连接: image

PHPStorm 的 XDebug 3.x 配置

xdebug.mode=debug
xdebug.client_host=127.0.0.1
xdebug.client_port=9003
xdebug.start_with_request=yes

运行 & 观察

现在您应该能够使用以下命令在生产模式下运行您的项目

./start

或者使用以下命令在观察模式下运行

./watch

并且在这两种模式下,使用 vscode 和 phpstorm 监听 xdebug 连接进行调试。