X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse.help/docbook-src/guide/src/en/user-manual/workspace.xml b/net.sourceforge.phpeclipse.help/docbook-src/guide/src/en/user-manual/workspace.xml new file mode 100644 index 0000000..cde1cbc --- /dev/null +++ b/net.sourceforge.phpeclipse.help/docbook-src/guide/src/en/user-manual/workspace.xml @@ -0,0 +1,214 @@ + + + + + + + Workspace + + Once you have installed &eclipse; and start it the first time &eclipse; asks you about selecting a workspace. The (see . The default path for the workspace on a Windows system is C:\Documents and Settings\your_username\workspace. Even if you don't know what the workspace is good for, and even if you don't know whether this is a good place for a workspace you can safely accept this path with clicking OK. + + + + It is also no problem to activate the Use this as default and do not ask again. You can always change your workspace and/or can activate to be asked again for a workspace when &eclipse; is starting. + + +
+ Select a workspace + + + + + + + + +
+ + + + Changing the workspace + + You can change the workspace after &eclipse; has started by clicking on + + File + Switch Workspace... + (see + This opens a dialog (see where you can select an already existing workspace, or a new folder which should be used as a workspace. + + + +
+ Switch a workspace + + + + + + + + +
+ +
+ Select a workspace + + + + + + + + +
+
+ + + + Activate the <quote>Select a workspace</quote> dialog + + In case you have deactivated the prompting for a workspace setting, you can activate it again by clicking on + + Window + Preferences + General + Startup and Shutdown + and then activating Prompt for workspace on startup (see ) + + + +
+ Activate prompt for workspace + + + + + + + + +
+
+ + + + What workspace to choose for PHP + + So now I know how to select a workspace, but what is a good place for a workspace. I have different projects and/or have already existing files, have a already running webserver. So how does this all match? + + + + So, as all roads lead to Rome there are several different methods which will be discussed in the following sections. But first, let us explain how the workspace directory will look like, as the structure of a workspace will always be the same (independent of where it is located). + + + + Within the workspace folder there is a folder named .metadata, which we will, for simplicity, not discuss here. Besides this folder, &eclipse; will create additional folders for every project, independently whether the project is a PHP, Java or anything else project. + + + + + Workspace Method 1 + + The workspace is set to be in the Documents and Settings folder and also the PHP-files are located within the workspace. + + + + In this case we would have the following path: C:\Documents and Settings\Robert\workspace. When we have created a project (e.g. MyFirstPHPProject) through &eclipse; and create a PHP-file (e.g. index.php) we would see the file as: C:\Documents and Settings\Robert\workspace\MyFirstPHPProject\index.php. + + + + + Configure Web Server by changing Document Root + + Given that our webserver is installed in a different directory and also the &docroot; points to a different directory, we have to change the &docroot; path to our workspace folder (see ), which would be the following in our example:C:\Documents and Settings\Robert\workspace + + + + As the project's default &docroot; is set to the current workspace, we do not need to change anything. + + + + In this case the file myFirstFile.php can be called by the web browser with the following URL: + + + + + + + Configure Web Server by adding Alias + + As an alternative to changing the &docroot; we can add an alias (see ) to the web server's configuration file. In this case we also would have to change the localhost setting within our project properties. + + +
+ Set localhost when using Alias + + + + + + + + +
+
+
+ + + + Workspace Method 2 + + The workspace path is the same as the &docroot; path. + + + + In some cases (or maybe in many?) people which tries to work with &phpeclipse; have already set up a working Apache and PHP environment. Which means, they have already a htdocs directory anywhere on their local machine, and they have already some PHP-files within the existing htdocs folder. And they don't want to move all their files into the &eclipse; workspace folder. One way to accomplish this would be to set the &eclipse; workspace to the already existing htdocs folder. + + + + For example you have set up XAMPP and your &docroot; path is the XAMPP default: C:\Program Files\apachefriends\xampp\htdocs, then your appropriate workspace path should be one level less: C:\Program Files\apachefriends\xampp. Now you create a new PHP project and name it htdocs. &phpeclipse; will automatically add all files within the htdocs folder to the project. Just adjust the project's DocumentRoot setting as described in . + + + + + + Workspace Method 3 + + The workspace is set to be in the Documents and Settings folder and the PHP-files are in a different folder. + + + + As we have seen how we can work with method 1 and method 2, there is another method of setting up your workspace and project which also allows you to hold the &eclipse; workspace and your PHP-files separated. + + + + For example your workspace path is C:\Documents and Settings\Robert\workspace and your current &docroot; is C:\Program Files\apachefriends\xampp\htdocs. See how to set up a project for this case. + + + + +
+