From c6e192d5f54ebeb7c411e1e865fea6cb22780475 Mon Sep 17 00:00:00 2001 From: panders23 Date: Wed, 22 Jan 2020 15:09:23 +0100 Subject: [PATCH 1/3] add felixfbecker/vscode-php-debug --- install_gadget.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/install_gadget.py b/install_gadget.py index 9b6f56f..ef4b46a 100755 --- a/install_gadget.py +++ b/install_gadget.py @@ -291,6 +291,29 @@ GADGETS = { }, }, }, + 'vscode-php-debug': { + 'language': 'php', + 'enabled': False, + 'download': { + 'url': 'https://github.com/felixfbecker/vscode-php-debug/releases/download/' + '${version}/${file_name}', + }, + 'all': { + 'version': 'v1.13.0', + 'file_name': 'php-debug.vsix', + 'checksum': + '8a51e593458fd14623c1c89ebab87347b087d67087717f18bcf77bb788052718', + }, + 'adapters': { + 'vscode-php-debug': { + 'name': "php-debug", + 'command': [ + 'node', + "${gadgetDir}/vscode-php-debug/out/phpDebug.js", + ] + } + } + }, 'vscode-node-debug2': { 'language': 'node', 'enabled': False, From eda6b890de1de084fb1eba850c434da0af0a005b Mon Sep 17 00:00:00 2001 From: panders23 Date: Mon, 27 Jan 2020 20:22:55 +0100 Subject: [PATCH 2/3] add readme.md entry for php --- README.md | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) diff --git a/README.md b/README.md index 9ea76c1..62053c8 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,7 @@ For a tutorial and usage overview, take a look at the * [TCL](#tcl) * [C♯](#c) * [Go](#go) + * [PHP](#php) * [JavaScript, TypeScript, etc.](#javascript-typescript-etc) * [Java - partially supported](#java---partially-supported) * [FAQ](#faq) @@ -760,6 +761,77 @@ Requires: } ``` +## PHP + +This uses the php-debug, see +https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug + +Requires: + +* `install_gadget.py --force-enable-php` +* configured php xdebug extension +```ini +zend_extension=xdebug.so +xdebug.remote_enable=on +xdebug.remote_handler=dbgp +xdebug.remote_host=localhost +xdebug.remote_port=9000 +``` +replace `localhost` with the ip of your workstation. + +lazy alternative +```ini +zend_extension=xdebug.so +xdebug.remote_enable=on +xdebug.remote_handler=dbgp +xdebug.remote_connect_back=true +xdebug.remote_port=9000 +``` + +* .vimspectory.json +```json +{ + "configurations": { + "Listen for XDebug": { + "adapter": "vscode-php-debug", + "configuration": { + "name": "Listen for XDebug", + "type": "php", + "request": "launch", + "port": 9000, + "stopOnEntry": false, + "pathMappings": { + "/var/www/html": "${workspaceRoot}" + } + } + }, + "Launch currently open script": { + "adapter": "vscode-php-debug", + "configuration": { + "name": "Launch currently open script", + "type": "php", + "request": "launch", + "program": "${file}", + "cwd": "${fileDirname}", + "port": 9000 + } + } + } +} +``` + +### Debug web application +append `XDEBUG_SESSION_START=xdebug` to your query string +``` +curl "http://localhost?XDEBUG_SESSION_START=xdebug" +``` + +### Debug cli application +``` +export XDEBUG_CONFIG="idekey=xdebug" +php +``` + ## JavaScript, TypeScript, etc. * Node.js From da0fc6533395e30fc5929d1eea0871b45c03966f Mon Sep 17 00:00:00 2001 From: panders23 Date: Mon, 27 Jan 2020 20:35:26 +0100 Subject: [PATCH 3/3] Mention xdebug helper extension for php --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 62053c8..f2b1a76 100644 --- a/README.md +++ b/README.md @@ -768,6 +768,7 @@ https://marketplace.visualstudio.com/items?itemName=felixfbecker.php-debug Requires: +* (optional) Xdebug helper for chrome https://chrome.google.com/webstore/detail/xdebug-helper/eadndfjplgieldjbigjakmdgkmoaaaoc * `install_gadget.py --force-enable-php` * configured php xdebug extension ```ini @@ -825,6 +826,7 @@ append `XDEBUG_SESSION_START=xdebug` to your query string ``` curl "http://localhost?XDEBUG_SESSION_START=xdebug" ``` +or use the previously mentioned Xdebug Helper extension (which sets a `XDEBUG_SESSION` cookie) ### Debug cli application ```