Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsgibly2006-06-22 11:38:11 +0000
committersgibly2006-06-22 11:38:11 +0000
commit5545629a55dfa165080eab4ec87f1e781dd2087b (patch)
tree1cf5ef3bfbf13f5e05640ef0d4fab26d616ff0dd
parent3817fa91a695eaa67edf8e8e8ba0710f6c411b00 (diff)
downloadorg.eclipse.pdt-5545629a55dfa165080eab4ec87f1e781dd2087b.tar.gz
org.eclipse.pdt-5545629a55dfa165080eab4ec87f1e781dd2087b.tar.xz
org.eclipse.pdt-5545629a55dfa165080eab4ec87f1e781dd2087b.zip
Moving to the new Server infrastructure
-rw-r--r--features/org.eclipse.php-feature/feature.xml4
-rw-r--r--plugins/org.eclipse.php.debug.core/META-INF/MANIFEST.MF2
-rw-r--r--plugins/org.eclipse.php.debug.core/plugin.xml8
-rw-r--r--plugins/org.eclipse.php.debug.core/src/org/eclipse/php/debug/core/PHPDebugPlugin.java258
-rw-r--r--plugins/org.eclipse.php.debug.core/src/org/eclipse/php/debug/core/communication/DebugConnectionThread.java13
-rw-r--r--plugins/org.eclipse.php.debug.core/src/org/eclipse/php/debug/core/launching/PHPServerLaunchDecorator.java13
-rw-r--r--plugins/org.eclipse.php.debug.core/src/org/eclipse/php/debug/core/launching/PHPServerLaunchDelegate.java60
-rw-r--r--plugins/org.eclipse.php.debug.ui/META-INF/MANIFEST.MF6
-rw-r--r--plugins/org.eclipse.php.debug.ui/plugin.xml2
-rw-r--r--plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/debug/ui/PropertyTesters/RunnablePropertyTester.java7
-rw-r--r--plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/debug/ui/launching/PHPExecutableLaunchTab.java107
-rw-r--r--plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/debug/ui/launching/PHPServerTab.java56
12 files changed, 246 insertions, 290 deletions
diff --git a/features/org.eclipse.php-feature/feature.xml b/features/org.eclipse.php-feature/feature.xml
index 7ccc17b90..7298b8980 100644
--- a/features/org.eclipse.php-feature/feature.xml
+++ b/features/org.eclipse.php-feature/feature.xml
@@ -47,14 +47,14 @@
unpack="false"/>
<plugin
- id="org.eclipse.php.server.apache.core"
+ id="org.eclipse.php.server.core"
download-size="0"
install-size="0"
version="0.1.5"
unpack="false"/>
<plugin
- id="org.eclipse.php.server.apache.ui"
+ id="org.eclipse.php.server.ui"
download-size="0"
install-size="0"
version="0.1.5"
diff --git a/plugins/org.eclipse.php.debug.core/META-INF/MANIFEST.MF b/plugins/org.eclipse.php.debug.core/META-INF/MANIFEST.MF
index 2d3e8c6ad..7fd7bfa17 100644
--- a/plugins/org.eclipse.php.debug.core/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.php.debug.core/META-INF/MANIFEST.MF
@@ -11,7 +11,7 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.debug.core,
org.eclipse.debug.ui,
org.eclipse.ui.console,
- org.eclipse.php.server.apache.core,
+ org.eclipse.php.server.core,
org.eclipse.wst.server.core,
org.eclipse.jface,
org.eclipse.wst.sse.ui,
diff --git a/plugins/org.eclipse.php.debug.core/plugin.xml b/plugins/org.eclipse.php.debug.core/plugin.xml
index 6e7e7ebde..0c3ee1aa7 100644
--- a/plugins/org.eclipse.php.debug.core/plugin.xml
+++ b/plugins/org.eclipse.php.debug.core/plugin.xml
@@ -270,10 +270,6 @@
name="org.eclipse.php.debug.core.defaultInitializer"/>
</extension>
- <extension point="org.eclipse.php.server.apache.core.httpServerLaunchDelegate">
- <httpServerLaunchDelegate
- class="org.eclipse.php.debug.core.launching.PHPServerLaunchDelegate" />
- </extension>
<extension
point="org.eclipse.php.debug.daemon.debugCommunicationDaemon">
<daemon
@@ -281,6 +277,10 @@
id="org.eclipse.php.debug.core.BasicDebugDaemon"
name="Basic Debug Daemon"/>
</extension>
+ <extension
+ point="org.eclipse.php.server.core.httpServerLaunchDelegate">
+ <launchDelegate class="org.eclipse.php.debug.core.launching.PHPServerLaunchDelegate"/>
+ </extension>
</plugin>
diff --git a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/debug/core/PHPDebugPlugin.java b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/debug/core/PHPDebugPlugin.java
index 53417d578..e1efe50c9 100644
--- a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/debug/core/PHPDebugPlugin.java
+++ b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/debug/core/PHPDebugPlugin.java
@@ -10,18 +10,14 @@
*******************************************************************************/
package org.eclipse.php.debug.core;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.core.runtime.Plugin;
-import org.eclipse.core.runtime.Preferences;
-import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.*;
import org.eclipse.debug.core.DebugPlugin;
import org.eclipse.debug.core.ILaunchConfigurationType;
import org.eclipse.debug.core.ILaunchManager;
import org.eclipse.debug.ui.DebugUITools;
import org.eclipse.php.debug.core.preferences.PHPDebugCorePreferenceNames;
-import org.eclipse.php.server.apache.core.ApacheServer;
-import org.eclipse.wst.server.core.IServer;
+import org.eclipse.php.server.core.Server;
+import org.eclipse.php.server.core.manager.ServersManager;
import org.osgi.framework.BundleContext;
/**
@@ -29,126 +25,132 @@ import org.osgi.framework.BundleContext;
*/
public class PHPDebugPlugin extends Plugin {
- public static final String ID = "org.eclipse.php.debug.core"; //$NON-NLS-1$
- public static final int INTERNAL_ERROR = 10001;
-
- //The shared instance.
- private static PHPDebugPlugin plugin;
- private static String fPHPDebugPerspective = "org.eclipse.php.debug.ui.PHPDebugPerspective";
- private static String fDebugPerspective = "org.eclipse.debug.ui.DebugPerspective";
-
- /**
- * The constructor.
- */
- public PHPDebugPlugin() {
- plugin = this;
- }
-
- public static final boolean DebugPHP;
- static {
- String value = Platform.getDebugOption("org.eclipse.php.debug.core/debug"); //$NON-NLS-1$
- DebugPHP = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
- }
-
- /**
- * This method is called upon plug-in activation
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- org.eclipse.php.server.apache.core.ApachePlugin.getInstance();
- setLaunchPerspective();
- // check for default server
- createDefaultPHPServer();
- }
-
- /**
- * This method is called when the plug-in is stopped
- */
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- plugin = null;
- }
-
- /**
- * Returns the shared instance.
- */
- public static PHPDebugPlugin getDefault() {
- return plugin;
- }
-
- /**
- * Returns the PHP debug ID.
- */
- public static String getID() {
- return IPHPConstants.ID_PHP_DEBUG_CORE;
- }
-
- public static boolean getStopAtFirstLine() {
- Preferences prefs = getDefault().getPluginPreferences();
- return prefs.getBoolean(PHPDebugCorePreferenceNames.STOP_AT_FIRST_LINE);
-
- }
-
- public static boolean getDebugInfoOption() {
- Preferences prefs = getDefault().getPluginPreferences();
- return prefs.getBoolean(PHPDebugCorePreferenceNames.RUN_WITH_DEBUG_INFO);
-
- }
-
- public static boolean getOpenDebugViewsOption() {
- Preferences prefs = getDefault().getPluginPreferences();
- return prefs.getBoolean(PHPDebugCorePreferenceNames.OPEN_DEBUG_VIEWS);
-
- }
-
- public static int getDebugPort() {
- Preferences prefs = getDefault().getPluginPreferences();
- return prefs.getInt(PHPDebugCorePreferenceNames.DEBUG_PORT);
-
- }
-
- public static String getWorkspaceURL() {
- Preferences prefs = getDefault().getPluginPreferences();
- return prefs.getString(PHPDebugCorePreferenceNames.DEDAULT_URL);
-
- }
-
- public void setLaunchPerspective() {
- ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
- ILaunchConfigurationType[] types = manager.getLaunchConfigurationTypes();
- Preferences prefs = getPluginPreferences();
- boolean usePHPDebugPerspective = prefs.getBoolean(PHPDebugCorePreferenceNames.USE_PHP_DEBUG_PERSPECTIVE);
- for (int i = 0; i < types.length; i++) {
- if (types[i].getIdentifier().startsWith("org.eclipse.php.")) {
- if (usePHPDebugPerspective) {
- DebugUITools.setLaunchPerspective(types[i], ILaunchManager.DEBUG_MODE, fPHPDebugPerspective);
- } else {
- DebugUITools.setLaunchPerspective(types[i], ILaunchManager.DEBUG_MODE, fDebugPerspective);
- }
- }
- }
- }
-
- public static void createDefaultPHPServer() {
- String baseURL = getWorkspaceURL();
- IServer server = ApacheServer.checkForApacheServer(IPHPConstants.Default_Server_ID);
- if (server == null) {
- ApacheServer.createApacheServer(IPHPConstants.Default_Server_Name, baseURL, IPHPConstants.Default_Server_ID);
- } else {
- ApacheServer.updateBaseURL(server, baseURL);
- }
- }
-
- public static void log(IStatus status) {
- getDefault().getLog().log(status);
- }
-
- public static void log(Throwable e) {
- log(new Status(IStatus.ERROR, ID, INTERNAL_ERROR, "PHPDebug plugin internal error", e)); //$NON-NLS-1$
- }
-
- public static void logErrorMessage(String message) {
- log(new Status(IStatus.ERROR, ID, INTERNAL_ERROR, message, null));
- }
+ public static final String ID = "org.eclipse.php.debug.core"; //$NON-NLS-1$
+ public static final int INTERNAL_ERROR = 10001;
+
+ //The shared instance.
+ private static PHPDebugPlugin plugin;
+ private static String fPHPDebugPerspective = "org.eclipse.php.debug.ui.PHPDebugPerspective";
+ private static String fDebugPerspective = "org.eclipse.debug.ui.DebugPerspective";
+
+ /**
+ * The constructor.
+ */
+ public PHPDebugPlugin() {
+ plugin = this;
+ }
+
+ public static final boolean DebugPHP;
+ static {
+ String value = Platform.getDebugOption("org.eclipse.php.debug.core/debug"); //$NON-NLS-1$
+ DebugPHP = value != null && value.equalsIgnoreCase("true"); //$NON-NLS-1$
+ }
+
+ /**
+ * This method is called upon plug-in activation
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ org.eclipse.php.server.core.Activator.getDefault(); // TODO - Check if getInstance is needed
+ setLaunchPerspective();
+ // check for default server
+ createDefaultPHPServer();
+ }
+
+ /**
+ * This method is called when the plug-in is stopped
+ */
+ public void stop(BundleContext context) throws Exception {
+ super.stop(context);
+ plugin = null;
+ }
+
+ /**
+ * Returns the shared instance.
+ */
+ public static PHPDebugPlugin getDefault() {
+ return plugin;
+ }
+
+ /**
+ * Returns the PHP debug ID.
+ */
+ public static String getID() {
+ return IPHPConstants.ID_PHP_DEBUG_CORE;
+ }
+
+ public static boolean getStopAtFirstLine() {
+ Preferences prefs = getDefault().getPluginPreferences();
+ return prefs.getBoolean(PHPDebugCorePreferenceNames.STOP_AT_FIRST_LINE);
+
+ }
+
+ public static boolean getDebugInfoOption() {
+ Preferences prefs = getDefault().getPluginPreferences();
+ return prefs.getBoolean(PHPDebugCorePreferenceNames.RUN_WITH_DEBUG_INFO);
+
+ }
+
+ public static boolean getOpenDebugViewsOption() {
+ Preferences prefs = getDefault().getPluginPreferences();
+ return prefs.getBoolean(PHPDebugCorePreferenceNames.OPEN_DEBUG_VIEWS);
+
+ }
+
+ public static int getDebugPort() {
+ Preferences prefs = getDefault().getPluginPreferences();
+ return prefs.getInt(PHPDebugCorePreferenceNames.DEBUG_PORT);
+
+ }
+
+ public static String getWorkspaceURL() {
+ Preferences prefs = getDefault().getPluginPreferences();
+ return prefs.getString(PHPDebugCorePreferenceNames.DEDAULT_URL);
+
+ }
+
+ public void setLaunchPerspective() {
+ ILaunchManager manager = DebugPlugin.getDefault().getLaunchManager();
+ ILaunchConfigurationType[] types = manager.getLaunchConfigurationTypes();
+ Preferences prefs = getPluginPreferences();
+ boolean usePHPDebugPerspective = prefs.getBoolean(PHPDebugCorePreferenceNames.USE_PHP_DEBUG_PERSPECTIVE);
+ for (int i = 0; i < types.length; i++) {
+ if (types[i].getIdentifier().startsWith("org.eclipse.php.")) {
+ if (usePHPDebugPerspective) {
+ DebugUITools.setLaunchPerspective(types[i], ILaunchManager.DEBUG_MODE, fPHPDebugPerspective);
+ } else {
+ DebugUITools.setLaunchPerspective(types[i], ILaunchManager.DEBUG_MODE, fDebugPerspective);
+ }
+ }
+ }
+ }
+
+ /**
+ * Creates a default server in case the ServersManager does not hold any defined server.
+ */
+ public static void createDefaultPHPServer() {
+ if (ServersManager.getServers().length == 0) {
+ String baseURL = getWorkspaceURL();
+ Server server = ServersManager.getServer(IPHPConstants.Default_Server_ID);
+ if (server == null) {
+ ServersManager.createServer(IPHPConstants.Default_Server_Name, baseURL);
+ ServersManager.save();
+ } else {
+ server.setBaseURL(baseURL);
+ }
+ }
+ }
+
+ public static void log(IStatus status) {
+ getDefault().getLog().log(status);
+ }
+
+ public static void log(Throwable e) {
+ log(new Status(IStatus.ERROR, ID, INTERNAL_ERROR, "PHPDebug plugin internal error", e)); //$NON-NLS-1$
+ }
+
+ public static void logErrorMessage(String message) {
+ log(new Status(IStatus.ERROR, ID, INTERNAL_ERROR, message, null));
+ }
}
diff --git a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/debug/core/communication/DebugConnectionThread.java b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/debug/core/communication/DebugConnectionThread.java
index cb8396505..31593dce1 100644
--- a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/debug/core/communication/DebugConnectionThread.java
+++ b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/debug/core/communication/DebugConnectionThread.java
@@ -39,8 +39,7 @@ import org.eclipse.php.debug.core.launching.PHPProcess;
import org.eclipse.php.debug.core.launching.PHPServerLaunchDecorator;
import org.eclipse.php.debug.core.model.PHPDebugTarget;
import org.eclipse.php.debug.core.preferences.PHPProjectPreferences;
-import org.eclipse.php.server.apache.core.ApachePlugin;
-import org.eclipse.php.server.apache.core.ApacheServerBehaviour;
+import org.eclipse.php.server.core.Server;
/**
* The debug connection thread is responsible of initilizing and handle a single debug session that was
@@ -454,9 +453,11 @@ public class DebugConnectionThread implements Runnable {
private void hookServerDebug(ILaunch launch) throws CoreException {
PHPServerLaunchDecorator launchDecorator = (PHPServerLaunchDecorator) launch;
ILaunchConfiguration launchConfiguration = launch.getLaunchConfiguration();
- ApacheServerBehaviour serverBehaviour = launchDecorator.getApacheServerBahavior();
- String URL = launchConfiguration.getAttribute(ApachePlugin.URL, "");
- String contextRoot = launchConfiguration.getAttribute(ApachePlugin.CONTEXT_ROOT, "");
+ // ApacheServerBehaviour serverBehaviour = launchDecorator.getApacheServerBahavior();
+ // String URL = launchConfiguration.getAttribute(ApachePlugin.URL, "");
+ // String contextRoot = launchConfiguration.getAttribute(ApachePlugin.CONTEXT_ROOT, "");
+ String URL = launchConfiguration.getAttribute(Server.BASE_URL, "");
+ String contextRoot = launchConfiguration.getAttribute(Server.CONTEXT_ROOT, "");
boolean stopAtFirstLine = PHPProjectPreferences.getStopAtFirstLine(launchDecorator.getProject());
int requestPort = PHPProjectPreferences.getDebugPort(launchDecorator.getProject());
boolean runWithDebug = launchConfiguration.getAttribute("run_with_debug", true);
@@ -464,7 +465,7 @@ public class DebugConnectionThread implements Runnable {
runWithDebug = false;
}
PHPProcess process = new PHPProcess(launch, URL);
- serverBehaviour.setProcess(process);
+ // serverBehaviour.setProcess(process);
PHPDebugTarget target = new PHPDebugTarget(this, launch, URL, requestPort, process, contextRoot, runWithDebug, stopAtFirstLine, launchDecorator.getProject());
launch.addDebugTarget(target);
}
diff --git a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/debug/core/launching/PHPServerLaunchDecorator.java b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/debug/core/launching/PHPServerLaunchDecorator.java
index 5b0edc1f4..1e92fd455 100644
--- a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/debug/core/launching/PHPServerLaunchDecorator.java
+++ b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/debug/core/launching/PHPServerLaunchDecorator.java
@@ -12,15 +12,13 @@ package org.eclipse.php.debug.core.launching;
import org.eclipse.core.resources.IProject;
import org.eclipse.debug.core.ILaunch;
-import org.eclipse.php.server.apache.core.ApacheServerBehaviour;
/**
- * PHPServerLaunchDecorator has extended functionalities that can return the ApacheServerBehaviour and the IProject
- * that are related to the ILaunch.
+ * PHPServerLaunchDecorator has extended functionalities that can return the IProject
+ * that is related to the ILaunch.
*/
public class PHPServerLaunchDecorator extends PHPLaunchProxy {
- private ApacheServerBehaviour serverBehaviour;
private IProject project;
/**
@@ -30,16 +28,11 @@ public class PHPServerLaunchDecorator extends PHPLaunchProxy {
* @param serverBehaviour
* @param project
*/
- public PHPServerLaunchDecorator(ILaunch launch, ApacheServerBehaviour serverBehaviour, IProject project) {
+ public PHPServerLaunchDecorator(ILaunch launch, IProject project) {
super(launch);
- this.serverBehaviour = serverBehaviour;
this.project = project;
}
- public ApacheServerBehaviour getApacheServerBahavior() {
- return serverBehaviour;
- }
-
public IProject getProject() {
return project;
}
diff --git a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/debug/core/launching/PHPServerLaunchDelegate.java b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/debug/core/launching/PHPServerLaunchDelegate.java
index e772d1807..7c10d43c1 100644
--- a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/debug/core/launching/PHPServerLaunchDelegate.java
+++ b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/debug/core/launching/PHPServerLaunchDelegate.java
@@ -2,10 +2,8 @@ package org.eclipse.php.debug.core.launching;
import org.eclipse.core.resources.IMarkerDelta;
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.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.*;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.debug.core.*;
import org.eclipse.debug.core.model.*;
@@ -19,26 +17,24 @@ import org.eclipse.php.debug.core.debugger.PHPWebServerDebuggerInitializer;
import org.eclipse.php.debug.core.debugger.parameters.IDebugParametersKeys;
import org.eclipse.php.debug.core.model.DebugSessionIdGenerator;
import org.eclipse.php.debug.core.preferences.PHPProjectPreferences;
-import org.eclipse.php.server.apache.core.ApacheLaunchConfigurationDelegate;
-import org.eclipse.php.server.apache.core.ApachePlugin;
-import org.eclipse.php.server.apache.core.ApacheServerBehaviour;
-import org.eclipse.php.server.apache.core.IHTTPServerLaunch;
+import org.eclipse.php.server.core.Server;
+import org.eclipse.php.server.core.deploy.DeployFilter;
+import org.eclipse.php.server.core.deploy.FileUtil;
+import org.eclipse.php.server.core.launch.IHTTPServerLaunch;
+import org.eclipse.php.server.core.launch.ServerLaunchConfigurationDelegate;
+import org.eclipse.php.server.core.manager.ServersManager;
import org.eclipse.swt.widgets.Display;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IModuleArtifact;
-import org.eclipse.wst.server.core.IServer;
-import org.eclipse.wst.server.core.ServerUtil;
public class PHPServerLaunchDelegate implements IHTTPServerLaunch {
- private ApacheLaunchConfigurationDelegate httpServerDelegate = null;
+ private ServerLaunchConfigurationDelegate httpServerDelegate = null;
private ILaunch launch;
private Job runDispatch;
public PHPServerLaunchDelegate() {
}
- public void setHTTPServerDelegate(ApacheLaunchConfigurationDelegate delegate) {
+ public void setHTTPServerDelegate(ServerLaunchConfigurationDelegate delegate) {
this.httpServerDelegate = delegate;
}
@@ -50,45 +46,47 @@ public class PHPServerLaunchDelegate implements IHTTPServerLaunch {
return;
}
- IServer server = ServerUtil.getServer(configuration);
+ Server server = ServersManager.getServer(configuration.getAttribute(Server.NAME, ""));
if (server == null) {
- Logger.log(Logger.ERROR, "Luanch configuration could not find server");
+ Logger.log(Logger.ERROR, "Launch configuration could not find server");
+ terminated();
// throw CoreException();
return;
}
+ String fileName = configuration.getAttribute(Server.FILE_NAME, (String) null);
+ // Get the project from the file name
+ IPath filePath = new Path(fileName);
+ IProject proj = null;
+ try {
+ proj = ResourcesPlugin.getWorkspace().getRoot().getProject(filePath.segment(0));
+ } catch (Throwable t) {
+ }
+ if (proj == null) {
+ Logger.log(Logger.ERROR, "Could not execute the debug (Project is null).");
+ return;
+ }
- ApacheServerBehaviour apacheServerBehaviour = (ApacheServerBehaviour) server.loadAdapter(ApacheServerBehaviour.class, null);
- apacheServerBehaviour.setupLaunch(launch, mode, monitor);
-
- IModuleArtifact moduleArtifact = httpServerDelegate.getModuleArtifact(configuration);
- if (moduleArtifact == null)
- throw new CoreException(new Status(IStatus.ERROR, PHPDebugPlugin.getID(), IPHPConstants.INTERNAL_ERROR, PHPDebugCoreMessages.configurationError, null));
-
- IModule module = moduleArtifact.getModule();
-
- boolean publish = configuration.getAttribute(ApachePlugin.DEPLOYABLE, false);
+ boolean publish = configuration.getAttribute(Server.PUBLISH, false);
if (publish) {
- if (!apacheServerBehaviour.publish(module, monitor)) {
+ if (!FileUtil.publish(server, proj, configuration, DeployFilter.getFilterMap(), monitor)) {
// Return if the publish failed.
terminated();
return;
}
}
ILaunchConfigurationWorkingCopy wc = configuration.getWorkingCopy();
- IProject proj = module.getProject();
String project = proj.getFullPath().toString();
-
wc.setAttribute(IPHPConstants.PHP_Project, project);
wc.doSave();
- String URL = configuration.getAttribute(ApachePlugin.URL, "");
+ String URL = configuration.getAttribute(Server.BASE_URL, "");
if (mode.equals(ILaunchManager.DEBUG_MODE) || runWithDebug == true) {
boolean isStopAtFirstLine = PHPProjectPreferences.getStopAtFirstLine(proj);
int requestPort = PHPProjectPreferences.getDebugPort(proj);
// Generate a session id for this launch and put it in the map
int sessionID = DebugSessionIdGenerator.generateSessionID();
- PHPSessionLaunchMapper.put(sessionID, new PHPServerLaunchDecorator(launch, apacheServerBehaviour, proj));
+ PHPSessionLaunchMapper.put(sessionID, new PHPServerLaunchDecorator(launch, proj));
// Fill all debug attributes:
launch.setAttribute(IDebugParametersKeys.PORT, Integer.toString(requestPort));
diff --git a/plugins/org.eclipse.php.debug.ui/META-INF/MANIFEST.MF b/plugins/org.eclipse.php.debug.ui/META-INF/MANIFEST.MF
index 3fd4cd6a3..6aa768431 100644
--- a/plugins/org.eclipse.php.debug.ui/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.php.debug.ui/META-INF/MANIFEST.MF
@@ -11,7 +11,6 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.debug.ui,
org.eclipse.ui.workbench.texteditor,
org.eclipse.debug.core,
- org.eclipse.wst.server.core,
org.eclipse.jface.text,
org.eclipse.php.debug.core,
org.eclipse.ui.ide,
@@ -22,9 +21,10 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.wst.html.ui,
org.eclipse.wst.sse.core,
org.eclipse.wst.xml.core,
- org.eclipse.wst.server.ui,
org.eclipse.php.ui,
- org.eclipse.php.server.apache.ui
+ org.eclipse.php.server.ui,
+ org.eclipse.php.server.core,
+ org.eclipse.core.expressions
Eclipse-LazyStart: true
Export-Package: org.eclipse.php.debug.ui,
org.eclipse.php.debug.ui.actions,
diff --git a/plugins/org.eclipse.php.debug.ui/plugin.xml b/plugins/org.eclipse.php.debug.ui/plugin.xml
index 2327a5e01..9820dfa73 100644
--- a/plugins/org.eclipse.php.debug.ui/plugin.xml
+++ b/plugins/org.eclipse.php.debug.ui/plugin.xml
@@ -321,7 +321,7 @@
</shortcut>
</extension>
- <extension point="org.eclipse.php.server.apache.ui.serverTab">
+ <extension point="org.eclipse.php.server.ui.serverTab">
<serverTab class="org.eclipse.php.debug.ui.launching.PHPServerTab"/>
</extension>
diff --git a/plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/debug/ui/PropertyTesters/RunnablePropertyTester.java b/plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/debug/ui/PropertyTesters/RunnablePropertyTester.java
index daf01b480..bab200674 100644
--- a/plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/debug/ui/PropertyTesters/RunnablePropertyTester.java
+++ b/plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/debug/ui/PropertyTesters/RunnablePropertyTester.java
@@ -10,15 +10,14 @@
*******************************************************************************/
package org.eclipse.php.debug.ui.PropertyTesters;
+import org.eclipse.core.expressions.PropertyTester;
import org.eclipse.core.resources.IFolder;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.php.core.project.PHPNature;
import org.eclipse.php.debug.ui.Logger;
-import org.eclipse.wst.server.ui.internal.ServerPropertyTester;
-//import org.eclipse.php.core.phpModel.parser.PHPCodeDataFactory$PHPFileDataImp;
-public class RunnablePropertyTester extends ServerPropertyTester{
+public class RunnablePropertyTester extends PropertyTester{
public boolean test(Object receiver, String property, Object[] args, Object expectedValue) {
Class newClass = receiver.getClass();
@@ -45,7 +44,7 @@ public class RunnablePropertyTester extends ServerPropertyTester{
Logger.logException(e);
}
- return super.test(receiver, property, args, expectedValue);
+ return true;
}
}
diff --git a/plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/debug/ui/launching/PHPExecutableLaunchTab.java b/plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/debug/ui/launching/PHPExecutableLaunchTab.java
index 3d5cb9799..7b7c86367 100644
--- a/plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/debug/ui/launching/PHPExecutableLaunchTab.java
+++ b/plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/debug/ui/launching/PHPExecutableLaunchTab.java
@@ -13,7 +13,6 @@ package org.eclipse.php.debug.ui.launching;
import java.io.File;
import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IWorkspaceRoot;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.CoreException;
@@ -37,8 +36,7 @@ import org.eclipse.php.debug.ui.Logger;
import org.eclipse.php.debug.ui.PHPDebugUIMessages;
import org.eclipse.php.debug.ui.preferences.phps.PHPexeDescriptor;
import org.eclipse.php.debug.ui.preferences.phps.PHPsComboBlock;
-import org.eclipse.php.server.apache.ui.ApacheUIPlugin;
-import org.eclipse.php.server.apache.ui.HTTPServerUtil;
+import org.eclipse.php.server.ui.ServerUtilities;
import org.eclipse.swt.SWT;
import org.eclipse.swt.accessibility.AccessibleAdapter;
import org.eclipse.swt.accessibility.AccessibleEvent;
@@ -48,49 +46,54 @@ import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.FileDialog;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.wst.server.core.IModule;
-import org.eclipse.wst.server.core.IModuleArtifact;
-import org.eclipse.wst.server.core.internal.ServerPlugin;
-import org.eclipse.wst.server.core.util.WebResource;
+import org.eclipse.swt.widgets.*;
public class PHPExecutableLaunchTab extends AbstractLaunchConfigurationTab {
public final static String FIRST_EDIT = "editedByPHPExecutableLaunchTab"; //$NON-NLS-1$
- protected Text locationField;
- //protected Text workDirectoryField;
- protected Button fileLocationButton;
- protected Button fileWorkingDirectoryButton;
- //protected Button workspaceWorkingDirectoryButton;
- protected Button runWithDebugInfo;
+ private Text locationField;
+ private Button fileLocationButton;
+ private Button runWithDebugInfo;
- protected Text argumentField;
- protected Button argumentVariablesButton;
+ private Text argumentField;
+ private Button argumentVariablesButton;
protected SelectionAdapter selectionAdapter;
protected PHPsComboBlock phpsComboBlock;
- protected boolean disableFileSelection = false;
- protected boolean disableDebugInfoOption = false;
+ private boolean enableFileSelection;
+ private boolean enableDebugInfoOption;
public PHPExecutableLaunchTab(String mode) {
+ enableFileSelection = true;
if (!mode.equals(ILaunchManager.RUN_MODE)) {
- setDisableDebugInfoOption();
+ setEnableDebugInfoOption(false);
}
}
- public void setDisableFileSelection() {
- this.disableFileSelection = true;
+ public void setEnableFileSelection(boolean enabled) {
+ if (enabled == enableFileSelection) {
+ return;
+ }
+ this.enableFileSelection = enabled;
+ if (argumentVariablesButton != null) {
+ argumentVariablesButton.setVisible(enabled);
+ }
+ if (argumentField != null) {
+ argumentField.setVisible(enabled);
+ }
+
}
- public void setDisableDebugInfoOption() {
- this.disableDebugInfoOption = true;
+ public void setEnableDebugInfoOption(boolean enabled) {
+ if (enabled == enableDebugInfoOption) {
+ return;
+ }
+ this.enableDebugInfoOption = true;
+ if(runWithDebugInfo != null) {
+ runWithDebugInfo.setVisible(enabled);
+ }
}
// Selection changed listener (checked PHP exe)
@@ -131,11 +134,11 @@ public class PHPExecutableLaunchTab extends AbstractLaunchConfigurationTab {
mainComposite.setLayoutData(gridData);
createLocationComponent(mainComposite);
- if (!disableDebugInfoOption) {
+ if (enableDebugInfoOption) {
createDebugInfoComponent(mainComposite);
}
//createWorkDirectoryComponent(mainComposite);
- if (!disableFileSelection) {
+ if (enableFileSelection) {
createArgumentComponent(mainComposite);
}
createVerticalSpacer(mainComposite, 1);
@@ -291,47 +294,15 @@ public class PHPExecutableLaunchTab extends AbstractLaunchConfigurationTab {
public void initializeFrom(ILaunchConfiguration configuration) {
updateLocation(configuration);
//updateWorkingDirectory(configuration);
- if (!disableDebugInfoOption) {
+ if (enableDebugInfoOption) {
updateDebugInfoOption(configuration);
}
-
- if (!disableFileSelection) {
+ if (enableFileSelection) {
updateArgument(configuration);
- String argField = argumentField.getText();
- //String workingDir = this.workDirectoryField.getText();
-
- if (argField.equals("") && ApacheUIPlugin.currentSelection != null && !ApacheUIPlugin.currentSelection.isEmpty()) {
- IStructuredSelection sel = (IStructuredSelection) ApacheUIPlugin.currentSelection;
- IModuleArtifact moduleArtifact = ServerPlugin.getModuleArtifact(sel.getFirstElement());
-
- if (moduleArtifact instanceof WebResource) {
- WebResource webResource = (WebResource) moduleArtifact;
- IModule module = webResource.getModule();
-
- if (module != null) {
- IProject proj = module.getProject();
-
- if (proj != null) {
- IPath filePath = webResource.getPath();
-
- if (filePath.isEmpty()) {
- argField = proj.getFullPath().toString();
- } else {
- IFile file = proj.getFile(filePath);
- argField = file.getFullPath().toString();
- }
-
- this.argumentField.setText(argField);
- }
- }
- }
- }
}
-
}
public String getName() {
- // TODO Auto-generated method stub
return "PHP Exe";
}
@@ -398,12 +369,12 @@ public class PHPExecutableLaunchTab extends AbstractLaunchConfigurationTab {
}
String arguments = null;
- if (disableFileSelection || (arguments = argumentField.getText().trim()).length() == 0) {
+ if (!enableFileSelection || (arguments = argumentField.getText().trim()).length() == 0) {
configuration.setAttribute(PHPCoreConstants.ATTR_FILE, (String) null);
} else {
configuration.setAttribute(PHPCoreConstants.ATTR_FILE, arguments);
}
- boolean debugInfo = disableDebugInfoOption ? true : runWithDebugInfo.getSelection();
+ boolean debugInfo = enableDebugInfoOption ? runWithDebugInfo.getSelection() : true;
configuration.setAttribute(IPHPConstants.RunWithDebugInfo, debugInfo);
}
@@ -432,7 +403,7 @@ public class PHPExecutableLaunchTab extends AbstractLaunchConfigurationTab {
return false;
}
}
- if (!disableFileSelection) {
+ if (enableFileSelection) {
String phpFile = launchConfig.getAttribute(PHPCoreConstants.ATTR_FILE, "");
if (phpFile != "" && phpExe != null) {
if (!fileExists(phpFile)) {
@@ -478,7 +449,7 @@ public class PHPExecutableLaunchTab extends AbstractLaunchConfigurationTab {
//if(projStr == null || projStr.equals("") || projects == null)
//{
- file = (IFile) HTTPServerUtil.getFileFromDialog(null, getShell(), LaunchUtil.getFileExtensions(), LaunchUtil.getRequiredNatures());
+ file = (IFile) ServerUtilities.getFileFromDialog(null, getShell(), LaunchUtil.getFileExtensions(), LaunchUtil.getRequiredNatures());
//}
//else
/*
diff --git a/plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/debug/ui/launching/PHPServerTab.java b/plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/debug/ui/launching/PHPServerTab.java
index 17bdae362..39437940c 100644
--- a/plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/debug/ui/launching/PHPServerTab.java
+++ b/plugins/org.eclipse.php.debug.ui/src/org/eclipse/php/debug/ui/launching/PHPServerTab.java
@@ -20,7 +20,7 @@ import org.eclipse.php.debug.core.PHPDebugPlugin;
import org.eclipse.php.debug.core.preferences.PHPProjectPreferences;
import org.eclipse.php.debug.ui.Logger;
import org.eclipse.php.debug.ui.PHPDebugUIMessages;
-import org.eclipse.php.server.apache.ui.ApacheServerTab;
+import org.eclipse.php.server.ui.ServerTab;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
@@ -29,22 +29,20 @@ import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
-public class PHPServerTab extends ApacheServerTab {
-
+public class PHPServerTab extends ServerTab {
+
public static final String RUN_WITH_DEBUG = "run_with_debug";
-
+
protected Button runWithDebugger;
protected boolean isChecked = false;
-
- public PHPServerTab()
- {
+
+ public PHPServerTab() {
super();
}
-
- public void createExtensionControls(Composite parent)
- {
+
+ public void createExtensionControls(Composite parent) {
GridData data = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
-
+
Composite composite = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
layout.marginWidth = 5;
@@ -52,43 +50,37 @@ public class PHPServerTab extends ApacheServerTab {
layout.numColumns = 2;
composite.setLayout(layout);
composite.setLayoutData(data);
-
- runWithDebugger = new Button(composite,SWT.CHECK);
- runWithDebugger.setText(PHPDebugUIMessages.PHPexe_Run_With_Debug_Info);
+
+ runWithDebugger = new Button(composite, SWT.CHECK);
+ runWithDebugger.setText(PHPDebugUIMessages.PHPexe_Run_With_Debug_Info);
GridData gd = new GridData(GridData.FILL_HORIZONTAL);
gd.horizontalSpan = 2;
runWithDebugger.setLayoutData(gd);
-
+
runWithDebugger.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent se) {
- Button b = (Button)se.getSource();
+ Button b = (Button) se.getSource();
isChecked = b.getSelection();
updateLaunchConfigurationDialog();
}
});
}
-
- protected void initializeExtensionControls(ILaunchConfiguration configuration)
- {
- try
- {
+
+ protected void initializeExtensionControls(ILaunchConfiguration configuration) {
+ try {
boolean checked = configuration.getAttribute(RUN_WITH_DEBUG, PHPDebugPlugin.getDebugInfoOption());
runWithDebugger.setSelection(checked);
- }
- catch (Exception e)
- {
- Logger.log(Logger.ERROR, "Error reading configuration", e); //$NON-NLS-1$
+ } catch (Exception e) {
+ Logger.log(Logger.ERROR, "Error reading configuration", e); //$NON-NLS-1$
}
}
-
- protected void applyExtension(ILaunchConfigurationWorkingCopy configuration)
- {
+
+ protected void applyExtension(ILaunchConfigurationWorkingCopy configuration) {
boolean checked = runWithDebugger.getSelection();
configuration.setAttribute(RUN_WITH_DEBUG, checked);
}
-
- protected boolean isValidExtension(ILaunchConfiguration launchConfig)
- {
+
+ protected boolean isValidExtension(ILaunchConfiguration launchConfig) {
return true;
}
@@ -102,7 +94,7 @@ public class PHPServerTab extends ApacheServerTab {
if(server == null)
return;
- if (server.getId().equals(IPHPConstants.Default_Server_ID)) {
+ if (server.getName().equals(IPHPConstants.Default_Server_Name)) { // TODO - Use ID instead ?
IWorkspaceRoot workspaceRoot = ResourcesPlugin.getWorkspace().getRoot();
IProject[] projects = workspaceRoot.getProjects();
IProject project = null;

Back to the top