DBGInt.setShouldStop (); // Notify the DBG interface to stop the waiting for response
}
- if (!remote) { // If it's not a remote proxy session
- try {
- getDebugTarget ().getProcess ().terminate (); //
- } catch (DebugException e) {
- e.printStackTrace ();
- }
- }
+// if (!remote) { // If it's not a remote proxy session
+// try {
+// getDebugTarget ().getProcess ().terminate (); //
+// } catch (DebugException e) {
+// e.printStackTrace ();
+// }
+// }
phpLoop.notifyWait ();
}
+
+ public void setTerminated () {
+ try {
+ PHPMainThread.terminate ();
+ }
+ catch (DebugException e) {
+ }
+ }
/**
* TODO Is this method called from anywhere?
}
/**
- *
- * TODO The example for setting up DBG within PHP.ini shows ports from 10000 to 10016 ???
- * if my interpretation is correct.
- * How can we find the correct DBG port?
+ * Find a free unused port between 10001 and 10101 if the current debug session
+ * is for remote debugging, and a unused port 7869 if it is used as non remote debugging.
+ *
+ * For remote debugging the used port is submitted with the URL.
+ * E.g. http://localhost/index.php?DBGSESSID=1@localhost:10001
+ * For non remote debugging (if PHPeclipse used e.g. php cli directly) no port
+ * can be submitted by parameter, and only the default port (7869) can be used.
+ *
+ * @note: The free dbg version doesn't allow to set the appropriate port within php.ini!
+ *
+ *
*/
protected void createServerSocket () {
- port = SocketUtil.findUnusedLocalPort ("localhost", 10001, 10101); // Get the first free port in the range from 10001 to 10101
-
-// port = 10001;
+ if (this.remote) {
+ port = SocketUtil.findUnusedLocalPort ("localhost", 10001, 10101); // Get the first free port in the range from 10001 to 10101
+ }
+ else {
+ port = SocketUtil.findUnusedLocalPort ("localhost", 7869, 7869); // Get the first free port in the range from 7869 to 7869
+ }
+
if (port == -1) { // Did we get a free port?
PHPDebugCorePlugin.log (5, "Cannot find free port!!!!"); // No, output a error message
//System.out.println("ServerSocket on port: " + port);
}
} catch (IOException e) {
- // IO Error
PHPDebugCorePlugin.log (e);
stop ();
}
}
/**
+ * Get the DBG interface which is linked to this proxy
+ *
+ * @paran DBGInt The DGB interface which is linked with this proxy
+ */
+ public PHPDBGInterface getDBGInterface () {
+ return DBGInt;
+ }
+
+ /**
* Give back a buffered input stream for the socket which is
* linked with this proxy
*/
filename = phpLBP.getMarker().getResource().getProjectRelativePath();
filename = remoteSourcePath.append (filename);
} else {
- filename = phpLBP.getMarker().getResource().getLocation();
+ filename = phpLBP.getMarker().getResource().getFullPath();
}
String path = filename.toOSString();
localPath = new Path (local); // Get the remote/server side path of the mapping
if (localPath.isPrefixOf (filename)) { // Starts the remote/server side file path with the remote/server side mapping path
- // dann prefix abhängen und den remote path davorhägen
+ // dann prefix abh�ngen und den remote path davorh�gen
newpath = filename.removeFirstSegments (localPath.matchingFirstSegments (filename));
newpath = remotePath.append (newpath);
path = newpath.toString ();
}
/**
- *
+ * Is called by the DebuggerRunner
+ *
* @param debugTarget
*/
public void setDebugTarget (PHPDebugTarget debugTarget) {