Skip to content
This repository was archived by the owner on Jan 27, 2026. It is now read-only.

Commit e35c3d9

Browse files
committed
Fix to work with node 6+, PHP 7+ and Xdebug 2.6
1 parent 623035e commit e35c3d9

12 files changed

Lines changed: 643 additions & 53 deletions

File tree

LICENSE

100755100644
File mode changed.

NOTES.md

100755100644
File mode changed.

README.md

100755100644
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
Xdebug (PHP Debugger) client written in JavaScript
22
==================================================
33

4-
*Status: dev*
5-
64
This project includes:
75

86
* An implementation of the [DBGP Protocol](http://www.xdebug.org/docs-dbgp.php):
@@ -25,7 +23,7 @@ Requirements
2523
* [node.js](http://nodejs.org/) & *npm*
2624
* Webserver with *PHP* support
2725
* [PHP 5.2+ / 7.0+](http://php.net/) *cli* and *webserver* support
28-
* [Xdebug 2.2.x](http://www.xdebug.org/) (see [Xdebug Install](http://www.xdebug.org/docs/install))
26+
* [Xdebug 2.2+](http://www.xdebug.org/) (see [Xdebug Install](http://www.xdebug.org/docs/install))
2927

3028
Install
3129
-------

TODO.md

Lines changed: 0 additions & 9 deletions
This file was deleted.

example/server.js

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,14 @@ const XDEBUG_PORT = 9000,
4141
//Set NODE_PATH in your environment instead (https://github.com/unconed/TermKit/issues/68)
4242
//require.paths.push('/usr/local/lib/node_modules');
4343

44-
var SYS = require("sys"),
44+
var CONSOLE = require("console"),
4545
CLI = require("cli"),
4646
Q = require("q"),
4747
PATH = require("path"),
4848
QS = require("querystring"),
4949
HTTP = require('http'),
5050
CONNECT = require("connect"),
51+
SERVE_STATIC = require('serve-static'),
5152
CONNECT_DISPATCH = require("dispatch"),
5253
SOCKET_IO = require("socket.io"),
5354
XDEBUG = require("../lib/xdebug"),
@@ -81,9 +82,9 @@ CLI.main(function(args, options)
8182

8283
function startServer(options)
8384
{
84-
var lastPing = false;
85+
var lastPing = false;
8586

86-
var app = CONNECT.createServer(
87+
var server = HTTP.createServer(
8788

8889
CONNECT_DISPATCH({
8990

@@ -119,12 +120,12 @@ function startServer(options)
119120
}
120121
},
121122

122-
"/.*": CONNECT.static(__dirname + '/client', { maxAge: 0 })
123+
"/.*": SERVE_STATIC(__dirname + '/client', { maxAge: 0 })
123124
})
124125
);
125126

126127
// Wrap connect app in http.server for socket.io to work (https://github.com/senchalabs/connect/issues/500)
127-
var server = HTTP.createServer(app);
128+
//var server = HTTP.createServer(app);
128129

129130
// If in test mode we stop when we are not pinged any more
130131
if (options.test)
@@ -139,12 +140,6 @@ function startServer(options)
139140

140141
var io = SOCKET_IO.listen(server);
141142

142-
io.set("log level", 0);
143-
if (options.verbose)
144-
io.set("log level", 2);
145-
if (options.debug)
146-
io.set("log level", 3);
147-
148143
// Initialize and hook in the debug proxy server so it can
149144
// communicate via `socket.io`.
150145

@@ -218,7 +213,7 @@ function startServer(options)
218213
var command = "node " + PATH.normalize(__dirname + "/../test/all --port " + options.port + " --php " + options.php);
219214
EXEC(command, function (error, stdout, stderr)
220215
{
221-
SYS.puts("[proxyServer] " + stdout.split("\n").join("\n[proxyServer] ") + "\n");
216+
CONSOLE.log("[proxyServer] " + stdout.split("\n").join("\n[proxyServer] ") + "\n");
222217
});
223218
});
224219
socket.emit("init", {
@@ -228,7 +223,7 @@ function startServer(options)
228223

229224
server.listen(options.port);
230225

231-
SYS.puts("Launched Xdebug proxy server on port " + options.port + "\n");
226+
CONSOLE.log("Launched Xdebug proxy server on port " + options.port + "\n");
232227
}
233228

234229
function runBrowserTest(test, timeout)

lib/dbgp.js

100755100644
File mode changed.

lib/proxy.js

100755100644
File mode changed.

lib/xdebug.js

100755100644
File mode changed.

0 commit comments

Comments
 (0)