workingDir, envp) : DebugPlugin.exec(cmdLine, null, envp);
// Attach a crash detector
new Thread(new ProcessCrashDetector(launch, p)).start();
IProcess process = null;
// add process type to process attributes
Map<String, String> processAttributes = new HashMap<String, String>();
String programName = phpExe.lastSegment();
String extension = phpExe.getFileExtension();
if (extension != null) {
programName = programName.substring(0, programName.length()
- (extension.length() + 1));
}
programName = programName.toLowerCase();
processAttributes.put(IProcess.ATTR_PROCESS_TYPE, programName);
if (p != null) {
subMonitor = new SubProgressMonitor(monitor, 80); // 10+80 of
// 100;
subMonitor
.beginTask(
MessageFormat
.format("start launch", new Object[] { configuration.getName() }), IProgressMonitor.UNKNOWN); //$NON-NLS-1$
process = DebugPlugin.newProcess(launch, p,
phpExe.toOSString(), processAttributes);
if (process == null) {
p.destroy();
throw new CoreException(new Status(IStatus.ERROR,
PHPDebugPlugin.getID(), 0, null, null));
}
subMonitor.done();
}
process.setAttribute(IProcess.ATTR_CMDLINE, fileName);
if (CommonTab.isLaunchInBackground(configuration)) {
// refresh resources after process finishes
/*
* if (RefreshTab.getRefreshScope(configuration) != null) {
* BackgroundResourceRefresher refresher = new
* BackgroundResourceRefresher(configuration, process);
* refresher.startBackgroundRefresh(); }
*/
} else {
// wait for process to exit
while (!process.isTerminated()) {
try {
if (monitor.isCanceled()) {
process.terminate();
break;
}
Thread.sleep(50);
} catch (InterruptedException e) {
}