Not in this alpha
This feature is not included in Tyhp 805.0.0-alpha.1 (roadmap Tier 2/3). The rest of this page describes the planned design. Do not expect these commands or syntax to work yet.
Tier 2 · Story 18Planned
This feature is not included in Tyhp 805.0.0-alpha.1 (roadmap Tier 2/3). The rest of this page describes the planned design. Do not expect these commands or syntax to work yet.
The xdebug_proxy action starts a proxy server that sits between your IDE's debugger and PHP's XDebug extension. It uses source maps to translate between compiled PHP file paths and line numbers and their corresponding Tyhp source locations, allowing you to debug your original .tyhp source files while PHP executes the compiled output.
tyhp xdebug_proxy [options]
The XDebug proxy operates as a bidirectional message relay using the DBGp protocol. It opens two TCP listening ports:
When both sides connect, the proxy pairs them into a debug session and relays all DBGp messages between them. For each message, it inspects the content and translates file paths and line numbers using the source maps generated during tyhp build.
The proxy performs the following translations:
Files without source maps (such as third-party PHP libraries) pass through untranslated — their paths and line numbers appear as-is from XDebug.
To use the XDebug proxy, configure XDebug to connect to the proxy's XDebug port instead of directly to your IDE, and configure your IDE to connect to the proxy's IDE port.
Enable source map generation in your tyhp.json and build your project:
{
"build": {
"generateSourcemap": true
}
}
tyhp build
In your php.ini or xdebug.ini, point XDebug at the proxy's XDebug port:
xdebug.mode = debug
xdebug.client_host = 127.0.0.1
xdebug.client_port = 9004
xdebug.idekey = tyhp
tyhp xdebug_proxy
The proxy displays the listening ports and the number of source map files loaded:
XDebug Proxy started
IDE port: 9003
XDebug port: 9004
Sourcemaps: 42 files loaded from ./build/
Source root: ./src/
IDE key: (any)
Configure your IDE's debugger to connect to the proxy's IDE port (9003 by default). For VS Code, add a launch.json configuration:
{
"name": "Debug Tyhp (via proxy)",
"type": "php",
"request": "launch",
"port": 9003
}
Proxy settings can also be configured in the xdebugProxy section of tyhp.json:
{
"xdebugProxy": {
"idePort": 9003,
"xdebugPort": 9004,
"ideKey": null,
"maxSessions": 10,
"logLevel": "info",
"autoReloadSourceMaps": true
}
}
Set logLevel to "debug" to see every DBGp message flowing through the proxy, including all path translations. This is helpful for troubleshooting breakpoint mapping issues.
The XDebug proxy is a long-running process. Use Ctrl+C to stop it gracefully. It will close all active debug sessions and release the listening ports.