1 /**********************************************************************
2 Copyright (c) 2000, 2002 IBM Corp. and others.
3 All rights reserved. This program and the accompanying materials
4 are made available under the terms of the Common Public License v1.0
5 which accompanies this distribution, and is available at
6 http://www.eclipse.org/legal/cpl-v10.html
9 IBM Corporation - Initial implementation
10 Vicente Fernando - www.alfersoft.com.ar
11 **********************************************************************/
12 package net.sourceforge.phpdt.internal.launching;
14 //import java.io.OutputStream;
17 import org.eclipse.core.runtime.CoreException;
18 import org.eclipse.core.runtime.IProgressMonitor;
19 import org.eclipse.core.runtime.IStatus;
20 import org.eclipse.core.runtime.Status;
21 import org.eclipse.debug.core.DebugPlugin;
22 import org.eclipse.debug.core.ILaunch;
23 import org.eclipse.debug.core.ILaunchConfiguration;
24 import org.eclipse.debug.core.model.ILaunchConfigurationDelegate;
25 import org.eclipse.debug.core.model.LaunchConfigurationDelegate;
26 //import org.eclipse.debug.core.model.ILaunchConfigurationDelegate;
29 public class PHPLaunchConfigurationDelegate extends LaunchConfigurationDelegate {
30 protected static final InterpreterRunner interpreterRunner = new InterpreterRunner();
31 protected static final DebuggerRunner debuggerRunner = new DebuggerRunner();
33 /* public PHPLaunchConfigurationDelegate() {
38 * @see ILaunchConfigurationDelegate#launch(ILaunchConfiguration, String, ILaunch, IProgressMonitor)
40 public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException {
41 if (PHPRuntime.getDefault().getSelectedInterpreter() == null)
42 throw new CoreException(new Status(IStatus.ERROR, PHPLaunchingPlugin.PLUGIN_ID, IStatus.OK, "You must define an interpreter before running PHP.", null));
44 InterpreterRunnerConfiguration conf=new InterpreterRunnerConfiguration(configuration);
45 conf.setEnvironment(DebugPlugin.getDefault().getLaunchManager().getEnvironment(configuration));
46 if (mode.equals("debug")) {
47 debuggerRunner.run(conf, launch);
49 interpreterRunner.run(conf, launch);