First Steps for Developing Applications with Zend Studio

 

The following steps will help guide you through the basic process of using PDT to develop and run your PHP applications:

The first time PDT is launched, the Welcome Page is displayed.

 

 

Instructions on how to complete a procedure

To use the Welcome Page:

  1. Browse the Welcome Page to learn about PDT features and functionality.
    Click the home button in the top-right corner to be taken back to the main Welcome homeage.

  2. You can close the Welcome Page by clicking the icon in the Welcome tab, situated in the top-left corner of the window.PDT's workbench is displayed, by default showing the PHP perspective. This perspective contains a number of views to assist you in PHP development.
    The PHP Explorer view is a file system view displaying the PHP projects located in your workspace.

 

Install Zend Server (optional)

Zend Server is a complete, enterprise-ready Web Application Server for running and managing PHP applications that require a high level of reliability, performance and security. It includes the most reliable and up-to-date version of PHP, tested PHP extensions, database drivers and other enhancements. Zend Server comes bundled with Zend Framework (the leading open-source PHP framework), Apache and MySQL.

Zend Server provides automatic integration with PDT for an optimal environment for developing, deploying and debugging your PHP applications.

 

 

 

Instructions on how to complete a procedure

To install and configure Zend Server:

  1. Download Zend Server from http://www.zend.com/en/products/server/downloads.

  2. Install Zend Server according to the installation instructions. These will vary depending on your operating system.
    See http://files.zend.com/help/Zend-Server/zend-server.htm#installation_guide.htm for full information on installing Zend Server.

  3. If Zend Server is installed on the same machine as Zend Studio, Zend Studio will automatically detect and configure it.
    The auto detection can be triggered in two ways:

  1. Automatically when PDT is launched.
    A popup ballon will appear in the bottom-right corner of the window indicating that a Zend Server installation has been detected and configured.

  1. By clicking the Auto Detect Zend Server button  in the Servers view (this is available from the default PHP Perspective or can be manually opened by going to Window | Show View | Zend Servers | Servers).

Once a Zend Server installation has been detected, the integration between PDT and Zend Server enables you to easily deploy, run, debug and profile applications.

See Zend Server Integration for more information.

Create a PHP project

In order to start coding, you should create a PHP project which will contain the files for your application.

 

 

Instructions on how to complete a procedure

To create a new PHP project:

  1. From the menu bar, go to File | New | PHP Project
    -Or- In PHP Explorer view, right-click and select New | PHP Project.
    The New PHP Project wizard is displayed.

  1. Enter a name for the project in the project name field.

  2. In the Contents category, select the location and default contents of the new project.
    The options available are:

  3. Create new project in workspace - a new empty PHP project is created in your workspace.
    By default a workspace will have been created in @user.home/Zend/workspaces/DefaultWorkspace7 when you first launched PDT.

  4. Create a project from existing source - Creates a project which includes source files situated externally to the workspace.
    Click Browse to select the existing project contents.

  5. Create project on a local server - Creates a new PHP project on a local Zend Server. This option will only be available if a local Zend Server has been configured.

  1. Click Finish.

The new PHP project will be created in your workspace and displayed in PHP Explorer View.

See Creating PHP Projects for more information.

Create PHP Files

You can now start to develop your application by creating PHP Files in your project.

 

 

Instructions on how to complete a procedure

To create a new PHP file within you project:

  1. In PHP Explorer view, select the project you created.

  2. Right-click and select New | PHP File -or- go to File on the Menu Bar and select New | PHP File.
    The PHP File creation dialog is displayed.

  1. Enter the name of the file and click Finish.

Your file will open in the editor and will appear within your project in PHP Explorer view.

See Creating PHP Files for more information.

 

Create PHP Elements

You can use PDT's PHP element creation wizards to quickly and easily create PHP elements such as classes and interfaces within your code.

 

 

Instructions on how to complete a procedure

To create a new PHP class/interface

  1. In PHP Explorer view, right-click the project/file in which you want to create the new class/interface and select New | Class or Interface.
    The New PHP Class/Interface wizard is displayed

.

  1. Enter the required details and click Finish.

The new class/interface will be created with the required code.

 See Creating PHP Elements for more information.

Write Code

Manually type code in your files. As you type, code assist will suggest code options according to the context of the code.

You can select a required code string to quickly insert it into your script
If the Code Assist window does not pop up automatically, press Ctrl+Space.

See Code Assist for more information.

Rename Elements

If at any point during your development you want to rename an element, this can be easily done using the in-place refactoring feature

This will apply the rename operation to all occurrences of the required element so that all links between elements are maintained.

 

 

Instructions on how to complete a procedure

To rename an element within the editor:

  1. In the editor, place your cursor on the element to be renamed.

  2. From the menu bar select Refactor | Rename -or- right-click and select Refactor | Rename -or- press Alt-Shift-R.
    All occurrences of the element are put in a frame and the Refactor popup is displayed.

 

  1. Type the new element name in the box.
    All occurrences of the element name are automatically updated.

Note:

To preview the changes before applying them, click the arrow in the right-hand corner of the Refactor popup and select Preview.

  1. Click Enter to apply the refactoring.

The element will be renamed and all instances where that element is referenced will be updated to reflect the changes.

See Refactoring for more information.

Run your application

In order to preview the execution of your application on a server, you can easily run it in PDT's internal browser.

 

 

Instructions on how to complete a procedure

To run your application:

  1. Place your application on a Web server.
    If you selected the to create your project on a local Zend Server you can skip this step.

  1. In PHP Explorer, right-click the file from which you would like to start the execution and select Run As | PHP Web Page.
    The Run PHP Web Page dialog opens.

  1. Ensure the URL pointing to the file on the server is correct.
    Edit if necessary.

  2. Click OK.

Your application will be run and displayed in a browser.

You can periodically rerun your application to preview any changes you have made to your files during development. The files that will be executed will be the files statuted locally on your workspace, irrespective of any changes made to the server copies of the files.

See Running for more information.

 

In addition to the options and features highlighted in this document, PDT contains a wide range of features to help you with all aspects of your PHP development.