X-Git-Url: http://secure.phpeclipse.com diff --git a/net.sourceforge.phpeclipse.help/docbook-src/guide/src/en/user-manual/project.xml b/net.sourceforge.phpeclipse.help/docbook-src/guide/src/en/user-manual/project.xml new file mode 100644 index 0000000..533f57c --- /dev/null +++ b/net.sourceforge.phpeclipse.help/docbook-src/guide/src/en/user-manual/project.xml @@ -0,0 +1,400 @@ + + + + + + + Project + + So, when finished with setting up a workspace, we can go for our first PHP project. This is a necessary step, because a workspace alone will not help. We also need to set up a project within a workspace. As we want to work with PHP we will create a PHP project. + + + + Create a project + + For creating a project klick on + + File + New + Project... + (see ). This will open a project creation wizard dialog (see ). Now click on PHP Project under the PHP tree entry as you can see in . When you click on Next > the PHP Project dialog will be shown, where you can input a name for your new PHP Project. In our example we choose the name MyFirstPHPProject. Now, just click on Finish, and your project will be created. Now you should see your project within the Navigator pane (see x + + +
+ Create a new projec + + + + + + + + +
+ + +
+ Select a wizard + + + + + + + + +
+ + +
+ Name your PHP Project + + + + + + + + +
+ + +
+ The new PHP Project within the Navigator pane + + + + + + + + +
+
+ + + + Adding files to the project + + Now, as we have created a PHP project we need some PHP files in it. The following sections will explain the different aspects about adding a file to your project. + + + + Adding a simple file + + Per se, there are two different methods of adding a file to your project. Both are available through the File menu. + + + + The first method is to add a simple file to your project by clicking on + File + New + File + (see ). This will open the appropriate New File dialog. Input the name for that file (with the extension php), and click on Finish. This will add the new file to the Navigator pane, and opens an editor view. + + + +
+ Adding a simple file to the project + + + + + + + + +
+ + +
+ The <emphasis>New File</emphasis> Dialog + + + + + + + + +
+ + +
+ The new file in the <emphasis>Navigator</emphasis> view + + + + + + + + +
+ + +
+ The new file opened in PHP editor + + + + + + + + +
+
+ + + + Add a PHP file to the project + + The second method of adding a PHP file to your project is through + + File + New + PHP File + (see ). This will open a New PHP file dialog with a default File name entry of file.php (see ). We change the file name to mySecondFile.php (see ) and click on Finish. + + + + + This also will add a PHP file to your project as you can see in the Navigator view (see ), and it also opens this new file within the PHP editor (see ) as it was done in . + + + + But there is obviously a difference. In opposite to myFirstFile.php which is a real empty file, mySecondFile.php has some text in it (see ). The file we just created is filled with a template. + + + + The difference is only at creation time. The files themselfs, when created, do not differ in any sense. + + + + When we look at file system level, the absolute path of the files we just created are in respect of the current workspace, in general: workspace_path/project/file.php. For example if you have accepted the default workspace when you started eclipse (and your username is Robert): + + + + myFirstFile.php: C:/Dokuments and Settings/Robert/workspace/MyFirstPHPProject/myFirstFile.php + + + + + mySecondFile.php: C:/Dokuments and Settings/Robert/workspace/MyFirstPHPProject/mySecondFile.php + + + + + + + + The importance of knowing the absolute path is when the web server comes into account. As you want to test the program you have written, the web server needs access to your PHP files. This could be accomplished either when you set your web server's document root to point at your current workspace, or set your workspace to the currect web server's document root. + + + + But there is a third way, which will make things easier, as you can leave the workspace wherever you want, and also do not need to change the web server's document root. + + + +
+ Adding a PHP file to the project + + + + + + + + +
+ + +
+ The <emphasis>New PHP file</emphasis>dialog + + + + + + + + +
+ + +
+ Change the name to what you like + + + + + + + + +
+ + +
+ The new PHP file in the &navview; + + + + + + + + +
+ + +
+ The new PHP file opened in PHP editor + + + + + + + + +
+
+ + + + Add existing files to the project + + There are generally two ways to add files, which already exists anywhere on your file system, to a projectEvery file which you want to open and handle with &phpeclipse; needs to be within a project.. + + + + Import Files + + You can import files from anywhere on your local machine by eclipse itself via + File + Import... + (see ) or by manually copying the files via the file system into your project folder (see ). In fact the way via Import... is more convenient. + + + + But this method only makes a copy of existing files, and doesn't disburden you from changing the web server's &docroot;. Especially if the files you have currently imported to your workspace are located on your current web server's &docroot;. + + + + In this case it would be easier to set the workspace to the current web server's &docroot;, or do as described in the following section . + + + +
+ Import Files into Project + + + + + + + + +
+ +
+ + + + Link Folders + + Indeed, this should be the best option if you want to have independence between a eclipse workspace and the web server's &docroot;. + + + + + + + Create a new project (e.g. MyLinkedPHPProject). + + + + + Right click on this project within the Navigator View to open the context menu and click on. + + New + Folder + (see ). + + + + + Click on Advanced >> and enable Link to folder in the file system (see ). + + + + + Now you can either manually enter the path or browse to the folder which is to link. In the example we input C:\Program Files\apachefriends\xampp\htdocs, and click on Finish. The &navview; should now look like (see ). + + + + + At last we have to set the correct &docroot; (which is C:\Program Files\apachefriends\xampp\htdocs) within the project properties as shown in + + + + + + +
+ Add a Folder to Project + + + + + + + + +
+ + +
+ Create a Link Folder + + + + + + + + +
+ + +
+ The &navview; with the new Project + + + + + + + + +
+ + +
+ Change the Project's DocumentRoot Setting + + + + + + + + +
+ +
+
+
+