Added two new workspaces preferences, to track the location of httpd.conf and etc...
authorstefanbjarni <stefanbjarni>
Tue, 7 Jun 2005 21:25:26 +0000 (21:25 +0000)
committerstefanbjarni <stefanbjarni>
Tue, 7 Jun 2005 21:25:26 +0000 (21:25 +0000)
These two files can be modified to create new virtual hosts in the web server.

net.sourceforge.phpeclipse/prefs/default_linux.properties
net.sourceforge.phpeclipse/prefs/default_macosx.properties
net.sourceforge.phpeclipse/prefs/default_win32.properties
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/IPreferenceConstants.java
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPEclipseBasePreferencePage.java
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPeclipsePlugin.java
net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/preferences/PHPPreferencesMessages.properties

index 47e56e1..4303a36 100644 (file)
@@ -1,5 +1,5 @@
-_php_run_pref=/opt/lamp/php/php
-_external_parser=/opt/lamp/php/php -l -f {0}
+_php_run_pref=/opt/lampp/php/php
+_external_parser=/opt/lampp/php/php -l -f {0}
 _mysql_run_pref=/opt/lampp/lampp startmysql
 _apache_run_pref=/opt/lampp/lampp
 _xampp_start_pref=/opt/lampp/lampp start
@@ -11,4 +11,6 @@ __apache_restart=restart
 _mysql_start_background=true
 _apache_start_background=true
 _apache_stop_background=true
-_apache_restart_background=true
\ No newline at end of file
+_apache_restart_background=true
+__httpd_conf_path=/opt/lampp/apache/conf/httpd.conf
+__etc_hosts_path=/etc/hosts
\ No newline at end of file
index 47e56e1..4303a36 100644 (file)
@@ -1,5 +1,5 @@
-_php_run_pref=/opt/lamp/php/php
-_external_parser=/opt/lamp/php/php -l -f {0}
+_php_run_pref=/opt/lampp/php/php
+_external_parser=/opt/lampp/php/php -l -f {0}
 _mysql_run_pref=/opt/lampp/lampp startmysql
 _apache_run_pref=/opt/lampp/lampp
 _xampp_start_pref=/opt/lampp/lampp start
@@ -11,4 +11,6 @@ __apache_restart=restart
 _mysql_start_background=true
 _apache_start_background=true
 _apache_stop_background=true
-_apache_restart_background=true
\ No newline at end of file
+_apache_restart_background=true
+__httpd_conf_path=/opt/lampp/apache/conf/httpd.conf
+__etc_hosts_path=/etc/hosts
\ No newline at end of file
index 251b611..8ee625d 100644 (file)
@@ -11,4 +11,6 @@ __apache_restart=-k restart
 _mysql_start_background=true
 _apache_start_background=true
 _apache_stop_background=true
