Adding a new PHP project
When you add a new PHP: Hypertext Preprocessor (PHP) project to the application, you specify the project name, browse to the working directory, and then specify the source roots and project dependencies. The project dependencies can also be set in the Project Dependencies tab of the project properties after the project has been created.
About this task
The steps in this topic direct you to complete all pages in the New Project Wizard (or New Application Wizard, if you are creating the project in it). However, some of the pages in the wizard are optional (required settings are complete when the Finish button is activated). Settings made in the wizard can be modified after project creation in the Properties view for a selected project. If you complete the New Project Wizard without completing optional pages, you can change the settings from those pages later on in the Properties view.
Procedure
- In the Explorer view, select the application that you want to add the project to (if you have not already added an application, see Configuring applications).
-
Complete one of these actions to open the New Project Wizard:
- Select from the main workbench menu.
- Right-click the selected application and choose from the context menu.
- In the Select Project Type page of the wizard, select PHP as the project type and then click Next to advance to the next wizard page.
- In the Project Sources wizard page:
- PHP Project Configuration: In the PHP Document Root field, enter or browse to a directory that represents the root of your PHP application. This is the file system directory that is mapped to the site's base URL. If a PHP document root is not specified, the source root that was specified in the Project Sources page will be used.
- Optional: Set an Include Path.
Include path directories are used to resolve relative paths to files
used in PHP
include
statements (for example,include
,include_once
,require
,require_once
). - Optional: Set a Class Include Path. Class include path directories are used to find files that contain PHP class definitions.
- Click Finish.
Example: Creating a new PHP project
About this task
Procedure
- Complete one of these actions:
- Select from the main menu bar.
- In the Explorer view toolbar, click the Add Application Menu down-arrow button and select Create a new application from the menu.
- In the Explorer view, right-click All Applications and then select from the menu.
- Enter a Name for the application.
- Browse to the Working Directory in which to save the application. The new application file name extension will be .paf.
- Click Next to configure the project.
- In the Select Project Type page of the wizard, select PHP as the project type and then click Next to advance to the next wizard page.
- In the Project Sources page:
- In the Name field, enter a name
for the project - for example
MyProject
. - In the Working Directory field, browse to the location in which you want to store the project file that will be created - for example, C:\Apps\MyProject.
- Click Add Source Root to add all directories that contain PHP files that should be scanned. For example, in the Select a File or Directory dialog box, browse to C:\Apps\MyProject\root and then click OK to close the dialog box.
Click Next. - In the Name field, enter a name
for the project - for example
- In the PHP Project Configuration page:
- In the PHP Document Root field, enter or browse for the directory that represents the root of your PHP application. This is the file system directory that is mapped to the site's base URL. By default, this field pre-populates with the source root that was specified in the Project Sources page.
- Optional: Add include path directories.
These are used to resolve relative paths to files used in PHP Include
statements (for example,
include
,include_once
,require
,require_once
). - Optional: Add class path directories. These are used to find files that contain PHP class definitions.
- Click Finish. You now have a PHP project that is ready to be scanned.