import org.eclipse.core.runtime.Platform;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunch;
-import org.eclipse.debug.core.ILaunchManager;
-import org.eclipse.debug.core.Launch;
import org.eclipse.debug.core.model.IProcess;
public class InterpreterRunner {
public InterpreterRunner() {
}
- public IProcess run(InterpreterRunnerConfiguration configuration, ILaunch launch) {
- String commandLine = renderCommandLine(configuration);
+ public IProcess run(InterpreterRunnerConfiguration configuration, ILaunch launch) {
+ String commandLine = renderCommandLine(configuration);
File workingDirectory = configuration.getAbsoluteWorkingDirectory();
-
+
setEnvironmentVariables(configuration);
String[] env = configuration.getEnvironment();
Process nativePHPProcess = null;
IProcess process = DebugPlugin.newProcess(launch, nativePHPProcess, renderLabel(configuration));
process.setAttribute(PHPLaunchingPlugin.PLUGIN_ID + ".launcher.cmdline", commandLine);
process.setAttribute(IProcess.ATTR_PROCESS_TYPE, PHPLaunchConfigurationAttribute.PHP_LAUNCH_PROCESS_TYPE);
-
+
return process ;
}
return buffer.toString();
}
-
+
protected void setEnvironmentVariables(InterpreterRunnerConfiguration configuration) {
IPath FilePath= new Path(configuration.getAbsoluteFileName());
String OSFilePath= FilePath.toOSString();
configuration.addEnvironmentValue("GATEWAY_INTERFACE","CGI / 1.1",true);
configuration.addEnvironmentValue("REQUEST_METHOD","GET",true);
-
+
Map stringVars = DebugPlugin.getDefault().getLaunchManager().getNativeEnvironment();
if (stringVars.containsKey("SYSTEMROOT"))
configuration.addEnvironmentValue("SYSTEMROOT",(String) stringVars.get("SYSTEMROOT"),true);
-
+
}
protected String renderLoadPath(InterpreterRunnerConfiguration configuration) {
return aPath;
}
-
+
protected String getDebugCommandLineArgument() {
- return "" ;
- }
+ return "" ;
+ }
}