From: khartlage Date: Sun, 29 Dec 2002 18:56:33 +0000 (+0000) Subject: This commit was generated by cvs2svn to compensate for changes in r59, X-Git-Url: http://git.phpeclipse.com This commit was generated by cvs2svn to compensate for changes in r59, which included commits to RCS files with non-trunk default branches. --- diff --git a/net.sourceforge.phpeclipse.launching/.classpath b/net.sourceforge.phpeclipse.launching/.classpath new file mode 100644 index 0000000..40e8710 --- /dev/null +++ b/net.sourceforge.phpeclipse.launching/.classpath @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + diff --git a/net.sourceforge.phpeclipse.launching/.project b/net.sourceforge.phpeclipse.launching/.project new file mode 100644 index 0000000..6472dbe --- /dev/null +++ b/net.sourceforge.phpeclipse.launching/.project @@ -0,0 +1,29 @@ + + + net.sourceforge.phpeclipse.launching + + + net.sourceforge.phpeclipse + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.pde.PluginNature + + diff --git a/net.sourceforge.phpeclipse.launching/.template b/net.sourceforge.phpeclipse.launching/.template new file mode 100644 index 0000000..d65e0f4 --- /dev/null +++ b/net.sourceforge.phpeclipse.launching/.template @@ -0,0 +1,4 @@ + +
+

