Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ language: php

php:
- '5.6'
- '7.0'
- '7.1'
env:
global:
- NODE_VERSION=8.9.3
Expand Down Expand Up @@ -45,11 +45,17 @@ jobs:
before_install:
# Fix ruby error https://github.com/Homebrew/brew/issues/3299
- brew update
- brew install [email protected]
- brew link --force --overwrite [email protected]
- brew install [email protected]
- brew link --force --overwrite [email protected]
- mkdir -p /usr/local/etc/php/7.1/conf.d
- cp travis-php.ini /usr/local/etc/php/7.1/conf.d/
# see per https://javorszky.co.uk/2018/05/03/getting-xdebug-working-on-php-7-2-and-homebrew/
# avoid problems with brew's symlink and pecl's recursive mkdir
- rm /usr/local/Cellar/[email protected]/7.1.26/pecl
- pecl install xdebug-$XDEBUG_VERSION
- mkdir -p /usr/local/etc/php/7.0/conf.d
- cp travis-php.ini /usr/local/etc/php/7.0/conf.d/
# make xdebug.so available at pecl's expected location
- ln -s /usr/local/Cellar/[email protected]/7.1.26/pecl/ /usr/local/lib/php/pecl
- php -i
- source ~/.nvm/nvm.sh
- nvm install $NODE_VERSION
- nvm use $NODE_VERSION
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ In your project, go to the debugger and hit the little gear icon and choose _PHP
#### Supported launch.json settings:

- `request`: Always `"launch"`
- `hostname`: The address to bind to when listening for XDebug (default: all IPv6 connections if available, else all IPv4 connections)
- `port`: The port on which to listen for XDebug (default: `9000`)
- `stopOnEntry`: Wether to break at the beginning of the script (default: `false`)
- `pathMappings`: A list of server paths mapping to the local source paths on your machine, see "Remote Host Debugging" below
Expand Down
5 changes: 5 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,11 @@
"description": "Environment variables passed to the program.",
"default": {}
},
"hostname": {
"type": "string",
"description": "Address to bind to when listening for XDebug",
"default": "::"
},
"port": {
"type": "number",
"description": "Port on which to listen for XDebug",
Expand Down
8 changes: 7 additions & 1 deletion src/phpDebug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ function formatPropertyValue(property: xdebug.BaseProperty): string {
* This interface should always match the schema found in the mock-debug extension manifest.
*/
interface LaunchRequestArguments extends VSCodeDebugProtocol.LaunchRequestArguments {
/** The address to bind to for listening for XDebug connections (default: all IPv6 connections if available, else all IPv4 connections) */
hostname?: string
/** The port where the adapter should listen for XDebug connections (default: 9000) */
port?: number
/** Automatically stop target after launch. If not specified, target does not stop. */
Expand Down Expand Up @@ -310,7 +312,11 @@ class PhpDebugSession extends vscode.DebugSession {
this.sendEvent(new vscode.OutputEvent(util.inspect(error) + '\n'))
this.sendErrorResponse(response, <Error>error)
})
server.listen(args.port || 9000, (error: NodeJS.ErrnoException) => (error ? reject(error) : resolve()))
server.listen(
args.port || 9000,
args.hostname,
(error: NodeJS.ErrnoException) => (error ? reject(error) : resolve())
)
})
try {
if (!args.noDebug) {
Expand Down