aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorzzhongwei2012-10-10 23:27:12 (EDT)
committerzzhongwei2012-10-14 22:54:50 (EDT)
commit3a471601cbcc1448de8c6cfb87d9c6ab514101f2 (patch)
tree89d4c4109c9a958d2fba05f5a2e768ea861ce502
parentde8a9e1be0e9e2c60de679a78df83ef005adb425 (diff)
downloadorg.eclipse.pdt-3a471601cbcc1448de8c6cfb87d9c6ab514101f2.zip
org.eclipse.pdt-3a471601cbcc1448de8c6cfb87d9c6ab514101f2.tar.gz
org.eclipse.pdt-3a471601cbcc1448de8c6cfb87d9c6ab514101f2.tar.bz2
390594: Execution Environments dialog won't see php4 executable
https://bugs.eclipse.org/bugs/show_bug.cgi?id=390594
-rw-r--r--plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/preferences/PHPexes.java84
1 files changed, 69 insertions, 15 deletions
diff --git a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/preferences/PHPexes.java b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/preferences/PHPexes.java
index 6ca9e39..0a0e270 100644
--- a/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/preferences/PHPexes.java
+++ b/plugins/org.eclipse.php.debug.core/src/org/eclipse/php/internal/debug/core/preferences/PHPexes.java
@@ -200,6 +200,60 @@ public class PHPexes {
return map.get(name);
}
+ public PHPexeItem getItem(String name) {
+ for (Iterator<String> iterator = items.keySet().iterator(); iterator
+ .hasNext();) {
+ String debuggerId = iterator.next();
+ HashMap<String, PHPexeItem> map = items.get(debuggerId);
+ if (map != null) {
+ PHPexeItem item = map.get(name);
+ if (item != null) {
+ return item;
+ }
+ }
+ }
+ return null;
+ }
+
+ public PHPexeItem getPHP54Item() {
+ for (Iterator<String> iterator = items.keySet().iterator(); iterator
+ .hasNext();) {
+ String debuggerId = iterator.next();
+ HashMap<String, PHPexeItem> map = items.get(debuggerId);
+ if (map != null) {
+ for (Iterator<PHPexeItem> iterator2 = map.values().iterator(); iterator2
+ .hasNext();) {
+ PHPexeItem item = iterator2.next();
+ if (item != null
+ && item.getVersion().compareTo("5.4.0") >= 0) {
+ return item;
+ }
+ }
+ }
+ }
+ return null;
+ }
+
+ public List<PHPexeItem> getPHP54Items() {
+ List<PHPexeItem> result = new ArrayList<PHPexeItem>();
+ for (Iterator<String> iterator = items.keySet().iterator(); iterator
+ .hasNext();) {
+ String debuggerId = iterator.next();
+ HashMap<String, PHPexeItem> map = items.get(debuggerId);
+ if (map != null) {
+ for (Iterator<PHPexeItem> iterator2 = map.values().iterator(); iterator2
+ .hasNext();) {
+ PHPexeItem item = iterator2.next();
+ if (item != null
+ && item.getVersion().compareTo("5.4.0") >= 0) {
+ result.add(item);
+ }
+ }
+ }
+ }
+ return result;
+ }
+
/**
* Search for the executable file name in all of the registered
* {@link PHPexeItem}s and return a reference to the one that refer to the
@@ -305,8 +359,7 @@ public class PHPexes {
locationsString = "";
}
final String[] phpExecutablesLocations = locationsString.length() > 0 ? locationsString
- .split(SEPARATOR)
- : new String[0];
+ .split(SEPARATOR) : new String[0];
// Load the item executable ini's array
String inisString = prefs
@@ -327,8 +380,7 @@ public class PHPexes {
debuggersString = "";
}
final String[] debuggers = debuggersString.length() > 0 ? debuggersString
- .split(SEPARATOR)
- : new String[0];
+ .split(SEPARATOR) : new String[0];
// Load the PHP Versions array
String defaultItemForPHPVersionString = prefs
@@ -480,17 +532,16 @@ public class PHPexes {
PHPDebugPlugin
.getDefault()
.getLog()
- .log(
- new Status(
- 1,
- PHPDebugPlugin.getID(),
- 1001,
- "PHP executable "
- + location
- + " not found neither in plugin "
- + pluginId
- + " nor in fragments attached to it",
- null));
+ .log(new Status(
+ 1,
+ PHPDebugPlugin.getID(),
+ 1001,
+ "PHP executable "
+ + location
+ + " not found neither in plugin "
+ + pluginId
+ + " nor in fragments attached to it",
+ null));
}
}
}
@@ -655,6 +706,9 @@ public class PHPexes {
public PHPexeItem[] getCompatibleItems(PHPexeItem[] allItems,
PHPVersion version) {
+ if (version.equals(PHPVersion.PHP4)) {
+ return allItems;
+ }
String versionNumber = version.getAlias().substring(3);
PHPexeItem[] result;
List<PHPexeItem> list = new ArrayList<PHPexeItem>();