Tips on working with this plug-in project

  • For the view of the new plug-in at a glance, go to the Overview.
  • You can test the contributions of this plug-in by launching another instance of the workbench. On the Run menu, click Run As and choose Run-time Workbench from the available choices.
  • You can add more functionality to this plug-in by adding extensions using the New Extension Wizard.
  • The plug-in project contains Java code that you can debug. Place breakpoints in Java classes. On the Run menu, select Debug As and choose Run-time Workbench from the available choices.
  • +
    diff --git a/net.sourceforge.phpeclipse.launching/build.properties b/net.sourceforge.phpeclipse.launching/build.properties new file mode 100644 index 0000000..c95a801 --- /dev/null +++ b/net.sourceforge.phpeclipse.launching/build.properties @@ -0,0 +1 @@ +source.launch.jar = src/ diff --git a/net.sourceforge.phpeclipse.launching/build.xml b/net.sourceforge.phpeclipse.launching/build.xml new file mode 100644 index 0000000..53bb0b1 --- /dev/null +++ b/net.sourceforge.phpeclipse.launching/build.xml @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/net.sourceforge.phpeclipse.launching/plugin.properties b/net.sourceforge.phpeclipse.launching/plugin.properties new file mode 100644 index 0000000..973f149 --- /dev/null +++ b/net.sourceforge.phpeclipse.launching/plugin.properties @@ -0,0 +1,3 @@ + +Plugin.name=PHPEclipse Launching Support +LaunchConfigurationTypePHPApplication.name=PHP Application \ No newline at end of file diff --git a/net.sourceforge.phpeclipse.launching/plugin.xml b/net.sourceforge.phpeclipse.launching/plugin.xml new file mode 100644 index 0000000..2f39512 --- /dev/null +++ b/net.sourceforge.phpeclipse.launching/plugin.xml @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/InterpreterRunner.java b/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/InterpreterRunner.java new file mode 100644 index 0000000..5e76ed5 --- /dev/null +++ b/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/InterpreterRunner.java @@ -0,0 +1,90 @@ +package net.sourceforge.phpdt.internal.launching; + +import java.io.File; +import java.io.IOException; +import java.util.Iterator; + +import net.sourceforge.phpeclipse.resourcesview.PHPProject; +import org.eclipse.core.boot.BootLoader; +import org.eclipse.core.resources.IProject; +import org.eclipse.debug.core.DebugPlugin; +import org.eclipse.debug.core.ILaunch; +import org.eclipse.debug.core.model.IProcess; + +public class InterpreterRunner { + + public InterpreterRunner() { + } + + public IProcess run(InterpreterRunnerConfiguration configuration, ILaunch launch) { + String commandLine = renderCommandLine(configuration); + File workingDirectory = configuration.getAbsoluteWorkingDirectory(); + + Process nativePHPProcess = null; + try { + nativePHPProcess = configuration.getInterpreter().exec(commandLine, workingDirectory); + } catch (IOException e) { + throw new RuntimeException("Unable to execute interpreter: " + commandLine + workingDirectory); + } + + IProcess process = DebugPlugin.getDefault().newProcess(launch, nativePHPProcess, renderLabel(configuration)); + process.setAttribute(PHPLaunchingPlugin.PLUGIN_ID + ".launcher.cmdline", commandLine); + return process ; + } + + protected String renderLabel(InterpreterRunnerConfiguration configuration) { + StringBuffer buffer = new StringBuffer(); + + PHPInterpreter interpreter = configuration.getInterpreter(); + buffer.append("PHP "); + buffer.append(interpreter.getCommand()); + buffer.append(" : "); + buffer.append(configuration.getFileName()); + + return buffer.toString(); + } + + protected String renderCommandLine(InterpreterRunnerConfiguration configuration) { + PHPInterpreter interpreter = configuration.getInterpreter(); + + StringBuffer buffer = new StringBuffer(); + buffer.append(this.getDebugCommandLineArgument()); + // buffer.append(renderLoadPath(configuration)); + buffer.append(" " + configuration.getInterpreterArguments()); + // buffer.append(interpreter.endOfOptionsDelimeter); + buffer.append(" " + osDependentPath(configuration.getAbsoluteFileName())); + buffer.append(" " + configuration.getProgramArguments()); + + return buffer.toString(); + } + +// protected String renderLoadPath(InterpreterRunnerConfiguration configuration) { +// StringBuffer loadPath = new StringBuffer(); +// +// PHPProject project = configuration.getProject(); +// addToLoadPath(loadPath, project.getProject()); +// +// Iterator referencedProjects = project.getReferencedProjects().iterator(); +// while (referencedProjects.hasNext()) +// addToLoadPath(loadPath, (IProject) referencedProjects.next()); +// +// return loadPath.toString(); +// } + +// protected void addToLoadPath(StringBuffer loadPath, IProject project) { +// +// loadPath.append(" -I " + osDependentPath(project.getLocation().toOSString())); +// } + + protected String osDependentPath(String aPath) { + if (BootLoader.getOS().equals(BootLoader.OS_WIN32)) + aPath = "\"" + aPath + "\""; + + return aPath; + } + + protected String getDebugCommandLineArgument() { + return "" ; + } + +} diff --git a/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/InterpreterRunnerConfiguration.java b/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/InterpreterRunnerConfiguration.java new file mode 100644 index 0000000..5af6d02 --- /dev/null +++ b/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/InterpreterRunnerConfiguration.java @@ -0,0 +1,86 @@ +package net.sourceforge.phpdt.internal.launching; + +import java.io.File; + +import net.sourceforge.phpeclipse.resourcesview.PHPProject; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.Path; +import org.eclipse.debug.core.ILaunchConfiguration; + +public class InterpreterRunnerConfiguration { + protected ILaunchConfiguration configuration; + + public InterpreterRunnerConfiguration(ILaunchConfiguration aConfiguration) { + configuration = aConfiguration; + } + + public String getAbsoluteFileName() { + IPath path = new Path(getFileName()); + IProject project = getProject().getProject(); + + return project.getLocation().toOSString() + "/" + getFileName(); + } + + public String getFileName() { + String fileName = ""; + + try { + fileName = configuration.getAttribute(PHPLaunchConfigurationAttribute.FILE_NAME, "No file specified in configuration"); + } catch(CoreException e) {} + + return fileName.replace('\\', '/'); + } + + public PHPProject getProject() { + String projectName = ""; + + try { + projectName = configuration.getAttribute(PHPLaunchConfigurationAttribute.PROJECT_NAME, ""); + } catch(CoreException e) { + PHPLaunchingPlugin.getDefault().log(e); + } + + IProject project = PHPLaunchingPlugin.getWorkspace().getRoot().getProject(projectName); + + PHPProject phpProject = new PHPProject(); + phpProject.setProject(project); + return phpProject; + } + + public File getAbsoluteWorkingDirectory() { + String file = null; + try { + file = configuration.getAttribute(PHPLaunchConfigurationAttribute.WORKING_DIRECTORY, ""); + } catch(CoreException e) { + PHPLaunchingPlugin.log(e); + } + return new File(file); + } + + public String getInterpreterArguments() { + try { + return configuration.getAttribute(PHPLaunchConfigurationAttribute.INTERPRETER_ARGUMENTS, ""); + } catch(CoreException e) {} + + return ""; + } + + public String getProgramArguments() { + try { + return configuration.getAttribute(PHPLaunchConfigurationAttribute.PROGRAM_ARGUMENTS, ""); + } catch (CoreException e) {} + + return ""; + } + + public PHPInterpreter getInterpreter() { + String selectedInterpreter = null; + try { + selectedInterpreter = configuration.getAttribute(PHPLaunchConfigurationAttribute.SELECTED_INTERPRETER, ""); + } catch(CoreException e) {} + + return PHPRuntime.getDefault().getInterpreter(selectedInterpreter); + } +} diff --git a/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/PHPInterpreter.java b/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/PHPInterpreter.java new file mode 100644 index 0000000..2e342b9 --- /dev/null +++ b/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/PHPInterpreter.java @@ -0,0 +1,60 @@ +package net.sourceforge.phpdt.internal.launching; + +import java.io.File; +import java.io.IOException; + +import org.eclipse.core.internal.resources.OS; +import org.eclipse.core.runtime.IPath; + +public class PHPInterpreter { + //public final String endOfOptionsDelimeter = " -- "; + + protected IPath installLocation; + protected String name; + + public PHPInterpreter(String aName, IPath validInstallLocation) { + name = aName; + installLocation = validInstallLocation; + } + + public IPath getInstallLocation() { + return installLocation; + } + + public void setInstallLocation(IPath validInstallLocation) { + installLocation = validInstallLocation; + } + + public String getName() { + return name; + } + + public void setName(String newName) { + name = newName; + } + + public String getCommand() { + String directory = installLocation.toOSString() + File.separator; + if (new File(directory + "php.exe").isFile()) + return directory + "php.exe"; + + if (new File(directory, "php").isFile()) + return directory + "php"; + + return null; + } + + public Process exec(String arguments, File workingDirectory) throws IOException { + return Runtime.getRuntime().exec(this.getCommand() + " " + arguments, null, workingDirectory); + } + + public boolean equals(Object other) { + if (other instanceof PHPInterpreter) { + PHPInterpreter otherInterpreter = (PHPInterpreter) other; + if (name.equals(otherInterpreter.getName())) + return installLocation.equals(otherInterpreter.getInstallLocation()); + } + + return false; + } +} diff --git a/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/PHPLaunchConfigurationAttribute.java b/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/PHPLaunchConfigurationAttribute.java new file mode 100644 index 0000000..d6b853e --- /dev/null +++ b/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/PHPLaunchConfigurationAttribute.java @@ -0,0 +1,18 @@ +package net.sourceforge.phpdt.internal.launching; + + + +public interface PHPLaunchConfigurationAttribute { + static final String PHP_LAUNCH_CONFIGURATION_TYPE = "net.sourceforge.phpdt.launching.LaunchConfigurationTypePHPApplication"; + + static final String CUSTOM_LOAD_PATH = PHPLaunchingPlugin.PLUGIN_ID + ".CUSTOM_LOAD_PATH"; + static final String FILE_NAME = PHPLaunchingPlugin.PLUGIN_ID + ".FILE_NAME"; + static final String INTERPRETER_ARGUMENTS = PHPLaunchingPlugin.PLUGIN_ID + ".INTERPRETER_ARGUMENTS"; + static final String MODULE_NAME = PHPLaunchingPlugin.PLUGIN_ID + ".MODULE_NAME"; + static final String PROGRAM_ARGUMENTS = PHPLaunchingPlugin.PLUGIN_ID + ".PROGRAM_ARGUMENTS"; + static final String PROJECT_NAME = PHPLaunchingPlugin.PLUGIN_ID + ".PROJECT_NAME"; + static final String SELECTED_INTERPRETER = PHPLaunchingPlugin.PLUGIN_ID + ".SELECTED_INTERPRETER"; + static final String WORKING_DIRECTORY = PHPLaunchingPlugin.PLUGIN_ID + ".WORKING_DIRECTORY"; + static final String USE_DEFAULT_LOAD_PATH = PHPLaunchingPlugin.PLUGIN_ID + ".USE_DEFAULT_LOAD_PATH"; + static final String USE_DEFAULT_WORKING_DIRECTORY = PHPLaunchingPlugin.PLUGIN_ID + ".USE_DEFAULT_WORKING_DIRECTORY"; +} \ No newline at end of file diff --git a/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/PHPLaunchConfigurationDelegate.java b/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/PHPLaunchConfigurationDelegate.java new file mode 100644 index 0000000..bbc6a9e --- /dev/null +++ b/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/PHPLaunchConfigurationDelegate.java @@ -0,0 +1,34 @@ +package net.sourceforge.phpdt.internal.launching; + +import org.eclipse.core.resources.IFile; +import org.eclipse.core.resources.IProject; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Status; +import org.eclipse.debug.core.ILaunch; +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.core.model.ILaunchConfigurationDelegate; + + +public class PHPLaunchConfigurationDelegate implements ILaunchConfigurationDelegate { + protected static final InterpreterRunner interpreterRunner = new InterpreterRunner(); +// protected static final DebuggerRunner debuggerRunner = new DebuggerRunner(); + + public PHPLaunchConfigurationDelegate() { + super(); + } + + /** + * @see ILaunchConfigurationDelegate#launch(ILaunchConfiguration, String, ILaunch, IProgressMonitor) + */ + public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException { + if (PHPRuntime.getDefault().getSelectedInterpreter() == null) + throw new CoreException(new Status(IStatus.ERROR, PHPLaunchingPlugin.PLUGIN_ID, IStatus.OK, "You must define an interpreter before running PHP.", null)); +// if (mode.equals("debug")) { +// debuggerRunner.run(new InterpreterRunnerConfiguration(configuration), launch); +// } else { + interpreterRunner.run(new InterpreterRunnerConfiguration(configuration), launch); +// } + } +} diff --git a/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/PHPLaunchingMessages.java b/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/PHPLaunchingMessages.java new file mode 100644 index 0000000..ca7ed89 --- /dev/null +++ b/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/PHPLaunchingMessages.java @@ -0,0 +1,21 @@ +package net.sourceforge.phpdt.internal.launching; + +import java.util.MissingResourceException; +import java.util.ResourceBundle; + +public class PHPLaunchingMessages { + + private static final String BUNDLE_NAME = PHPLaunchingMessages.class.getName(); + + private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle(BUNDLE_NAME); + + private PHPLaunchingMessages() {} + + public static String getString(String key) { + try { + return RESOURCE_BUNDLE.getString(key); + } catch (MissingResourceException e) { + return '!' + key + '!'; + } + } +} diff --git a/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/PHPLaunchingMessages.properties b/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/PHPLaunchingMessages.properties new file mode 100644 index 0000000..bc2d362 --- /dev/null +++ b/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/PHPLaunchingMessages.properties @@ -0,0 +1,6 @@ + +######################################### +# PHPLaunchingPlugin +######################################### + +PHPLaunchingPlugin.internalErrorOccurred=Internal error occurred \ No newline at end of file diff --git a/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/PHPLaunchingPlugin.java b/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/PHPLaunchingPlugin.java new file mode 100644 index 0000000..dee7aa5 --- /dev/null +++ b/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/PHPLaunchingPlugin.java @@ -0,0 +1,35 @@ +package net.sourceforge.phpdt.internal.launching; + +import net.sourceforge.phpeclipse.PHPeclipsePlugin; +import org.eclipse.core.resources.IWorkspace; +import org.eclipse.core.runtime.IPluginDescriptor; +import org.eclipse.core.runtime.IStatus; +import org.eclipse.core.runtime.Plugin; +import org.eclipse.core.runtime.Status; + +public class PHPLaunchingPlugin extends Plugin { + public static final String PLUGIN_ID = "net.sourceforge.phpeclipse.launching"; //$NON-NLS-1$ + + protected static PHPLaunchingPlugin plugin; + + public PHPLaunchingPlugin(IPluginDescriptor descriptor) { + super(descriptor); + plugin = this; + } + + public static PHPLaunchingPlugin getDefault() { + return plugin; + } + + public static IWorkspace getWorkspace() { + return PHPeclipsePlugin.getWorkspace(); + } + + public static void log(IStatus status) { + getDefault().getLog().log(status); + } + + public static void log(Throwable e) { + log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.ERROR, PHPLaunchingMessages.getString("PHPLaunchingPlugin.internalErrorOccurred"), e)); //$NON-NLS-1$ + } +} diff --git a/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/PHPRuntime.java b/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/PHPRuntime.java new file mode 100644 index 0000000..03447e1 --- /dev/null +++ b/net.sourceforge.phpeclipse.launching/src/net/sourceforge/phpdt/internal/launching/PHPRuntime.java @@ -0,0 +1,174 @@ +package net.sourceforge.phpdt.internal.launching; + +import java.io.BufferedOutputStream; +import java.io.File; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.FileReader; +import java.io.IOException; +import java.io.OutputStream; +import java.io.OutputStreamWriter; +import java.io.Reader; +import java.io.StringReader; +import java.io.Writer; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +import javax.xml.parsers.SAXParserFactory; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.Path; +import org.xml.sax.Attributes; +import org.xml.sax.ContentHandler; +import org.xml.sax.InputSource; +import org.xml.sax.Locator; +import org.xml.sax.SAXException; +import org.xml.sax.XMLReader; + +public class PHPRuntime { + protected static PHPRuntime runtime; + + protected List installedInterpreters; + protected PHPInterpreter selectedInterpreter; + protected PHPRuntime() { + super(); + } + + public static PHPRuntime getDefault() { + if (runtime == null) { + runtime = new PHPRuntime(); + } + return runtime; + } + + public PHPInterpreter getSelectedInterpreter() { + if (selectedInterpreter == null) { + loadRuntimeConfiguration(); + } + return selectedInterpreter; + } + + public PHPInterpreter getInterpreter(String name) { + Iterator interpreters = getInstalledInterpreters().iterator(); + while(interpreters.hasNext()) { + PHPInterpreter each = (PHPInterpreter) interpreters.next(); + if (each.getName().equals(name)) + return each; + } + + return getSelectedInterpreter(); + } + + public void setSelectedInterpreter(PHPInterpreter anInterpreter) { + selectedInterpreter = anInterpreter; + saveRuntimeConfiguration(); + } + + public void addInstalledInterpreter(PHPInterpreter anInterpreter) { + getInstalledInterpreters().add(anInterpreter); + if (getInstalledInterpreters().size() == 1) + setSelectedInterpreter((PHPInterpreter) getInstalledInterpreters().get(0)); + + saveRuntimeConfiguration(); + } + + public List getInstalledInterpreters() { + if (installedInterpreters == null) + loadRuntimeConfiguration(); + return installedInterpreters; + } + + public void setInstalledInterpreters(List newInstalledInterpreters) { + installedInterpreters = newInstalledInterpreters; + if (installedInterpreters.size() > 0) + setSelectedInterpreter((PHPInterpreter)installedInterpreters.get(0)); + else + setSelectedInterpreter(null); + } + + protected void saveRuntimeConfiguration() { + writeXML(getRuntimeConfigurationWriter()); + } + + protected Writer getRuntimeConfigurationWriter() { + try { + OutputStream stream = new BufferedOutputStream(new FileOutputStream(getRuntimeConfigurationFile())); + return new OutputStreamWriter(stream); + } catch (FileNotFoundException e) {} + + return null; + } + + protected void loadRuntimeConfiguration() { + installedInterpreters = new ArrayList(); + try { + XMLReader reader = SAXParserFactory.newInstance().newSAXParser().getXMLReader(); + reader.setContentHandler(getRuntimeConfigurationContentHandler()); + reader.parse(new InputSource(getRuntimeConfigurationReader())); + } catch(Exception e) { + PHPLaunchingPlugin.getDefault().log(e); + } + } + + protected Reader getRuntimeConfigurationReader() { + try { + return new FileReader(getRuntimeConfigurationFile()); + } catch(FileNotFoundException e) {} + return new StringReader(""); + } + + protected void writeXML(Writer writer) { + try { + writer.write(""); + Iterator interpretersIterator = installedInterpreters.iterator(); + while (interpretersIterator.hasNext()) { + writer.write(""); + } + writer.write(""); + writer.flush(); + } catch(IOException e) { + PHPLaunchingPlugin.log(e); + } + } + + protected ContentHandler getRuntimeConfigurationContentHandler() { + return new ContentHandler() { + public void setDocumentLocator(Locator locator) {} + public void startDocument() throws SAXException {} + public void endDocument() throws SAXException {} + public void startPrefixMapping(String prefix, String uri) throws SAXException {} + public void endPrefixMapping(String prefix) throws SAXException {} + public void startElement(String namespaceURI, String localName, String qName, Attributes atts) throws SAXException { + if ("interpreter".equals(qName)) { + String interpreterName = atts.getValue("name"); + IPath installLocation = new Path(atts.getValue("path")); + PHPInterpreter interpreter = new PHPInterpreter(interpreterName, installLocation); + installedInterpreters.add(interpreter); + if (atts.getValue("selected") != null) + selectedInterpreter = interpreter; + } + } + public void endElement(String namespaceURI, String localName, String qName) throws SAXException {} + public void characters(char[] ch, int start, int length) throws SAXException {} + public void ignorableWhitespace(char[] ch, int start, int length) throws SAXException {} + public void processingInstruction(String target, String data) throws SAXException {} + public void skippedEntity(String name) throws SAXException {} + }; + } + + protected File getRuntimeConfigurationFile() { + IPath stateLocation = PHPLaunchingPlugin.getDefault().getStateLocation(); + IPath fileLocation = stateLocation.append("runtimeConfiguration.xml"); + return new File(fileLocation.toOSString()); + } +}