You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* DBGP Proxy support.
* Change protocol encoding to utf-8.
* Fix package.json capabilities Untrusted Workspace.
* Compatibility hack between pydbgpproxy and official dbgpProxy.
* Changed setting title and keys to "php.debug". Populate ideKey in resolveDebugConfiguration.
* More detailed errors for debugging socket close cases.
Co-authored-by: Alvaro Pareja-Lecaros <[email protected]>
Co-authored-by: towhidabsar <[email protected]>
Copy file name to clipboardExpand all lines: README.md
+17-1Lines changed: 17 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -65,7 +65,7 @@ There are also configurations for Xdebug v2 (Legacy) installations.
65
65
66
66
More general information on debugging with VS Code can be found on https://code.visualstudio.com/docs/editor/debugging.
67
67
68
-
> _Note:_ You can even debug a script without `launch.json`. If no folder is open, and the VS Code status bar is purple, pressing `F5` will start the open script with Xdebug3 specific parameters. If the php executable is not in path, you can provide it with the setting `php.executablePath` or a fallback `php.validate.executablePath`. For debugging to work, Xdebug must still be correctly installed.
68
+
> _Note:_ You can even debug a script without `launch.json`. If no folder is open, and the VS Code status bar is purple, pressing `F5` will start the open script with Xdebug3 specific parameters. If the php executable is not in path, you can provide it with the setting `php.debug.executablePath`. For debugging to work, Xdebug must still be correctly installed.
69
69
70
70
#### Supported launch.json settings:
71
71
@@ -77,6 +77,13 @@ More general information on debugging with VS Code can be found on https://code.
77
77
-`log`: Whether to log all communication between VS Code and the adapter to the debug console. See _Troubleshooting_ further down.
78
78
-`ignore`: An optional array of glob patterns that errors should be ignored from (for example `**/vendor/**/*.php`)
79
79
-`maxConnections`: Accept only this number of parallel debugging sessions. Additional connections will be dropped and their execution will continue without debugging.
80
+
-`proxy`: DBGp Proxy settings
81
+
-`enable`: To enable proxy registration set to `true` (default is `false).
82
+
-`host`: The address of the proxy. Supports host name, IP address, or Unix domain socket (default: 127.0.0.1).
83
+
-`port`: The port where the adapter will register with the the proxy (default: `9001`).
84
+
-`key`: A unique key that allows the proxy to match requests to your editor (default: `vsc`). The default is taken from VSCode settings `php.debug.idekey`.
85
+
-`timeout`: The number of milliseconds to wait before giving up on the connection to proxy (default: `3000`).
86
+
-`allowMultipleSessions`: If the proxy should forward multiple sessions/connections at the same time or not (default: `true`).
80
87
-`xdebugSettings`: Allows you to override Xdebug's remote debugging settings to fine tuning Xdebug to your needs. For example, you can play with `max_children` and `max_depth` to change the max number of array and object children that are retrieved and the max depth in structures like arrays and objects. This can speed up the debugger on slow machines.
81
88
For a full list of feature names that can be set please refer to the [Xdebug documentation](https://xdebug.org/docs-dbgp.php#feature-names).
82
89
-`max_children`: max number of array or object children to initially retrieve
@@ -110,6 +117,7 @@ Options specific to CLI debugging:
110
117
- Watches
111
118
- Run as CLI
112
119
- Run without debugging
120
+
- DBGp Proxy registration and unregistration support
113
121
114
122
## Remote Host Debugging
115
123
@@ -127,6 +135,14 @@ To make VS Code map the files on the server to the right files on your local mac
127
135
128
136
Please also note that setting any of the CLI debugging options will not work with remote host debugging, because the script is always launched locally. If you want to debug a CLI script on a remote host, you need to launch it manually from the command line.
129
137
138
+
## Proxy support
139
+
140
+
The debugger can register itself to a DBGp proxy with a IDE Key. The proxy will then forward to the IDE only those DBGp sessions that have this specified IDE key. This is helpful in a multiuser environment where developers cannot use the same DBGp port at the same time. Careful setup is needed that requests to the web server contain the matching IDE key.
141
+
142
+
The official implementation of the [dbgpProxy](https://xdebug.org/docs/dbgpProxy).
143
+
144
+
A _Xdebug helper_ browser extension is also recommended. There the request side IDE key can be easily configured.
145
+
130
146
## Troubleshooting
131
147
132
148
- Ask a question on [StackOverflow](https://stackoverflow.com/)
Copy file name to clipboardExpand all lines: package.json
+52-11Lines changed: 52 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -146,6 +146,15 @@
146
146
"onDebugResolve:php",
147
147
"onCommand:php.debug.debugPhpFile"
148
148
],
149
+
"capabilities": {
150
+
"untrustedWorkspaces": {
151
+
"supported": "limited",
152
+
"description": "%workspaceTrust%",
153
+
"restrictedConfigurations": [
154
+
"php.debug.executablePath"
155
+
]
156
+
}
157
+
},
149
158
"contributes": {
150
159
"breakpoints": [
151
160
{
@@ -250,6 +259,41 @@
250
259
"type": "boolean",
251
260
"description": "If true, will log all communication between VS Code and the adapter"
252
261
},
262
+
"proxy": {
263
+
"type": "object",
264
+
"properties": {
265
+
"allowMultipleSessions": {
266
+
"type": "boolean",
267
+
"description": "If the proxy should expect multiple sessions/connections or not.",
268
+
"default": true
269
+
},
270
+
"enable": {
271
+
"type": "boolean",
272
+
"description": "Whether to enable usage of a proxy",
273
+
"default": false
274
+
},
275
+
"host": {
276
+
"type": "string",
277
+
"description": "Selects the host where the debug client is running, you can either use a host name, IP address, or 'unix:///path/to/sock' for a Unix domain socket. This setting is ignored if xdebug.remote_connect_back is enabled.",
278
+
"default": "127.0.0.1"
279
+
},
280
+
"key": {
281
+
"type": "string",
282
+
"description": "A unique key that allows the proxy to match requests to your editor",
283
+
"default": "${config:php.debug.ideKey}"
284
+
},
285
+
"port": {
286
+
"type": "number",
287
+
"description": "The port where the adapter will register with the the proxy.",
288
+
"default": 9001
289
+
},
290
+
"timeout": {
291
+
"type": "number",
292
+
"description": "The port where the adapter will register with the the proxy.",
293
+
"default": 3000
294
+
}
295
+
}
296
+
},
253
297
"xdebugSettings": {
254
298
"type": "object",
255
299
"properties": {
@@ -412,28 +456,25 @@
412
456
}
413
457
],
414
458
"configuration": {
415
-
"title": "PHP",
459
+
"title": "PHP Debug",
416
460
"properties": {
417
-
"php.executablePath": {
461
+
"php.debug.executablePath": {
418
462
"type": [
419
463
"string",
420
464
"null"
421
465
],
422
466
"default": null,
423
467
"description": "The path to a PHP executable.",
424
468
"scope": "machine-overridable"
469
+
},
470
+
"php.debug.ideKey": {
471
+
"type": "string",
472
+
"default": "vsc",
473
+
"description": "A unique key that allows the proxy to match requests to your editor. Only used when proxy configuration includes replacement.",
0 commit comments