Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrganor2011-03-23 13:59:18 -0400
committerrganor2011-03-23 13:59:18 -0400
commit61f54721462c3b44915edab5bf21d121a2d82a36 (patch)
tree0f3d34d2c4cb9fa89989d3344989d123b7b4b702
parent257ef4839d79cb5ae57397f0222e25469ca9e661 (diff)
downloadorg.eclipse.pdt-61f54721462c3b44915edab5bf21d121a2d82a36.tar.gz
org.eclipse.pdt-61f54721462c3b44915edab5bf21d121a2d82a36.tar.xz
org.eclipse.pdt-61f54721462c3b44915edab5bf21d121a2d82a36.zip
OPEN - PHP 5.3 should be used by default
-rw-r--r--plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/PHPVersion.java64
-rw-r--r--plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/preferences/CorePreferenceConstants.java2
2 files changed, 65 insertions, 1 deletions
diff --git a/plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/PHPVersion.java b/plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/PHPVersion.java
new file mode 100644
index 000000000..7d1dd5e20
--- /dev/null
+++ b/plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/PHPVersion.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2009 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ * Zend Technologies
+ *******************************************************************************/
+package org.eclipse.php.internal.core;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * This enumeration defines supported PHP versions.
+ */
+public enum PHPVersion {
+
+ PHP4("php4"), //$NON-NLS-1$
+ PHP5("php5"), //$NON-NLS-1$
+
+ /**
+ * This 5.3 is a major version - it should be 5.0, actually.
+ * <p>
+ * New in this version:
+ * <ul>
+ * <li><a href="http://www.php.net/language.namespaces">Namespaces</a>
+ * <li><a href="http://wiki.php.net/rfc/closures">Closures</a>
+ * <li><a href="http://www.php.net/oop5.late-static-bindings">Late Static
+ * Binding</a>
+ * </ul>
+ */
+ PHP5_3("php5.3"); //$NON-NLS-1$
+
+ private String alias;
+
+ private static class Aliases {
+ private static Map<String, PHPVersion> map = new HashMap<String, PHPVersion>();
+ }
+
+ PHPVersion(String alias) {
+ this.alias = alias;
+ Aliases.map.put(alias, this);
+ }
+
+ public String getAlias() {
+ return alias;
+ }
+
+ public static PHPVersion byAlias(String alias) {
+ return Aliases.map.get(alias);
+ }
+
+ public boolean isLessThan(PHPVersion phpVersion) {
+ return ordinal() < phpVersion.ordinal();
+ }
+
+ public boolean isGreaterThan(PHPVersion phpVersion) {
+ return ordinal() > phpVersion.ordinal();
+ }
+}
diff --git a/plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/preferences/CorePreferenceConstants.java b/plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/preferences/CorePreferenceConstants.java
index 27440cbfc..dad8b7cbb 100644
--- a/plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/preferences/CorePreferenceConstants.java
+++ b/plugins/org.eclipse.php.core/src/org/eclipse/php/internal/core/preferences/CorePreferenceConstants.java
@@ -36,7 +36,7 @@ public class CorePreferenceConstants {
public static void initializeDefaultValues() {
IEclipsePreferences node = new DefaultScope().getNode(PHPCorePlugin.ID);
- node.put(Keys.PHP_VERSION, PHPVersion.PHP5.getAlias());
+ node.put(Keys.PHP_VERSION, PHPVersion.PHP5_3.getAlias());
node.put(PHPCoreConstants.TASK_TAGS, PHPCoreConstants.DEFAULT_TASK_TAGS);
node.put(PHPCoreConstants.TASK_PRIORITIES,
PHPCoreConstants.DEFAULT_TASK_PRIORITIES);

Back to the top