-_apache_restart_background=true
\ No newline at end of file
+_apache_restart_background=true
+__httpd_conf_path=c:\\xampp\\apache\\conf\\httpd.conf
+__etc_hosts_path=c:\\windows\\system32\\drivers\\etc\\hosts
\ No newline at end of file
index e9278cf..5c67cd6 100644 (file)
@@ -55,6 +55,10 @@ public interface IPreferenceConstants {
   public static final String APACHE_RESTART_BACKGROUND = "_apache_restart_background";
 
   public static final String APACHE_RESTART_PREF = "__apache_restart";
+  
+  public static final String HTTPD_CONF_PATH_PREF = "__httpd_conf_path";
+  
+  public static final String ETC_HOSTS_PATH_PREF = "__etc_hosts_path";
 
   public static final String SHOW_OUTPUT_IN_CONSOLE = "_show_output_in_console";
 
index 3262fb0..dcc1599 100644 (file)
@@ -21,8 +21,8 @@ import org.eclipse.ui.IWorkbenchPreferencePage;
 public class PHPEclipseBasePreferencePage extends PreferencePage implements IWorkbenchPreferencePage {
 
   StringFieldEditor phpParserExtensionsSFE;
-  StringFieldEditor xamppStartSFE;
-  StringFieldEditor xamppStopSFE;
+  FileFieldEditor xamppStartSFE;
+  FileFieldEditor xamppStopSFE;
   StringFieldEditor apacheStartSFE;
 
   StringFieldEditor apacheStopSFE;
@@ -33,6 +33,10 @@ public class PHPEclipseBasePreferencePage extends PreferencePage implements IWor
 
   FileFieldEditor apacheRunFFE;
 
+  FileFieldEditor httpdConfFFE;
+
+  FileFieldEditor etcHostsFFE;
+
   FileFieldEditor mysqlRunFFE;
 
   FileFieldEditor phpRunFFE;
@@ -64,6 +68,8 @@ public class PHPEclipseBasePreferencePage extends PreferencePage implements IWor
     mySQLCommandSFE.loadDefault();
     phpRunFFE.loadDefault();
     apacheRunFFE.loadDefault();
+    httpdConfFFE.loadDefault();
+    etcHostsFFE.loadDefault();
     mysqlRunFFE.loadDefault();
     apacheStartBFE.loadDefault();
     apacheStopBFE.loadDefault();
@@ -83,6 +89,8 @@ public class PHPEclipseBasePreferencePage extends PreferencePage implements IWor
     mySQLCommandSFE.store();
     phpRunFFE.store();
     apacheRunFFE.store();
+    httpdConfFFE.store();
+    etcHostsFFE.store();
     mysqlRunFFE.store();
 
     apacheStartBFE.store();
@@ -118,20 +126,17 @@ public class PHPEclipseBasePreferencePage extends PreferencePage implements IWor
     apacheSettingsGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
     apacheSettingsGroup.setLayout(new GridLayout());
 
-    
-    xamppStartSFE = new StringFieldEditor(IPreferenceConstants.XAMPP_START_PREF, PHPPreferencesMessages
+    xamppStartSFE = new FileFieldEditor(IPreferenceConstants.XAMPP_START_PREF, PHPPreferencesMessages
         .getString("PHPBasePreferencePage.apacheGroup.xampp_start"), apacheSettingsGroup);
     xamppStartSFE.setPreferencePage(this);
     xamppStartSFE.setPreferenceStore(getPreferenceStore());
     xamppStartSFE.load();
-    new Label(apacheSettingsGroup, SWT.NONE);
     
-    xamppStopSFE = new StringFieldEditor(IPreferenceConstants.XAMPP_STOP_PREF, PHPPreferencesMessages
+    xamppStopSFE = new FileFieldEditor(IPreferenceConstants.XAMPP_STOP_PREF, PHPPreferencesMessages
         .getString("PHPBasePreferencePage.apacheGroup.xampp_stop"), apacheSettingsGroup);
     xamppStopSFE.setPreferencePage(this);
     xamppStopSFE.setPreferenceStore(getPreferenceStore());
     xamppStopSFE.load();
-    new Label(apacheSettingsGroup, SWT.NONE);
     
     apacheStartBFE = new BooleanFieldEditor(PHPeclipsePlugin.APACHE_START_BACKGROUND, PHPPreferencesMessages
         .getString("PHPBasePreferencePage.apacheGroup.start_background"), apacheSettingsGroup);
@@ -182,6 +187,18 @@ public class PHPEclipseBasePreferencePage extends PreferencePage implements IWor
     apacheRunFFE.setPreferenceStore(getPreferenceStore());
     apacheRunFFE.load();
 
+    httpdConfFFE = new FileFieldEditor(IPreferenceConstants.HTTPD_CONF_PATH_PREF, PHPPreferencesMessages
+            .getString("PHPBasePreferencePage.apacheGroup.httpdconf"), apacheSettingsGroup);
+    httpdConfFFE.setPreferencePage(this);
+    httpdConfFFE.setPreferenceStore(getPreferenceStore());
+    httpdConfFFE.load();
+
+    etcHostsFFE = new FileFieldEditor(IPreferenceConstants.ETC_HOSTS_PATH_PREF, PHPPreferencesMessages
+            .getString("PHPBasePreferencePage.apacheGroup.etchosts"), apacheSettingsGroup);
+    etcHostsFFE.setPreferencePage(this);
+    etcHostsFFE.setPreferenceStore(getPreferenceStore());
+    etcHostsFFE.load();
+
     phpRunFFE = new FileFieldEditor(IPreferenceConstants.PHP_RUN_PREF, PHPPreferencesMessages
         .getString("PHPBasePreferencePage.console.php"), apacheSettingsGroup);
     phpRunFFE.setPreferencePage(this);
index 495d57d..74845aa 100644 (file)
@@ -696,7 +696,8 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements IPreferenceCon
     String operatingSystem = Platform.getOS();
     // maxosx, linux, solaris, win32,...
     try {
-      InputStream is = getDefault().openStream(new Path("prefs/default_" + operatingSystem + ".properties"));
+      InputStream is = getDefault().openStream(
+               new Path("prefs/default_" + operatingSystem + ".properties"));
       PropertyResourceBundle resourceBundle = new PropertyResourceBundle(is);
       Enumeration enum = resourceBundle.getKeys();
       String key;
@@ -704,19 +705,6 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements IPreferenceCon
         key = (String)enum.nextElement();
         store.setDefault(key, resourceBundle.getString( key ));
       }
-//      store.setDefault(PHP_RUN_PREF, resourceBundle.getString(PHP_RUN_PREF));
-//      store.setDefault(EXTERNAL_PARSER_PREF, resourceBundle.getString(EXTERNAL_PARSER_PREF));
-//      store.setDefault(MYSQL_RUN_PREF, resourceBundle.getString(MYSQL_RUN_PREF));
-//      store.setDefault(APACHE_RUN_PREF, resourceBundle.getString(APACHE_RUN_PREF));
-//      
-//      store.setDefault(MYSQL_PREF, resourceBundle.getString(MYSQL_PREF));
-//      store.setDefault(APACHE_START_PREF, resourceBundle.getString(APACHE_START_PREF));
-//      store.setDefault(APACHE_STOP_PREF, resourceBundle.getString(APACHE_STOP_PREF));
-//      store.setDefault(APACHE_RESTART_PREF, resourceBundle.getString(APACHE_RESTART_PREF));
-//      store.setDefault(MYSQL_START_BACKGROUND, resourceBundle.getString(MYSQL_START_BACKGROUND));
-//      store.setDefault(APACHE_START_BACKGROUND, resourceBundle.getString(APACHE_START_BACKGROUND));
-//      store.setDefault(APACHE_STOP_BACKGROUND, resourceBundle.getString(APACHE_STOP_BACKGROUND));
-//      store.setDefault(APACHE_RESTART_BACKGROUND, resourceBundle.getString(APACHE_RESTART_BACKGROUND));
     } catch (Exception e) {
       // no default properties found
       if (operatingSystem.equals(Platform.OS_WIN32)) {
@@ -726,6 +714,8 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements IPreferenceCon
         store.setDefault(APACHE_RUN_PREF, "c:\\apache\\apache.exe");
         store.setDefault(XAMPP_START_PREF, "c:\\xampp\\xampp_start.exe");
         store.setDefault(XAMPP_STOP_PREF, "c:\\xampp\\xampp_stop.exe");
+        store.setDefault(
+               ETC_HOSTS_PATH_PREF, "c:\\windows\\system32\\drivers\\etc\\hosts");
       } else {
         store.setDefault(PHP_RUN_PREF, "/apache/php/php");
         store.setDefault(EXTERNAL_PARSER_PREF, "/apache/php/php -l -f {0}");
index 7db8fcf..19b09d6 100644 (file)
@@ -39,6 +39,8 @@ PHPBasePreferencePage.apacheGroup=Apache Settings
 PHPBasePreferencePage.apacheGroup.xampp_start=XAMPP Start
 PHPBasePreferencePage.apacheGroup.xampp_stop=XAMPP Stop
 PHPBasePreferencePage.apacheGroup.run=Apache
+PHPBasePreferencePage.apacheGroup.httpdconf=httpd.conf
+PHPBasePreferencePage.apacheGroup.etchosts=etc/hosts
 PHPBasePreferencePage.apacheGroup.start=Start Apache
 PHPBasePreferencePage.apacheGroup.start_background=Run in background mode
 PHPBasePreferencePage.apacheGroup.stop=Stop Apache