https://github.com/atomicptr/php-dap
https://github.com/atomicptr/php-dap
Last synced: 3 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/atomicptr/php-dap
- Owner: atomicptr
- License: mit
- Created: 2025-03-12T09:17:14.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2025-05-13T09:58:09.000Z (9 months ago)
- Last Synced: 2025-10-19T20:42:30.665Z (4 months ago)
- Language: Dockerfile
- Size: 7.81 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# php-dap
A containerized wrapper to use the debug adapter from [vscode-php-debug](https://github.com/xdebug/vscode-php-debug) standalone in any DAP capable editor like for instance [Helix](https://helix-editor.com).
## Installation
You either use the php-dap bash script available in this repository or podman/docker directly:
```bash
$ docker run --rm --network=host ghcr.io/atomicptr/php-dap:latest
```
### Neovim
Assuming you are using [nvim-dap](https://github.com/mfussenegger/nvim-dap)
```lua
local dap = require "dap"
dap.adapters.php = {
type = "server",
port = "${port}",
executable = {
command = "docker",
args = { "run", "--rm", "--network=host", "ghcr.io/atomicptr/php-dap:latest", "--server=${port}" },
},
}
dap.configurations.php = {
{
type = "php",
request = "launch",
name = "Listen for Xdebug",
port = 9003,
-- if you are using xdebug from inside a container (e.g. using ddev)
-- you need to setup pathMappings
pathMappings = function()
local root = vim.fs.root(0, { "composer.json", ".git" })
return {
["/var/www/html"] = root,
}
end,
},
}
```
### Helix
In your Helix languages.toml add this:
```toml
[[language]]
name = "php"
[language.debugger]
name = "php-dap"
transport = "tcp"
command = "docker"
args = ["run", "--rm", "--network=host", "ghcr.io/atomicptr/php-dap:latest"]
port-arg = "--server={}"
[[language.debugger.templates]]
name = "Listen for Xdebug"
request = "launch"
completion = ["ignored"]
args = {}
```
## License
MIT