Home

User Guide Zend Studio 7.x

image

Contents

1. The Zend Server Code Tracer perspective contains the following views Tracer View 509 Zend Studio 7 User Guide Tracer View The Tracer view displays the Imported Zend Server Event File FE Tracer BH ei a Tracing Tree Statistics per Functon kal Show memory usage Total running time all calls Function Name of Calls Including Children Just own Located in file E drupal_bootstrapO 0 145 ms bootstrap ine E drupal_unset_globalsQ Calls for _drupal_bootstrap Memory Consumed Total Time Own Time Called from 5 512 bytes 12 45 ms 0 01 ms beotstrap inc 883 8 bytes 1 72 ms 1 71 ms bootstrap inc 883 468 bytes 37 23 ms 0 01 ms beotstrap inc 983 The Tracer view includes the following tabs Tracing Tree Displays the call tree for a selected event or trace file For more information see Code Tracing Tree in the Zend Server Online Documentation Statistics per Function A table based display that provides a statistical perspective of the data captured in the request For more information see Code Tracing Statistics in the Zend Server Online Documentation The Tracer View is displayed by default as part of the Debug Perspective To manually open the view go to Window Show View Other Zend Servers Tracer 510 Reference Additional Views PHP Functions View The PHP Functions view lists most commonly used PHP Classes Constants and
2. Vv Yaidate onneaan on finish I Save password 1 Saved passwords are stored on your computer in a file that is dificult but not mpossibie for an intruder to read CS cnt Lal 3 Enter the information required to identify and connect to the repository location Host The host address e g mycomputer com Repository path The path to the repository on the host e g usr local cvsroot User The user name with which you connect to the repository Password The password for the user name Connection Type The authentication protocol for the CVS server There are four connection methods 249 Zend Studio 7 User Guide i pserver a CVS specific connection method ii extssh an SSH 2 0 client iii pserverssh2 provides a pserver connection over ssh2 iv ext the CVS ext connection method which uses an external tool such as SSH to connect to the repository If the host uses a custom port enable Use Port and enter the port number 4 Click Finish to create your connection Your CVS repository will now be added to the CVS Repository view See Creating a CVS Repository Location in the Workbench User Guide for more information Additional user guides can be accessed from inside Zend Studio by going to Help Help Contents or from the Eclipse Online Documentation site http help eclipse org ganymede index jsp 250 Tasks Importing Projects from CVS Once projects are placed
3. Name Description Defines the view s layout Vertical View Orientation The details pane will be displayed at the bottom of the Variables view Horizontal View Orientation The details pane will be displayed to the right of the Variables view Variables View Only Only the Variables view will be displayed Show columns Divide the view into columns Set Columns Only available if Show columns is selected Allows you to choose which of the following columns to display e Name e Declared Type e Value e Actual Type The Variables View PHP Debug Perspective is displayed by default as part of the Debug Perspective To manually open the view go to Window Show View Other Debug Variables 495 Zend Studio 7 User Guide Breakpoints View PHP Debug Perspective The Breakpoints view displays and allows you to monitor and control the breakpoints set in the files being debugged Variables Go Breakpaints 23 iP Parameter Stack S t p TO Fas M DebugDemo php line 45 DebugDemo php line 73 Mr Breakpoints View Toolbar Commands fe e Remove Selected Removes the selected Breakpoints from the file Breakpoints E Remove All Breakpoints Removes all Breakpoints from the file Show Breakpoints If selected only breakpoints supported by the current Supported By Selected debug target will be displayed For example ilf a PHP Targets file is being debugge
4. Debug a previously executed launch configuration Debug As Debug the active file as a PHP Script PHP Web Page or when applicable a PHPUnit Test Debug Configurations Opens the Debug dialog Organize Favorites Allows you to select which launch configurations should be added to your Favorites list Your Favorite launches will be listed first in the launch configuration list Clicking the Run Button executes the last run configuration Clicking the arrow next to the icon gives access to the following options Runa previously executed launch configuration Run As Run the active file as a PHP Script PHP Web Page or when applicable a PHPUnit Test Run Configurations Opens the Run dialog Organize Favorites Allows you to select which launch configurations should be added to your Favorites list Your Favorite launches will be listed first in the launch configuration list 546 Reference Shortcut Description Keys Clicking the Profile Button executes the last run configuration Clicking the arrow next to the icon gives access to the following options Profile a previously executed launch configuration Profile As Profiles the active file as a PHP Script PHP Web Page or when applicable a PHPUnit Test Profile Configurations Opens the Debug dialog Organize Favorites Allows you to select which launch configurations should be added to your Favorites list Your Favorite launche
5. You must now set the project s JavaScript Build Path in order for the required JavaScript libraries and files to be accessed by the project Removing JavaScript Support If you are not using JavaScript libraries or files in your project you can remove JavaScript support for that project To remove JavaScript Support for existing PHP Projects In PHP Explorer view right click the project for which you want to enable JavaScript support and select Configure Remove JavaScript Support JavaScript support will be removed from the project and no JavaScript libraries or external files will be available to the project 451 Zend Studio 7 User Guide Setting the JavaScript Build Path The JavaScript build process scans all files folders projects and libraries that are on the project s JavaScript Build Path so that resources which are referenced in the project can be made available for Content Assist options and Refactoring operations The required resources must therefore be included in the JavaScript Build Path JavaScript s Build Path allows you to select JavaScript resources to include exclude from this process Rather than automatically scanning all referenced projects and libraries configuring the JavaScript Build Path allows you to select which resources will be scanned and so can significantly speed up the build process JavaScript Support must be enabled for the project before you can set the JavaScript Build Path The Java
6. Click the arrow next to the debug button E on the toolbar and select Open Debug Dialog or select Run Open Debug Dialog A Debug dialog will open Double click the PHP Web Page option to create a new debug configuration Name New configuration 1 Server Advanced Common Server Server Debugger Zend Debugger Ki PHP Server Def aut PHP Web Server k New Corfigure Check Debug Server Connection Fre Prono so Broabport V Break at First Line LPL Auto Generate Enter a name for the new configuration Select the Server Debugger to be used by default this will be the Zend Debugger Select your server from the PHP Server list If you have not yet configured your server click New The PHP Server Creation Wizard will open Configure your server by following the instructions on adding a new server under the PHP Servers Preferences page For more information on configuring the communication between Zend Studio and your remote server see Setting Up Remote Debugging To check whether your server connection is correctly configured and that Zend Studio can communicate with your server debugger click the Check Debug Server Connection button Under PHP File click Browse and select your debug target file the file from which the debugging process will start Select whether the Debugger should stop at the first line of code by marking unmarking the Break at First Line checkbox The URL
7. Enable Dojo Support C Import Dojo brary sources into project this may take a few minutes In addition you can select to import the JavaScript library into your project The link to the external library will still be maintained so you do not have to add this Dojo library to your JavaScript Build Path this will speed up the JavaScript build process The Dojo library may take a couple of minutes to import If you are using Dojo for development purposes only we recommend that you do not import it into your project If you did not enable Dojo support for the project during its creation you can do so by adding the Dojo for Zend Framework library to the project s build path See the Adding Built in Libraries section of Setting the JavaScript Build Path topic for more information 471 Zend Studio 7 User Guide Using Dojo Integration Once Dojo libraries are included in your project s JavaScript Build Path Dojo code completion options will be available to files within that project The following Dojo elements will be available in the content assist list LC Dojo classes including namespaces Dojo object methods Dojo object properties Dojo global variables e g dojo Classes in dojo require r Example lt HTML gt lt script type text javascript gt dojo 3 lt scri 48 doc dojo bi lt HTML 48 doc dojo E 2 doc dojo e declaref className superclass props dojc e declaref className
8. Expressions Field Access Method invocabons F before binary operators Lal after binary operators O before unary operators kl after unary operators C before prefix operators Sort options by PHP element Preview far 4 3 h a Snumber c 4 fvalue true 46 false gt gt conditions rather than by element Edit Profile a inserted Select the required conditions by marking the relevant checkboxes qo indentation Braces White Space Blank Lines New Lines Line Wrapping Blank ines Before dass declarations Before constant declarations Before field declarations Before function method declarations At beginning of function method body Existing blank ines Number of empty ines to preserve class Example const CONST2 J var cthelInt 1 public function foo fa switch a case O Blank Lines Formatter Blank Lines tab Reference Expand each category by clicking on the sign to configure which items are applied to each Standing on an item will display a list of possible syntax conditions in which white spaces will be Choosing sort options by Syntax element from the drop down list will sort the list of by syntax Enter the number of blank lines between 0 32 to be created in the following conditions 565 Zend Studio 7 User Guide Before class declarations Before constant declarations Before field declarations Before
9. F5 Refreshes the Navigator views when external changes have been made Convert Selects the preferred line ending style Choices of Windows Line Unix and Mac styles Delimeters Ctrl P Prints the active file Switch Allows you to open an alternate workspace Workspace Using this feature will restart Zend Studio with an alternate workspace displayed in Navigator PHP Views This is useful if you want to open files and projects situated in a different location or if you want to save files and projects to a different location Imports various types of items into your workspace For a list of the different types of items you can import divided into categories see Import Exports and creates different types of items from your workspace into various locations For a list of the different items you can export from your 517 Zend Studio 7 User Guide workspace divided into categories see Export Displays a screen with information on the active file including it s path type location size and when it was last modified From here the text file encoding type can also be configured and whether the file is read only archive or derived can be set Last Lists the last viewed files for easy access viewed files Shuts down Zend Studio If there are unsaved changes in the file you will be prompted to save them before exiting 518 Reference New Submenu The New submenu is available under File New from the
10. Test File Name display_workersTest php f 3 lt Back el du Cancel 4 The relevant information will have already been entered if not click the link in the dialog to add the PHPUnit to the include path and this will populate the Element to Test list Note that a new file will be created called CalculatorTest php A warning will also appear stating that the PHPU nit is not the include class of your project 5 To add it to the include path click the underlined Click here link at the bottom of the dialog screen Once it has been clicked the link and the warning message will disappear 6 Click Finish to create your test case A CalculatorTest file will have been added to your project in PHP Explorer This will contain tests for your original calculator file Note that all functions add multiply divide and subtract in the original Calculator file will have a corresponding test function in the CalculatorTest file 93 Zend Studio 7 User Guide 538 sall 568 public function test eddi x e 658 ak E 68 public function test_divide 76 778 4T 808 public function test_multiply soe sall 928 public function test subtract 100 Test functions will have been created but parameters need to be entered in order for the test to run effectively For more on this see Running your Unit Test Case below 94 Getting Started Running your PHPUnit Test Case Having created your PHPUnit Te
11. 1 Ensure Zend Server is installed and running on the local machine 2 Open Zend Studio A popup ballon will appear in the bottom right corner of the window indicating that a Zend Server installation has been detected and configured 215 Zend Studio 7 User Guide Zend Server Found x Zend Server installation has been detected on your local machine and added s your defauk PHP server Chick here to learn more 3 Click the ZS icon to close the balloon or the click bere link to be taken to the Zend Server Integration help page To auto detect Zend Server after Zend Studio has been launched You can manually trigger a Zend Server auto detection through the Servers view by performing the following steps 1 Open 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 Click the Auto Detect Zend Server Ee icon on the toolbar If a Zend Server installation has been detected a New Zend Server Found dialog is displayed asking whether you want to configure it to be the default server New Zend Server Found A Zend Server installation has been detected on your local machine Do you want to be set as the default server Cre Iw 4 Click Yes to set it as the default server or No for the server to be configured by but not set as the default A Local Zend Server configuration is confiured and added to your PHP Serv
12. 397 Zend Studio 7 User Guide Changes to be performed L i E Move Resources Li RenFie2 pho Refactor Project AG Move resource Refactor Project RenFile php to Ref actor Project MyFokler RerFte2 P Rerle2 chp ZA Original Source Refactored Source require RenFilel php LJ cequire Renfileil php 4 a gr 4 You can scroll through the different changes using the scrolling arrows Av Note that if the file has been referenced required included etc in other files the reference to the location of that file in other files will also have been changed 5 Unmark the checkbox of changes which you do not want applied 6 If you are satisfied with the changes press OK The file will be moved and the file s new location will be updated in all instances where that file is referenced 398 Tasks Extracting Variables The extract variable feature can create a local variable to replace all occurrences of a given expression KN i ion y To create a new variable from an expression i 2 Place your cursor on the expression which you would like to replace with a variable Right click and select Refactor Extract Variable Or press Alt Shift L The Extract Local Variable dialog is launched 1 Extract Local Variable Variable name 23 F Replace al occurrences of the selected expression with references to the local variable ae Enter the name of the new variable in the Var
13. 4 Press Enter The command will be executed and details will be displayed in the Zend Tool Console view Wane Woden Xt 8 DG executing cf create project NewProject C Program Files Zend Apache2 htdocs gt zf create project NewProject Creating project at C Program Files Zend Apache2 htdocs NewProject ok took 0 03 922 See Zend Framework Preferences for information on customizing the output displayed in the Zend Tool Console 295 Zend Studio 7 User Guide Connecting to Databases Connecting to Databases The following tasks describe how to connect to and interact with a database using the Data Tools Platform Creating a Database Connection Profile Connecting to a Database Viewing and Editing Database Table Content Creating and Executing an SQL Query For more information on the Data Tools Platform please see the Data Tools Platform User Documentation Additional user guides can be accessed from inside Zend Studio by going to Help Help Contents or from the Eclipse Online Documentation site http help eclipse org ganymede index jsp 296 Tasks Creating a Database Connection Profile This procedure describes how to create a connection profile to your database allowing you to easily connect to it through the Database Development perspective The drivers for most of the database connection types are automatically included and configured in Zend Studio However some drivers require you to manual
14. 80 18 19 20 21 22 23 24 of your script in a browser in real time Note that this is different from the Browser Output window In the browser view enter your Name and Age and click Submit Query Sec Sen owas Wome aioli cS 7 E hitp flocathost form php no_remobe 1 amp debug_session_ide10128start_debugeladebu w D gt E Name Age Submit Query Another editor tab will open with the script from the welcome php file In the Debug view click Resume to resume the debugging process The browser output and browser views will display the final result of your application Welcome Name You are Age years old P Debug Output P Browser Output 7 Welcome Bob You are 55 years old The debugging process will have terminated Click on the PHP Perspective icon to return to normal editing mode To run the debugging process again click the arrow next to the debug icon KR on the toolbar and select your debugging configuration Getting Started Working with Refactoring The purpose of this tutorial is to teach you how to refactor your code to easily rename and move files and elements without damaging your projects or severing the link between referenced items as well as creating the necessary links between PHP elements in separate files Contents Purpose and Usage Renaming Moving Files Renaming Elements within a File Purpose and Usage The Refactoring feature allows you t
15. Debug Create manage and run confiqurations Run PHP Executable ZER Se _ EJ Ecipse Data Tools gt F PP Script E Demo amp PHE Unit PHPS C Program Files Zend Zend Neon Beta plugins org zend php debug Ka PHP Executables 5S PHP Web Page tS a tee Ke E e ee d Runon Server O PHP Web Server PHP File Demo Proyectiemo php em l W Breabpoint C Override project workspace Break at First Line setting gt See wR In order to minimize errors the PHP Executable used for debugging profiling should match the PHP version used for the project 113 Zend Studio 7 User Guide Content Assist The Content Assist feature enables the selection and insertion of existing code elements to complete partially entered code A list of possible code elements is displayed in relevant locations within your files according to the context of your cursor which you can then select to be automatically entered into your code Each type of code element will have a unique icon See PHP Icons for a description of each of the icons 4 Reserved PHP Words Functions S Templates Classes Interfaces o Constants o Variables public P PHP File Include Call D Namespaces PHP 5 3 Content Assist works with the following elements PHP Classes Functions Variables Constants Keywords Interfaces attributes values nested functions names syntax and include calls as well a
16. Import PHP User Libraries Edit PHP User Libraries Edit PHP Library Components or Folders Remove a PHP Library or Library Folder The PHP Libraries Preferences page is accessed from Window Preferences PHP PHP Libraries Kim gr E PHP Libraries Qe b JEJ General User libraries can be added to a DLTK Build path w Data Management fi raven Dynamic Languages EE amp Field Assist Help Install Update Sat d PHP Appearance Code Coverage Code Gallery Code Refactor wae Code Style amp Debug amp Editor New Project Layout PHP Executables gege Import PHP Libraries P PHP Manual DN Export kJa i E 358 Tasks Once you have added a user library in the PHP preferences page you must also add it to your PHP Include Path of the project in which you would like to have it available For more information see Configuring a Project s PHP Include Path 359 Zend Studio 7 User Guide Adding a PHP Library This procedure describes how to add a user library to Zend Studio Including user libraries in your project or environment saves you time in writing and debugging code as you are re using debugged code Ky To add an additional PHP Library to your project 1 Goto Window Preferences PHP PHP Libraries 2 Inthe PHP Libraries Preferences page click New The New User Library Dialog will open 3 Inthe New User Library dialog enter the name of your use
17. Interface location Select one of the following options e Create New File A new PHP file will be created in which the new interface will be insered e Add in existing file The interface will be created in an existing file Click Browse to select the file in which it will be created and select whether it will be created as the 1st PHP Block in the file or as a New PHP Block at the end of the file Interface Name Enter the name for the interface If you chose the Create New File option this will also be the name of the file 196 Tasks Extended Interfaces Click Add to select interfaces to extend implement Generate PHPDoc Blocks Mark this checkbox for PHPDoc Blocks to be automatically created for this item 3 Click Finish The new interface will be created with the required code won GA nf interface MyInterface 4 5 6 7 amp zl K 197 Zend Studio 7 User Guide Migrating From Zend Studio 5 X If you have previously used Zend Studio you can simply and easily migrate existing Studio 5 X projects and keymaps into Zend Studio 7 x Migrating Projects From Zend Studio Migrating Keymaps from Zend Studio Migrating Projects From Zend Studio 5 X This procedure describes how to quickly and easily import projects from Zend Studio 5 x into Zend Studio 7 x Any links to CVS and SVN repositories will also automatically be created and maintained Ka To import a project from Zend S
18. followed by Ctrl Space in the Editor to view the list of available Zend Framework elements lt php S Send Ad T Zend_Acl_Assert_Interface Zend_Acl_Exception C Zend_Acl_Resource O Zend_Acl_Resource_Interface Zend_Acl_Role T Zend_Acl_Role_Interface C Zend_Acl_Role_Registry C Zend_Acl_Role_Registry_Exception Zend_Auth uy Ja For more on Zend Framework visit the Zend Framework site at http framework zend com or the Zend Framework Reference Manual at http framework zend com manual en For more external resources see Useful Links 142 Concepts Database Connectivity Zend Studio s Data Tools Platform plugin allows you to connect to view edit and run queries on databases The Data Tools Platform provides connectivity with a number of databases Data Tools Platform functionality is accessed through the Database Development Perspective For more information on the Data Tools Platform please see the Data Tools Platform User Documentation Additional user guides can be accessed from inside Zend Studio by going to Help Help Conients or from the Eclipse Online Documentation site http help eclipse org ganymede index jsp For instructions on connecting to and accessing your database see Connecting to Databases 143 Zend Studio 7 User Guide Running Zend Studio allows you to run the applications you are working on from the workbench This allows you to run and test your
19. Ctrl Shift L Opens a list of all shortcut keys for Zend Studio functionality Tips and Opens the Tips and Tricks Help page for the Eclipse Platform Cheat Allows you to open a cheat sheet with quick explanations on a Allows you to enter your Zend Studio license key to enable Zend Studio functionality For more on purchasing a Zend Studio license see the Zend Studio site at http www zend com en products studio Note System i users can register for a free i5 Edition of Zend Studio See i5 Edition Extras for more information Zend Studio Support Redirects you to the Zend Online Support Center Opens the Tip of the Day window Searches for available software updates Installs available software updates Center Tip of the Check for Install New 543 Zend Studio 7 User Guide Description Connects you to the Zend Studio site at License http www zend com en products studio to learn more about purchasing a license and enabling Zend Studio functionality ene eer Protect your WW Directs you to the Zend Guard site at PHP Code http www zend com en products guard Zend Guard protects your applications from reverse engineering and unauthorized customization by providing encoding and obfuscation See Zend Guard Integration for more information Speed up Directs you to the Zend Server site at your PHP http www zend com en products server Zend Server is the only PHP Web application server that supports the enterpri
20. Override Implement Methods dialog will open displaying all methods that can be overridden 405 Zend Studio 7 User Guide 6 pix Child_1 Override implement Meth Select the elements which you would like to override or implement by marking the checkbox next to the element Select the insertion point from the drop down list Select whether to generate method comments or TODOs tasks by marking the relevant checkboxes Click OK The relevant code to implement override the selected methods will be created in your script 406 J4 class Child_1 extends ParentClass t 7 see ParentClass funl Static function funi see Pa rentCiass fun LD ok protected function fun5S 3 Ate tf She Se Se d eS Ww Le D A o InN Ow e This amp 3tiil empcy class gsi j Tasks Creating a PHPDoc This procedure describes how to create a PHPDoc from your PHP files w To create a PHPDoc 1 Right click the project from which you would like the PHPDoc to be generated and select Generate PHP Doc or go to Project Generate PHPDoc or press Alt D The PHPDoc Generation dialog will open Generate PHPDoc PHPDoc Generation Configure PHPDoc arguments Load the settings of this PHPDoc Location PHPDoc command C Program Files Zend Zend Neon BetaRCS plugins com zend Select resources for which PHPDoc will be generated DE Debug2 CIS NewProject MEE Profile Proj
21. The Mark Occurrences Preferences page is accessed from Window Preferences PHP Editor Mark Occurrences Mark Occurrences CH The appearance can be configured in the Annotations preference page F Mark occurences of the selected element in the current file M Types Z Class methods and declarations V Furxtions F Constants F Gobal variables Local variables Method exits V Methods implementing an interface F Targets of break and continue statements V Keep marks when the selection changes Ca Ca K i w To configure Mark Occurrences preferences 1 Mark the Mark occurrences of the selected element in the current file checkbox to enable the Mark Occurrences functionality 2 Configure the elements for which the Mark Occurrences feature will be enabled by marking the relevant checkboxes The options are 584 Types Class Methods and declarations Functions Constants Global variables Local variables Expressions throwing a declared exception Method exits Marks the exit points throws return end of flow of a method Methods implementing an interface Reference Targets of break and continue statements Marks the scope for foreach while do while or switch structure of a break continue statements HTML Tags 3 Mark the Keep marks when the selection changes checkbox for marks to continue to be displayed once the cursor has been moved from the select
22. debug_session_id string 4 1001 F send_sess_end string 1 dedug_host string 9 127 0 0 1 pY GET Array 7 D H rt POST Array TO Array 7 Expressions View Toolbar Commands Fa x Show Type Displays type names Names st Show Logical Displays the logical structure Structure D Collapse All Collapses the list 499 Zend Studio 7 User Guide Expressions View Menu Commands The view s menu can be accessed through the view menu icon Layout gt Vertical View Onentation 1i Horortal View Orientation Expressions View Only Defines the view s layout Vertical View Orientation The details pane will be displayed at the bottom of the Variables view Horizontal View Orientation The details pane will be displayed to the right of the Variables view Expressions View Only Only the Watched Variables pane will be displayed 500 Reference PHP Profile Perspective The PHP Profile Perspective can be launched automatically when a Profile session is run It allows you to view all the information relevant to your scripts 30 T Pret Irtoematon z TD Eason Statics D Paing Tha Now 22 10 45 46 151 20 Pan C Documents and Semer men eseu maer Total Bee Tee jeet 5908 Number of Files 2 D e Thu Now 22 1045 19ST 2007 TryPerton php 21 16 ms 722 fil Person php 814ms 276 The PHP Profile Perspective contains the following views Profiling Monitor Profil
23. where the debugging process will pause These procedures demonstrate how to set line and conditional PHP breakpoints J To set a breakpoint in your script Double click the vertical ruler to the left of the line where you want to set the breakpoint or select the line and go to Run Toggle Breakpoint or press Ctrl Shift B A blue ball will appear indicating that a breakpoint has been set J 316 To add a condition to a breakpoint 1 Right click the breakpoint in the vertical marker bar and select Breakpoint Properties at mm enn mowinwen the eet wakpa in Disable Breakpoints s j Run As gt Debug As b Profile As b Vakdote Team D Compare With gt Replace With r Add Bookmark Add Task The PHP Conditional Breakpoint dialog opens 2 Enter the required condition and ensure the Enable Set Condition checkbox is marked Tasks 1 Properties for 3 Click OK The condition will be set for the breakpoint and the debugging process will pause only if the condition is met The breakpoint will be represented by a blue ball with a question mark display workers echo undefined variable 317 Zend Studio 7 User Guide Debugging a PHP Script Files located in your workspace can be debugged in two ways Local Debugging Using Zend Studio s internal debugger Remote Debugging Using your remote server s debugger 318 Tasks Locally Debugging a PHP Script
24. 1 In PHP Explorer view right click the required project and select Include Path Configure Include Path Or right click the project and select Properties Include Path The project s PHP Include Path properties page will appear PHP Include Path e Source ES Projects S Libraries Order Source folders on include path w abc Add Folder remove From this page you can configure the following To configure source folders on your Include Path i Select the Source tab By default all folders which are on your Include Path will be added to your Build Path If your project root is on your Include Path all folders and resources contained within your project will also be on the Include Path To add only certain folders remove the project root from the Include Path and add only the required folders ii To remove a folder select it and click Remove iii To add a folder from your project click the Add Folder button and select the required folder A prompt will display asking whether you would also like to add the selected folder s to your Build Path It is recommended that the resources on your Build Path match the resources on your Include Path 369 Zend Studio 7 User Guide Click Yes to add the folder s to your Build Path or No for your Build Path to not be affected To add another project from your workspace to your Include Path i Select the Projects tab ii Click Add The Requir
25. 2 Find the location of your Zend Guard installation and click Open 3 Click OK to apply your settings The connection will be made between Zend Studio and Zend Guard Zend Guard s functionality can now be accessed from Zend Studio by clicking the Encode Project icon RH the main toolbar or going to Project menu and selecting Encode Project See the Zend Guard Integration topic for more information For more information on Zend Guard and to download a trial version please visit http Awww zend com en products guard 617 Zend Studio 7 User Guide PHP Project Properties PHP Project Properties A project s properties pages allows you to configure various settings for a specific project Project s properties can be accessed by right clicking the required project and selecting Properties or selecting the project and from the menu bar going to Project Properties The properties available will depend on the resource selected The following properties are available for PHP projects Resource Properties Builders Properties Code Style Properties Code Templates Properties Formatter Properties PHP Build Path Properties PHP Debug Properties PHP Include Path Properties PHP Interpreter Properties PHP Task Tags Properties Project References Properties Run Debug Settings Properties Save Actions Properties Semantic Analysis Task Repository For more information see the Mylyn User Guide Commit Template Ta
26. 3 Click OK to save your settings Additional Configuration Options Additional configuration options can be accessed through the Zend Studio Toolbar Settings dialog Extra Stuff Settings as follows General Enable Search Toolbar Displays the PHP information search box in the Zend Browser Toolbar Debug Session Settings Detect Zend Debugger only available in the Zend Internet Explorer Toolbar disables the Debug and Profile buttons when a Zend Debugger is not detected on the server Debug Local Copy Choose whether the source files used during the debug session will be taken from the server or from a local workspace copy of the files in Zend Studio if available If a local copy is not available files will be taken from the server Enabling this option will result in the Path Mapping mechanism being applied when files are called See Path Mapping for more details Break on the first line this will cause the debugger to pause at the first line of PHP code during debugging Zend Studio Settings Zend Studio Executable Browse to the location of your Zend Studio executable file This will enable you to launch Zend Studio by clicking the Zend Studio button je Zend in the toolbar 333 Zend Studio 7 User Guide Running and Analyzing Debugger Results Once you have launched one of the debug sessions PHP Script PHP Web Page or URL you can control and monitor the debugging process using the views displ
27. 8 items s 8 8 K EL 1 Description Resource Path Locat Type Al TODO Auto generated constructor display_wor ExampleProject line35 PHP Tasl o TODO Auto generated constructor row_colorTe ExampleProject line 35 PHP Task 1 Oo TODO Auto generated display_workersTest display_wor ExarmpleProject line 42 PHP Tast CH TODO Auto generated display_workersTest set display_wor ExampleProject line 18 PHP Tash Ea rr gd Eh s D T The PHP Debug Perspective contains the following views Debug View Here you can control stop pause and resume the debugging process You can also decide whether to step into step over or step return step out of certain functions Variables View Displays the various variables in your script Breakpoints View Displays the breakpoints you have entered Parameter Stack View Displays the parameters through which functions are reached Debug Output View Displays the textual output of the script This will be updated as the debugging process continues Browser Output View Displays the output of the script to a browser This will be updated as the debugging process continues Expressions View Displays the progress of selected variables The view will only be displayed if you have selected to watch a variable Editor Displays the code at the relevant sections according to which line is selected in the Debug View window Console View External Link Displ
28. Ba Step Return from a method which has been stepped into The remainder of ram Jensen Enables disables the step filters functionality Filters The Debug View PHP Debug Perspective is displayed by default as part of the Debug Perspective To manually open the view go to Window Show View Other Debug Debug 493 Zend Studio 7 User Guide Variables View PHP Debug Perspective The Variables view displays information about the variables associated with the stack frame selected in the Debug View Selecting a variable will display details in the detail pane below the view Expanding the list under a variable will display its fields gt SHTTP_GET VARS gt COOKIE s SHTTP_COOKIE_VARS SEAVER Astay 44 APPDATA shing 50 C Decuments and Sett CLASSPATH sting 54 ZC Progeam Files av a Comenebtuooasm de string 29 C Program Files Come LU Right click a variable and select Watch or Create Watch Expression to add the variable to the Expressions view Variables View Toolbar Commands er werte x Show Type If selected type names will be displayed Names st Show Logical Shows the logical structure Structure Collapse All Collapses the list 494 Reference Variables View Menu Commands i 7 v7 The view s menu can be accessed through the view menu icon xj RES Vestal iow Oortation Horizontal View Orientation Variables View Dri w Show Columns Select Columns
29. Enter Password System type FTP Only Hostname 10 1 2 241 User ID MyUSerlD Password ow F Save user ID E Save password Le Ice Double click a PHP file to open it in a Zend Studio PHP editor Most of Zend Studio s functionality such as Content Assist Formatting Outline Models and Getter and Setter Generation will be available to the file 5 Edit the file as required 6 Click Save The edits will be saved on the FTP version of the file 267 Zend Studio 7 User Guide Viewing and Editing Remote Server Files in your Workspace Folders situated on FTP SSH servers can be saved onto your Workspace while maintaining the link with the FTP SSH server Any changes made in the files and folders located on either the FTP SSH servers or the Workspace will be updated in both of the file locations This procedure describes how to simultaneously edit files and folders on your FTP server and your Workspace w To save view and edit files in your Workspace which are located on an FTP SSH server 1 In PHP Explorer view right click and select New Remote Folder or go to File on the Menu Bar and select New Remote Folder 2 The New Remote Folder creation wizard will open 1 New Remote Folder Remote Folder Lik target location is invalid Enter or select the parent folder MyProject gt 3 Select the project in which you want to place your FTP SSH folder 4 Inthe Remote folder selection cli
30. In order to start coding you should create a PHP project which will contain the files for your application Create PHP Files You can now start to develop your application by creating PHP Files in your project w 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 New PHP File New PHP file Create a new PHP file Source Folder MyProject WE File Name newFile php De 3 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 28 Getting Started Create PHP Elements You can use Zend Studio s PHP element creation wizards to quickly and easily create PHP elements such as classes and interfaces within your code ws 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 WER E e rora T Zend Framework Project TE Project E PHUN Test Case D PHPUnK Test Sute Je PHP Fie Folder 3 Fle Sess CG HTML Page at aa F Untied Text File Zend Framework Item O cass Interface i Remote Folder VY JavaScript File M Example T Other Ch The New PHP Class Interface wizard i
31. Private methods are not inherited and cannot be overridden Override Indicators Preferences The display preferences for the override indicators can be configured from the Annotations preferences page Window Preferences General Editors Text Editors Annotations Select the Override Indicators org eclipse php ui overridelndicator option to configure the Override Indicators for PHP 131 Zend Studio 7 User Guide PHP Working Sets PHP Working Sets are groups of PHP resources which allow you to view or apply actions to a group of pre defined elements Workings Sets group elements under one title so that they can be easily selected when viewing resources or carrying out actions Elements included in a PHP Working Set can include any PHP project folder or file Example for using Working Sets Selecting the Select Working Set option in the PHP Explorer view s context menu allows you to choose specific Working Sets i e group s of projects files to be displayed in the view Select Working Set Select a working set O Window Working Sets O No Working Sets Selected Working Sets ai Ef Zend Applications E 9 Projects files not in the selected Working Set will not be displayed in the view If you have not created PHP Working Sets see Creating PHP Working Sets for more information 132 Concepts Type Hierarchy The Type Hierarchy views display the hierarchy for a given type a class na
32. RenFile1 and RenFile2 as described in steps 1 to 3 under Renaming a File above In the editor window of RenFile2 highlight the variable a on line 3 Right click and select Refactor Rename or click Alt Shift R In the Rename Global Variable dialog box rename the variable to b Check the Update textual occurrences box and click Preview In the Preview window scroll through the changes and note that occurrences of variable a will be changed in RenFile1 as well as in RenFile2 Press OK to apply changes 83 Zend Studio 7 User Guide Working with the Profiler The purpose of this tutorial is to teach you how to profile files and applications in order to gain maximal efficiency in the execution of your script Contents Purpose and Usage Profiling PHP Scripts Profiling PHP Web Pages Purpose and Usage Zend Profiler detects bottlenecks in scripts by locating problematic sections of code These are scripts that consume excessive loading time The Profiler provides you with detailed reports that are essential to optimizing the overall performance of your application Zend Studio includes five types of profiling Locally Profiling PHP Scripts Profiling PHP files using Zend Studio s internal PHP Executable debugger Remotely Profiling PHP Scripts Profiling PHP files using your server s debugger Profiling PHP Web Pages Profiling files applications and projects on your server using the local or server copies of
33. Select these in PHP Explorer view before opening the Search dialog All sub files and sub folders within the selected resource will be included in the search Enclosing projects The projects which the selected resources are in Working Set Click Choose to select the required Working Set 7 Click Search The search view will open displaying the results of the search To go to an element double click the required option from the search view X DR A Search 2 ap W s EIEN es S Pe eh row_color 1 occurrence in workspace E Le DebugProject E P Debug php row_colorfi E 230 Tasks By default the File Search Remote Search Task Search and JavaScript Search dialogs will be tabbed with the PHP Search dialog To make these unavailable click Customize within the PHP Search dialog and unmark required options Hotkeys The following hotkeys are available Shortcut Closes the Search dialog Brings the cursor to the Search string field Checks unchecks the Case Sensitive checkbox Checks Type in the Search For box Checks Method in the Search For box Checks Field in the Search For field Checks Declerations in the Limit To field Checks References in the Limit To field Checks All occurrences in the Limit To field Alt Y Checks unchecks the Search the Interpreter system libraries Selects Workspace in the Scope field Selects Selected resour
34. Shows variables which are in other files in the project Filters Respect case sensitivity Define statements are used to create global constants One can r define r MY_CONST 5 and then use r MY_CONST all over the application this property is used to determine if r my_const will also be suggested as usage of that constant Show strict options PHP alerts users if they access static methods and fields from within an instance Users can enable disable this in the php ini file for their php copy and hence can disable the content assist for these cases Auto activation Enable auto activation The content assist list will automatically be displayed If this is unmarked you can still display the content assist list by pressing Ctrl Space Auto activation delay Determines the delay before the Content Assist box is automatically displayed in msecs 2 Click Apply to apply your settings 580 Reference Code Folding Preferences Code Folding enables you to collapse or hide certain sections of code while you are not working on them This enables you to manage larger amounts of code within one window The Code Folding preferences page allows you enable disable code folding and to select which elements should be folded by default The Code Folding Preferences page is accessed from Window Preferences PHP Editor Code Folding Code Folding Enable folding Initially Fold the
35. Tasks x x D RBE AE riaa onvert2 php line 51 Division by zero The code can now be easily fixed in this case by replacing the 5 0 operation with 5 9 109 Concepts Update Manager PHP Version Support Content Assist Syntax Coloring hpDoc Block PHP Manual Integration Real Time Error Detection Code Analyzer and Semantic Analysis Zend Framework Development Database Connectivity Running JavaScript Support PHPDocs Code Galleries Zend Guard Integration RSS Feeds WSDL Web Services Desch Zend Studio for IBM i Extras Phar Integration tion Language 110 Concepts Update Manager Zend Studio s Update Manager allows for the easy installation of extra plug ins the updating of existing features and the easy updating of Zend Studio with the latest offerings from Zend See the Workbench User Guide for more on installing and updating features with the Update Manager Additional user guides can be accessed from inside Zend Studio by going to Help Help Contents or from the Eclipse Online Documentation site http help eclipse org ganymede index jsp 111 Zend Studio 7 User Guide PHP Version Support Zend Studio supports PHP versions 4 5 1 5 2 and 5 3 PHP version settings affect The elements displayed in the PHP Functions view The options available in Content Assist Debugging and Profiling functionality PHP version settings can be configured from
36. Zend Studio 7 User Guide PHP Perspective Menus Zend Studio s menu bars and toolbars offer a range of useful and easily accessible functionality The options available through the menu and toolbars will vary depending on which perspective is currently active To configure the menu options for the active perspective go to Window menu and select Customize Perspective The PHP Perspective will by default display the following menu options Menu Description Option File Carries out various functions on active files and folders as well as organizing current files and creating new items The File menu options are New Open File Close Close All Save Save As Save All Revert Move Rename Refresh Convert Line Delimeters To Print Switch Workspace Import Export Properties Last Viewed Files and Exit Edit Normal text editing functionality as well as features such as tasks and bookmarks which are specifically related to editing code The Edit menu options are Undo Text Change Redo Text Change Cut Copy Paste Delete Select All Find Replace Find Next Find Previous Incremental Find Next Incremental Find Previous Add Bookmark Add Task Show Tooltip Description Word Completion Quick Fix and Set Encoding Source Organizes your scripts by adding or removing comments and formatting the script to make it more easily viewable The Source menu options are Toggle Comment Add Block Comment Remove Block Comment Forma
37. changes have since been made y This procedure demonstrates how to replace your file with an older version die In the PHP Explorer view select your SVNFile1 and from the right click menu select Replace with Revision A Replace with Revision dialog will open Select Revision and click Select A Select Revision dialog will open listing the various times the file has been committed revisions As committed changes have been made twice once during the original upload and once when you edited the file 2 revisions should be listed with their relevant comments Select Revision Select any of existing revisions You can choose any of represented revisions for the resource Please note that there is a possibilty to fiter messages by the author and the comment vm 10 1 3 19 project trunkySVN Project SYNFile1 php Changes ay 2007 17 43 17 I am uplosding Mes to SVN Un Bot Name Path projectitrunkiSV N gt syNFiel pho project trunk S N Project 4 Scroll between the two revisions To return the file to its previous state select the second revision in the list containing the comment I am uploading files to SVN This is the original state the file was in when it was first uploaded 5 Click OK 68 Getting Started 6 You will be returned to the Replace with Revision dialog which will now have a revision number in the Revision box Click OK You will be prompted to confirm that you w
38. instructions under To define Subversion connectivity above Right click the required file project in the Project tab or open the file in an editor and right click From the right click menu select Subversion and the required action Create an SVN repository configuration by following the steps under To define Subversion connectivity above Right click the required file project in PHP Explorer or open the file in an editor and right click From the right click menu select Team and the required action See the Making Changes Comparing Changes and Committing Changes section of the Working with SVN Tutorial for more information See Working in a Team Environment with CVS in the Workbench User Guide for more information Additional user guides can be accessed from inside Zend Studio by going to Help Help Contents or from the Eclipse Online Documentation site http help eclipse org ganymede index jsp 41 Zend Studio 7 User Guide To define CVS connectivity Zend Studio 5 x Zend Studio 7 x Open the Preferences window by From the Menu Bar open the CVS selecting Tools Preferences from the perspective by selecting Window Menu Bar Open Perspective Other CVS Select the Source Control tab Repository Exploring from the Menu Select CVS in the Source Control drop Bar down list Click the Add CVS Repository button This will cause all source control LS on the views toolbar
39. le Esiin nean 246 Concurrent Versions System 42 125 Conditional Breakpoints 00seeseeeee 141 Configure Include Paths 379 Connecting to a Database 306 Connection Profile 304 Content Assist Jovacrpt 467 Controller icsticdecasvevidcsatecdedaaidiaeaasva 127 276 COOK E nieni aaa 222 353 Covered Lines 70 Current Working Directory 0 143 CVS EEN 42 125 249 250 CVS connection s 249 252 256 647 Zend Studio 7 User Guide CVS Perspective eeeeceeeeeeeeesteeeeseeeeees 250 CVS Repository 42 250 252 256 CVS Repository Exploring 00 250 CVS Repository Exploring Perspective 125 252 D data execution 0 2 eeeteeeeeneeeeeenteeeeeenaes 202 Data Source Explorer 306 Data Source Explorer view sses 301 Data Tools Plattform 129 304 database a A EER 129 Database Development Perspective 129 301 306 312 debug Javatecrigt eneen 467 Debug JavaScript esseseeseeeeeereeneen 467 Debug preferences s e 593 Debug Settings ccceeeececseeeeteeeeeeees 643 Debug view AANEREN 512 debuggai s crru 132 Debugger Toolber 148 Debugging sssseessrresrrrreerrrrnsns 57 132 512 Debugging PHP Gcripte 57 Debugging PHP Web Page s es 57 Debugging URLS rns 57 develop JavaScript ccceeeeeeseeeeereees 467 Develop with JavaScript eseeeeseeeeeee 467 DOCBIOCK 02 03 ai n 244 Alle E 467 490 Dojo Integration 0 eee
40. or right click preferences and menu options to enable within the CVS view and select New CVS rather than Subversion operations Repository Location The Add CVS Repository dialog will open Configure any required CVS settings Click Apply and OK Enter the information required to identify and connect to the repository location 4 Click Finish to create your connection The connection details will be saved and can be easily selected when performing CVS actions on your projects and files See Configuring a CVS Connection for more information Checking out a Module from CVS Set CVS to be your Source Control Goto File Menu and select Import default by following the instructions Projects from CVS and click Next under To define CVS connectivity Select your repository and click Next above A Select Resource dialog will appear From the Menu Bar go to Tools CVS Select your project if necessary Checkout expand the nodes until you see it and Enter the details in the Checkout dialog click Finish Click OK A Check Out As dialog will appear Click Finish See Importing Projects from CVS for more information 42 Getting Started To perform CVS commands e g update commit on a CVS module Zend Studio 5 x Zend Studio 7 x Set CVS to be your Source Control Right click the required file project in default by following the instructions PHP Explorer View or open the file in u
41. or the Zend Guard Online Documentation http files zend com help Zend Guard zend guard htm for more information on Zend Guard Zend Studio s integration with Zend Guard allows you to apply Zend Guard s encoding functionality to projects and applications created and stored in Zend Studio by allowing you to open them in Zend Guard Conversely files stored in Zend Guard can be opened and edited in Zend Studio E Guard Ershorer fess Example Propet lt Q C Decuments and Setingsperen sil General Information Links Product Maree Exangle_Prodat_i Loes project AD tovrce Lt paracreters te froe Verson L Output Location Ciocuserts and Settings leren sity Documerts Or afts Gaard Contigue orty settings Condigure obfuscation t s Let Configure PEP encoded files honders hereto F Code Ceteezgser fa View these settings CA hormat ler Opumicer 9 e 3 3 5 Ce Conguttdty end Optemzer 3 3 0 and above Ero Haring Leg Eros Verbouty Levei verbose Source Options fe Use gobs source options Overman Seourty Exclude Unt Header Information XML Editor 175 Zend Studio 7 User Guide RSS Feeds RSS is a format for syndicating news feeds from news sites and weblogs Zend Studio has a built in RSS reader allowing you to view news and updates from the Zend Developer Zone to view the latest mentions of Zend in the press or to view any other RSS feed channel RSS feeds are displayed as a list in the RSS view and
42. php is entered To configure your automatic close options 1 Mark the checkboxes of the patterns you would like Zend Studio to auto complete 2 Click Apply to apply your settings To use the auto complete function type the opening character in the editor The matching character will be automatically inserted 594 Reference Tabulators w To be able to indent a selected line in the editor using the Tab Key 1 Mark the tab key indents the current line checkbox 2 Click Apply to apply your settings For more on indentation preferences see the Formatter Preferences page 595 Zend Studio 7 User Guide Zend Framework Preferences The Zend Framework preferences page allows you to configure the display of the Zend Tool Console The Zend Tool console displays messages and warnings when executing Zend Framework commands which utilize the Zend_Tool such as create new Zend Framework Project or create new Zend Controller See Using the Zend Tool Floating Window for more information de Zend Framework Zend Tool Console Settings C Fixed wkith console Z Limit console output Console buffer sire characters 500000 7 Automatically show Zend Tool console when a Zend Tool command is executed Console text color settings Command Une ec S Zend Tool Floating Window Settings V Provide code assist in Zend Tool Floating Window Ce OK Cancel The Zend Framework Preferences Pre
43. phpDocu _ Example phpDoc Description Class trees Welcome to phpDocu Index of elements ee end e This documentation was generated by phpDocumentor v1 9 2 Person display_workers row_color Piles alculator php Debug php Debug php PHPDocs list all classes functions files and other elements in an easily browsable format so that scripts can be easily navigated and understood PHPDocs also incorporate PHPDoc Block comments to provide descriptions and parameters for your code elements a hpDocu Class Calculator Description ee Description Index of slements Classes ri Methods details Caimuator Person Functions ert Snes This class contains functions for adding multiplying dividing and row_color ge subtracting Calculator php Debuug php Located in Calculator php line 5 Debugs php 173 Zend Studio 7 User Guide Code Galleries Code snippets can be used to easily insert pre defined sections of code into your script Code Galleries are pre defined code snippets sites Connecting to a Code Gallery will give you access to a selection of code snippets The Code Gallery view allows access to the Code Gallery sites and code snippets contained within them so that the code snippets can be easily inserted into your script iS Problems 7 Tasks GI console E Code Galery ii x a F 2 im type filter text Details checkdigit modulo 10 E User Code Gallery A Author Zend Code Gal
44. right click your file and select Team Commit 2 A Commit dialog will open Enter the comment I have made changes to CVSFile1 and click Finish 3 Your changes will now be committed to CVS and all users will be able to access the newly updated file If you had made changes to a number of files you can use the Synchronize view within the Team Synchronizing Perspective to view and commit all your changes at once Replacing Files with Older Versions Using CVS s version control system users can revert back to older versions of files if incorrect or irrelevant changes have since been made w This procedure demonstrates how to replace your file with an older version from CVS 1 In PHP Explorer view right click your CVSFile1 and select Replace with History 2 A History view will be displayed listing the times that the file has been committed The changes made on CVS as opposed to local workspace changes will be shown with a repository icon G As committed changes have been made twice once during the original upload and once when you edited the file 2 CVS revisions should be listed with their relevant comments Problems Tasks Console Debug Output Browser Output Ste Explorer ETE fe elama EE a Tel ge Revision Tags Revision Time Author Comment EH Today O 1 2 20 05 2007 15 02 keren s Thave made changes to CVSFile1 5 20 05 2007 14 48 CG 20 05 2007 14 25 D 11 20 05 2007 14 25 keren s I om uploading f
45. wi To import resources 1 Select the resource s in the Synchronize View 2 Right click on the resource and from the right click menu select Import The resource s will appear in your workspace You can also import resources via PHP Explorer 1 Select the resource s in PHP Explorer 2 Right click on the resource and from the right click menu select Import The resource s will appear in your workspace 439 Zend Studio 7 User Guide Downloading Selected Files from a Folder This procedure describes how you can import a partial project ignoring any files that you don t need and keeping them hidden on your workspace For example if you were importing a folder that contained image files that you didn t need you could import all of the files except the image files w To import selected files 1 Right click on the new resource in PHP Explorer and from the right click menu select Team 2 Click on Addto sharedignored to open up a dialog box 3 Select the files that do not need to be synchronized 4 Click Finish The ignored files will be hidden in a folder on your workspace 440 Tasks Uploading Resources to Your Server This procedure describes how to upload resources to a remote server This allows you to share your project to your remote server and all those who have access to it Sharing your project allows you to edit and manage your project between different users and locations For more information
46. 3 Select a folder in the External folder Selection dialog or create a new folder by clicking Make New Folder 4 To apply changes click OK The folder will be added to the PHP library The folders that are included in the user defined libraries allow you to control their access rules The access rule default setting is No restrictions See Defining Access Rules below for more information 361 Zend Studio 7 User Guide Defining Access Rules This procedure describes how to define access rules Access rules allow you to control where your libraries will be available From here you can control what code completion options will be available in features such as Content Assist on a project level In order to define access rules you must have an external PHP folder added to your project For more information Adding External Folders to PHP Libraries S To define an access rule for your user defined library 1 Go to Window Preferences PHP PHP Libraries 2 Inthe PHP Libraries Preferences page double click Access rules located in the hierarchal tree below your added folder The default setting is No restrictions The Type Access Rules dialog will open 3 Click Add The Add Access Rule dialog will open Add Access Rule Enter a pattern For the rule Resolution Forbidden Rule Pattern Allowed wildcards are and Pattern segments are separated by P ei matches any number of segments Ex
47. All Temporarily removes all breakpoints from your script so Breakpoints that the debugging process will not stop at them Select this option again to return all breakpoints to the script Remove All Removes all breakpoints from the current active file mome T Run History Displays and allows access to a list of previously o ee Ruinas fs Lets you choose from running on the server as a PHP 538 Reference Description ll Script or as a PHP WebPage ae Run Launches the Run dialog to create edit Run oe a Debug History Displays a list of Debug configurations so that they can Debug As Lets you choose from debugging on the server as a PHP Script or as a PHP WebPage For more on these options see Debugging Debug Launches the Debug dialog to create edit debugging a Configurations Run Ctrl F 11 Launches the last Run configuration run Launches the last Debug session run Profile History Launches the last Profile session run Displays a list of Profile configurations so that they can be used for profiling Lets you choose from profiling on the server as a PHP Script or as a PHP WebPage Profile As For more on these options see Profiling Profile Launches the Profile dialog to create edit Profiling Configurations configurations La External Tools i If applicable allows you to run the file using External tools Open External Tools Dialog Opens the configuration dialog for
48. Before committing changes you have made to a file you can compare the file stored locally in your workspace to the file stored on the CVS repository Making and Comparing Changes w This procedure demonstrates how to make changes to files and compare the newly edited local files to files in the repository 1 Open CVSFile1 in your MyCVS Project 2 After the text This is a new file add I have made a change 3 Save the file In PHP Explorer view the file and project will have a gt suffix indicating that a change has been made which has not yet been committed 4 So far the changes have only been saved in your workspace In order to compare the local file to which you have made changes with the one sitting in the CVS repository right click the file in the PHP Explorer view and select Team Synchronize with Repository 5 A Text Compare dialog will open showing the local file you have just made changes to in the left hand window as compared to the file in the repository in the right hand window The change you have made will be highlighted E Text Compare Se eS a Jk ag Local File EF Remote File 106 gadi lt php l This is a new file lz KE 60 Getting Started Committing Changes Once you have edited your file and compared it to the one in the repository to ensure that the changes are correct you can commit your changes S To commit your changes to the repository 1 In PHP Explorer View
49. Builders JavaScript Libraries Code Style i JavaScript amp Code Style amp JavaScript Editor JSDoc Location E S ECMAScript Built In Library BA Web Project support for JSDT My ECMA 3 Browser Support Library E BBA jQuery Library E E Prototype Library Add JavaScript Library Add a Library Folder Fait Libraries Validation PHP Build Path PHP Debug PHP Include Path PHP Interpreter PHP Task Tags Project References Run Debug Settings Ei Save Actions DI Semantic Anahesis e To add a built in library to the JavaScript Build Path 1 Click Add a Runtime Library The Add Library dialog will appear 2 Select the required library and click Next and Finish 453 Zend Studio 7 User Guide To add a User Library to the JavaScript Build Path 1 Click Add a Runtime Library The Add Library dialog will appear 2 Select User Library and click Next A list of previously configured User Libraries will appear 1 Add Library User Library Select a library to add to the dasspath Selected User Ubrary C mi ase 3 If you have not yet configured your User Libraries i Click the User Libraries button to be taken to the JavaScript User Libraries preferences page also accessible from Window Preferences JavaScript Include Path User Libraries ii Click New The New User Library dialog will open IL Enter a name for the library you woul
50. Class Constants Constants defined Class Interface HTML Tags 124 Concepts Code Folding Code Folding collapses or folds the display of a block of code The editor will then display only the first line of code instead of the entire block This reduces visual clutter by enabling users to selectively hide and display complicated text while still viewing those subsections of the text that are relevant Cold Folding is applied by default for functions and PHPDocBlocks You can configure which of these are folded by default through the Folding preferences dialog 1 lt php 22 class Calculator 29 public function add a b 0O public function multiply a b O return a b 118 public function divide a b O 188 public function subtract Ga b O0 Folded code has a plus sign on the vertical marker bar to the left of the Editor Clicking this sign will expand the block of code Opened unfolded code has a minus sign on the vertical marker bar to the left of the Editor Clicking this sign will fold the block of code See the Using Code Folding topic for more information 125 Zend Studio 7 User Guide Code Commenting Commenting your code involves adding characters normally slashes and stars which mark certain areas of code as comments Comments are used for reference information only and will not be run as part of your code It is good programming practice to comment all function
51. Class Name display_workersTest Test File Name display_workersTest php GI lt Back lent meh Cancel A SuperClass is a class from which the new PHPUnit Test Case will inherit functionality e g setup and constructors If necessary click Browse next to the SuperClass field to select a different PHPUnit Framework SuperClass Click Browse next to the Element to test field to select the Class or Function which will be tested in the new PHPUnit Test Case If this is the first PHPUnit Test created for the project a warning will appear stating that the PHPUnit is not on the include path of your project Tasks To add it to the include path click the underlined Click here link at the bottom of the dialog screen This will enable PHPUnit Content Assist options in the PHPUnit Test Once it has been clicked the link and the warning message will disappear Click Finish to create your test case The new test file containing tests for the selected elements will be added to your project Note that all relevant functions in the original class will have a corresponding test function in the test file However test functions will have been created with no parameters 7 Before you can run your test file you must create relevant tests and parameters for each of your functions depending on the results you expect to see when the function is run For each function write a test with demo input parameters and the expected result Wh
52. Content Assist preferences page allows you to configure your Content Assist preferences The Content Assist Preferences Preferences page is accessed from Window Preferences PHP Editor Content Assist Preferences Preferences Code Assist E General 4 Data Management E Dynamic Languages 4 Field Assist Help Install Update PHP Appearance Code Analyzer Code Coverage Code Gallery Code Refactor E Code Style Debug Editor Code Folding Hovers Mark Occurrences Save Actions Syntax Coloring Task Tags Templates Typing Zend Framework New Project Layout I gt v Options Completion Inserts O Completion Overwrites Insert single proposals automatically L Show variables from other files Filters TT Respect case sensitivity C Show strict options O Group completion options Auto Activation Enable auto activation Auto activation delay in msecs 200 d Restore Defaults Apply 579 Zend Studio 7 User Guide S To configure Content Assist preferences 1 Mark the required checkboxes to configure the following options Options Completion Inserts Completion Overwrites Select whether selecting an item from the Content Assist list will cause new code to be entered or existing code to be overwritten Insert single proposals automatically When only one content assist suggestion exists the content assist suggestion will be inserted automatically Show variables from other files
53. D Gei Hh Servers Otem Desorption Rewsce Poth tct Type The PHP Perspective contains the following views PHP Explorer View Outline View Type Hierarchy View Problems View External Link Tasks View External Link Console View External Link Servers View 476 Reference PHP Explorer View The PHP Explorer view is an internal file system browser allowing you to view all PHP projects and files in your Workspace It shows the PHP element hierarchy of PHP projects in the Workbench and provides you with a PHP specific view of your available resources Within each project source folders and referenced libraries are shown in the tree In addition this view shows all PHP code elements classes functions variables etc Clicking an element or declaration will cause the corresponding code to be displayed in the PHP editor See PHP Icons for a description of the icons displayed in the PHP Explorer view i sean fom a CDI SES d e Le BIRT vc Debug g le Ch WE BA Include Pathe 7 A MyProgect E aphp A bie ah NewWSOLFile wsd E WSDL php BA Include Paths E MyProject2 D Le MyPropect3 LZ Profle 477 Zend Studio 7 User Guide PHP ac View Toolbar Commands Name Description BE i a E backwards and forwards through your recently navigated resources These icons will only be active if the Go into the selected element option is selected in the PHP Prefer
54. Description Enter a brief task description in the text box at the top this box does not have a label Component Specify a Component to further categorize this task within the previously selected Product Description Describe the task in detail Optional You can specify additional information about your tasks in the Attributes section Personal Planning You can enter information in this section that will be local to your workspace and not available on your team s task repository See Local Tasks for more information about the personal planning fields Assigned to Specify who should work on the task Type the first several characters of the person s email address and then press ctrl space to select the address from a list A task can be assigned to only one person at atime Add CC Add the addresses of people who should be notified of changes to this task You can add multiple addresses separated by a comma e g mik kersten tasktop com steffen pingel tasktop com When finished click Submit to add your new task to your team s shared task repository Context The context tab allows you to manage the context of resources associated with the task You can view the context tab by selecting it in the lower left of the editor window 445 Zend Studio 7 User Guide Elements This section lists the resources that are part of the tasks context Because the number of elements may be large you can adjust the leve
55. Developer Zone is the leading resource center for PHP developers where you can learn about PHP and meet the experts The Zend Developer Zone features the following The PHP 5 Info Center Articles and Tutorials PHP and PEAR News Weeklies Worldwide Job Classifieds Visit http devzone zend com Feedback Send feedback questions and comments on the Online Help and Documentation to documentation zend com 644 Reference Registering Your License Once Zend Studio is installed all its features will be available for a 30 day trial At the end of the 30 day trial the professional features will be disabled These include refactoring getter and setter generation Zend Framework integration profiling PHPUnit testing Zend Server Integration debugging through tunneling advanced code formatting code galleries and more To enjoy the full range of Zend Studio functionality you should register a valid license To register a valid license and activate all Zend Studio features go to Help Register and enter your username or order and license key You can purchase a Zend Studio license from the Zend Store at http www zend com store software studio or from the menu bar go to Help Purchase a License 645 Index dei VT 252 5 5250 Bridge ccceecceceeseeeeeeeeeeeeeeesenees 166 A ADSOIUTE eee 143 Activating Tunneling seese 356 Add CVS Repository sseeeeeeeeeeeee eenen 42 Adding an SV
56. Double click on a failed result to be taken to the test function in the test file To correct the failed result either fix the test function or the original function on which it was run Tasks 8 The Code Coverage display indicates how much of the code in both the original file and the test file was run The percentage in the Covered Lines column displays the percentage of lines executed out of the total number of executable lines The number of visited lines are the number of executable code lines The number of significant lines are the number of lines which were executed The number of total lines is the total number of lines in the file 9 Click on the code coverage statistics next to each file to open the Code Coverage view displaying the code with the lines of code that were run Visited lines will be highlighted in blue Significant lines will be highlighted in pink Once you have corrected errors you can re run the PHPUnit Test by clicking the Run Last Test button Xr in the PHPUnit view until all tests pass successfully You can transform the xml file created with while running the PHPUnit Teasr into an HTML report using the Report Generator icon See Reporting on PHPUnit Test Results for more details 385 Zend Studio 7 User Guide Creating a PHPUnit Test Suite This procedure demonstrates how to create a PHPUnit Test Suite for running a number of PHPUnit Test Cases at once This function
57. EE 231 Opening PHP Elements ege gekeeENe ini a ee atid eevee ected 232 Opening Types Methods adviiwe iienaa aia Ais ane ieee Kiia Eaa 233 Using Smart Goto ep ies degiet E Leeder eaaa a aaraa a eege et eise SEERA 234 Viewing Type Hierarchies ite ciictieeetiteneecsbhagest cee diveettineagetasrdcbiieea ERTER 235 Creating PHP Working Setske ngear as inana das aae an aaa a EEEa AEREE 237 Using Mark OCCUneNCES inasnan ane eaaa aa eaa aa aa a aaa Anaa a a aRar 239 Findingiand Replacing E 240 Applying QUICK FIXES sieaa enet e aaa a ae raa aaa aaa a aaa 241 ee ae KE eu EE 242 Adding PHP DocBlock Comments AAA 244 Usinig oGal HEt EE 245 Comparing RUE 246 Replacing Files EE 247 Restoring Deleted Files arr aarre ea aN ALARA AARS ARA RAE LAERE PESER AEE CTARA EARE AEPA 247 He Mee eege AE TE EATE E EETA E E 248 Configuring a CVS Connection ccccccccceeseeceeeeeceeeeeeaeeeeaeeseeeeeseaeeesaaeseeaeeseeeesaeeseaeeeeneeee 249 Importing Projects from CNS 251 Accessing an Existing CVS Checkout 253 viii Table of Contents Uploading Projects to CNS 255 Using SVN TTT 256 Configuring an SVN Connection ccccceeececeeeeeeeceeeeeaeeeeaeeceeeeeceaeeeeaaeeseaeeseeeesiaeeseaeeeeneeees 257 Importing Projects from GN 259 Accessing an Existing SVN Checkout 261 Uploading Projects to NN 263 Using FTRand SSH WEE EE 264 Creating an FTP SSH Connection ccceccceeeeeeeeeneeeecaeeeeeee scenes cae eesaaeseeaeeseeeeesaee
58. Ee 550 PHP PreferenCes Page atiera taeda aaea AERA ARE Rakin AAEE FENE AREARE ARa EAE daa 552 Appearance Preferen O S serie ipne aeeie ataoa arara ar adaa aspan rid daona PaE iy 553 Code Coverage PDreterences 554 xiii Zend Studio 7 User Guide Code Gallery Preferences c cccecccececeeeeseeeeeeeeceaeeeeeaeeeeaeeseeeeesaaeeesaaesseaeeseeeesiaeeseaeeseneeee 556 Code Refactor Preference ccccccecceeceeneeceeeeeceaeeeeaaeceeneeseeeeeseaeseeaaeseeneeseeeesaesseaaeseeneeee 558 Code Style Preferences cccceecceceeceeeeeeeeeseeeeeeeeceaeeeeaaesseaeeceeeesaaesseaaeseeaeeseeeesaeeseaeseeneeee 559 Code Templates Preferences ccccccceceeeeeeceeeeeceaeeeeeaeeeeeeeseaeeesaaeeseaeeseeeeeseaeeesiaeeteeeenaes 559 Formatter Preferences oessansro iiiar eerie ar piar E AA ENEA EAA UN AEAEE ANERER SE 562 Dee Krelerenee nanea a EE A eee Nees 571 Installed Debuggers csaa a a a a a E E ENN 573 Step Filtering Preferences cccccccccceseecsenceeeeeeecaeeeeaaeseeneeceaeeeeaaesseaaesseeeeseaeeesaeseeneeesaes 575 Workbench Options Preterences 577 Editor EE 578 Content Assist Preferences sssssesesesenesenesrnesrnsrnstnsrnstnsstnstnsstnnstnsstnnsnnnsrnnsrenstennnnno 579 Code Folding Preferences A 581 Hovers Preferences c eccceesecceeeeeeeeeeeeseeeeeeeeaeeeeeesaeeeeeeseaeeseeseaaeseeneaeesesseeseeeeneaeeeesnenaes 582 Mark Occurrences Preferences sseesessiesriseriesriesristissisttiettistttntttnntnn t
59. Expand the nodes until you see the MySQL JDBC Driver Select the driver The default driver name will be entered in the Driver Name field If required delete this name and enter a new name Ensure that the Edit New Driver Definition Immediately checkbox is marked Click OK The Driver Details wizard opens Edit Driver Definition Provide Driver Details 8 Unable to locate jar zip in file system as specified by the driver definition mysql connector java 5 0 0 bin jar Driver Name MySQL JDBC Driver Driver Type Driver File s mysql comnector java 5 0 0 bin jar Delete the sample jar driver file by selecting it and clicking Remove Jar Zip Click Add Jar Zip Browse your file system to find your MySQL driver and press OK Your driver will be added to the list Click OK Your new driver definition will be added to your Driver Definitions list This will allow you to access the driver when connecting to a MySQL database 304 Tasks 305 Zend Studio 7 User Guide Creating and Executing an SQL Query This procedure describes how you can run an SQL query on your database once you have created it You must have created a Connection Profile and connected to your database before using this functionality w To run an SQL Query on your database 1 Open the Database Development perspective by going to Window Open Perspective Other Database Development 2 Connect to your Database by following the step
60. Function name File The file in which the function is located Total Execution Time Percent of time taken per function Duration Time Time taken per function in milliseconds T Profiler Information Sen Sls iat ae Come Se ASL 20 _ Function Total Execution Time Duration Tine ins l main DI Ee 48 8 267 43 man F Person php 0 0 0 01 5 Person __construct Person php 15 73 66 24 O Person setFirstName F Person php 0 01 0 03 Person isetLastName a Person php 0 0 0 01 Person setAge F Person php 0 0 0 01 Person setGender F Person php 0 0 0 02 8 Person _construct F Person php 0 01 0 06 E Person __construct IF Person php 0 01 0 06 Person printData P Person php 0 05 0 28 H O Person printDate 181 Person php 0 01 0 04 5 Person printData P Person php 0 01 0 05 Right clicking a function in the list gives you the option to View Function Call Will open the selected function call in the editor View Function Declaration Will open the selected function declaration in the editor Open Function Invocation statistics Will open a view with statistics about the selected function the functions it was invoked by and functions it invoked Code Coverage Summary Summary of how many lines of code were covered during the Profiling process Element The file project that was called Covered Lines Visited Significant Total Percentage of lines covere
61. HTML gt 465 Zend Studio 7 User Guide JavaScript Syntax Coloring Configuration JavaScript Syntax Coloring options can be configured from the JavaScript Syntax Coloring preferences page To configure JavaScript Syntax Coloring options 1 Go to the JavaScript Syntax Coloring preferences page accessed from Window Preferences Web JavaScript Editor Syntax Coloring Syntax Coloring gt This is about lt code gt Example js lt code gt Blink com yourCompany aPackage aFile author author deprecated use de gt BerterExample js var index 0 var arr D function fool This comment may span multiple lines var vari new Obaecrii WS Ca Com 2 Select the required item from the Syntax element list To enable Syntax Coloring for the element ensure the Enable checkbox is marked 3 Select what formatting if any you would like to apply to the text Bold Italic Strikethrough Underline The Sample text box displays a preview of the different elements 5 Click Apply to apply your settings 466 Tasks Using JavaScript Mark Occurrences The JavaScript Mark Occurrences feature allows you to see where a variable method or type is referenced within a JavaScript file wi To use Mark Occurrences Stand on a variable method or type in your file function substitute text word replacement var temp text it perform string replacement using substring wf w
62. Menu Bar The options available in the New Menu for the current perspective can be configured through the Customize Perspectives option in the Window Menu The options available under the New submenu are Description Cor cl PHP Project Creates a new PHP project within your workspace with PHP toe cat 0 Zend Creates a new Project with Zend Framework s libraries in the Include Framework Path and files to create a basic Hello World application Project For more on Zend Framework visit the Zend Framework site at http framework zend com For more on using Zend Framework with Zend Studio see Zend Framework Integration Project Creates a new project in your workspace PHPUnit Test Creates a new PHPU nit Test Case Case See PHPUnit Testing for more information Creates new repositories using the Task Repository view PHPUnit Test Creates a new PHPUnit Test Suite Suite See PHPUnit Testing for more information Creates a new file with PHP tags Allows full PHP Creates a new file with PHP tags Allows full PHP functionality ee ee eee Creates a new folder within a project The new folder can be linked to a folder in the files system by clicking on the Advanced button in the new folder creation dialog Using this option will insert an existing folder into your workspace folder Any changes made to the files and folders in your workspace will automatically be reflected in the local versions of the files in your fi
63. Preferences PHP Debug or by clicking the Configure Workspace Settings link on the properties page 629 Zend Studio 7 User Guide PHP Include Path Properties The PHP Include Path Properties page allows you to configure the project s Include Path To access the PHP Include Path Properties page right click a PHP project in PHP Explorer view and select Properties PHP Include Path or select the project and from the menu bar go to Project Properties PHP Include Path Properties See Configuring a Project s PHP Include Path for more information 630 Reference PHP Interpreter Properties The PHP Interpreter Properties page allows you to set the PHP version used for the project This will affect the internal debugger code analyzer and content assist options To access the PHP Interpreter Properties page right click a PHP project in PHP Explorer view and select Properties Resource or select the project and from the menu bar go to Project Properties PHP Interpreter Properties w To configure PHP Interpreter Properties for the project 1 Mark the Enable project specific settings checkbox 2 Configure the settings according to your preferences See PHP Interpreter Preferences for more information on the settings available 3 Click Apply A prompt dialog will appear stating that a rebuild of the project must occur for the settings to take effect 4 Click Yes to rebuild the project Or click No for a reb
64. RSE RSE Remote Server Explorer provides transparent access to remote resources including the upload and download of files 1 To configure a new connection open the Servers View situated at the bottom of the page click the Connections node and from the right click menu select New New Connections 2 Use the New Connection dialog to choose the connection type configure your settings and save To learn more about working with RSE see Working with Remote Server Explorer 22 Getting Started Source Control Zend Studio includes a built in component for CVS Concurrent Versions System and SVN Subversion Before accessing a repository make sure that a CVS or SVN server is already configured on the host machine KY To configure access to a repository through Zend Studio 1 On the main menu go to Window Show View Other 2 Select either CVS or SVN repositories 3 From the CVS SVN view toolbar select the Add CVS SVN Repository button 4 Fill in the location and authentication details and press Finish CVS SVN functionality can then be accessed by right clicking on or within the relevant file or project and selecting Team Compare with Replace with or Source See CVS or SVN for more information PHPUnit A PHPUnit is a testing framework to write and run tests on PHP code A test file can be created for each class function and file PHPUnits allow PHP developers to incrementally build test suites to constant
65. Server installed on your local machine it is automatically detected and configured as the default server in the PHP Servers list See Configuring Zend Server Settings in Zend Studio for more information 607 Zend Studio 7 User Guide w 608 To add a new server to the list or edit an existing server configuration Click New Or select an existing server and click Edit Configure a PHP Server ES Specify the Server Infomation i Name Server Emna the URL that points to the document toot of this server ku Nocalhost fa Enter the name of your server Enter the URL that points to its document root Click Next The Server Path Mapping dialog appears If you would like to map a path on your server to a local path click Add and enter The path on your server The path you would like to map it to in your Workspace or on your File System See Adding a Server Location Path Map for more information Click OK and Next If you would like to enable integration with Zend Server mark the Enable Zend Server Integration checkbox and enter the relevant information URL Suffix The suffix which should be added to the URL of your document root in order to browse to your Zend Server GUI Port number Enter the port number you defined during Zend Server installation See the Zend Server FAQ site for default port number settings Password The password used to access your Zend Server GUI Cli
66. Studio Zend Server events can be exported from Zend Server into a xml event file which allows you to recreate an error when you have access to the Zend Server on which the event occurred The event can then be imported into Zend Studio and debugged For information about importing events using the Code Tracing feature see Working with Code Tracing This will also allow you to import amf event files into Zend Studio To debug a Zend Server event when you do not have direct access to the Zend Server 1 Export the event s into a Zend Server event file 2 Import and Debug the Zend Server event file in Zend Studio 209 Zend Studio 7 User Guide Creating a Zend Server event file Zend Server events can only be exported through the Zend Server GUI To export an event from Zend Server 1 Open your Zend Server GUI This can be done from within Zend Studio by selecting the server on which you have configured your Zend Server integration from the drop down list next to the Zend Server icon on the toolbar gi See Configuring Zend Server Settings in Zend Studio for more on configuring a Zend Server in Zend Studio 2 Access the Event list by browsing to the Monitor Events tab 3 Click the Event which you want to export alt Monitor E Rute Management A Server Setup Q Administration Dashboard Events Server info PHP info Logs refreshed 25 Mar 2009 11 10 5 PHP Error SG d Occurred once at 19 Feb 2009 17 25 Status Op
67. Tasks Configure your server by following the instructions on adding a new server under the PHP Servers Preferences page For more information on configuring the communication between Zend Studio and your remote server see Setting Up Remote Debugging Under PHP File click Browse and select the required file Click Apply and then Profile A confirmation dialog will be displayed asking whether you want to open the Profiling Perspective Click Yes If you would like the Profiling Perspective to open by default in the future mark the Remember my decision checkbox The Profiling Perspective will open displaying the Profiling Monitor window with various Profiling views See the PHP Profile Perspective for more on the information that will be displayed once a profile session has been run If the file contains include or require calls to files which are not contained within the project you must add them to the project s Include Path in order to simulate your production environment 353 Zend Studio 7 User Guide Profiling a PHP Web Page This procedure describes how to profile whole applications projects files or collections of files that are already on the server Your server must be running the Zend Debugger or XDebug in order for remote debugging and profiling capabilities to function The Zend Debugger comes bundled with Zend Server Zend Core and Zend Platform also be downloaded as a separate component from http ww
68. This procedure describes how to debug a PHP Script from your workspace using an internal PHP Executable wi To locally debug a PHP Script 1 Set breakpoints at the relevant places in the file that you would like to debug by double clicking the vertical marker bar to the left of the editor Save the file Click the arrow next to the debug button E on the toolbar and select Debug Configurations or select Run Debug Configurations A Debug dialog will open Double click the PHP Script option to create a new debug configuration Name New_configuration PHP Script PHP Script Arguments B Environment E Common ji Debugger Location PHP executable PHP Debugger Zend v PHP Executable ps C Zend Dev workspace org zend php debug d se PHP Executables O PHP Web Server Default PHP Web Server PHP File Browse Breakpoint Break at First Line jebug Close Enter a name for the new configuration Ensure that the PHP Executable option is selected under the Debugger Location category and select the required PHP executable Select the Zend Debugger from the PHP Debbuger list Enter your PHP file in the PHP File text field or click Browse and select your file Marking the Breakpoint checkbox will result in the debugging process pausing at the first line of code 319 Zend Studio 7 User Guide 10 If necessary you can add arguments in the
69. WSDL Web Services Description Language ssesssssseesrsssrrssrnssrnesinssrnssrnssinssrnssrnnsrnnsrnne 177 Zend Studio for IBM ii Extras ii 4 vies skies iene Nee Nee ENEE aen 178 elle EE 181 Remote System Explorer zs insirita iiai i iaaa A a a E AA 182 Remote Server SUPPOrt rssesrisiiiriiei iniata eesuaebecedeve vaeeediesacetevsbaeeeegeeenatavstaeehatheeedes 183 Mylyr Integrations orinni aiiai ee eid aca EE el Mec ede ed 185 Phat Integratlo Lu ET 186 TASKS EEN 187 TASKS EE 187 Greating PHP Projects EE 188 Creating PHP Files cccsiecccttsiethevl weve betedveccehvdeebteceeteed xteaeeteiyetaadivendtetare eaaa aeaaea an oiak 190 Creating a PHP File within a Project AA 190 Creating a PHP File Outside of a Project 190 Opening an External Files restarta chy tananan tinau aate earan aaae dE IRAN chcevens 191 le Bd Li 194 Creating a New PHP Class eeneeneeneesseessnesnessressrnesnnesrnetnnstrnssrnstnnsernntnnsensstnnsrensrensnnnt 194 Creating a New PHP Interface cccccceeeeeceeeee cece eeeeaeeeeeee scenes ceaeeeeaaeseeeeeseeeesaeeeeaeeeeneeee 196 Migrating From Zend Studio by 198 Migrating Projects From Zend Studio by 198 Migrating Keymaps from Zend Giudiop NA 200 Zend Server Integration c ccccecceeseeceeececeeeeeeeaeeeeneeceeeeeceaeeseaaesgceeseaeeseaaesseneesseeesiaeeseaeeninees 201 Zend Server Integration 201 vii Zend Studio 7 User Guide Working with Code Tracing cccccccsccceesceceeeceeeeeeeen
70. Zend Debugger C Program Fi Search HM gt Ca To add a PHP executable to the list 1 Click Add The Add PHP Executable dialog will appear Add new PHP Executable Add PHP Executable T Enter a label for the PHP executable 2 Enter a name for the PHP Executable 3 Inthe Executable path selection enter the location of the PHP executable on your Reference file system 4 Select the PHP ini file to be associated with the PHP Executable by clicking Browse optional 5 Select the PHP Debugger to be used with the executable By default this will be the Zend Debugger 6 Click Finish The PHP executable will be added to yout list w To search for a PHP executable on your local file system 1 Click Search 2 Inthe Directory Selection dialog select the folder to search 3 Click OK Zend Studio will search for PHP executables in the location specified Any found PHP executables will be added to the list To change the name of the new PHP executable select it from the list and click Edit If a PHP executable is not found in the specified directory select a different location or add the PHP Executable manually by following the instructions under To add a PHP executable to the list above 601 Zend Studio 7 User Guide PHP Interpreter Preferences The PHP Interpreter preferences page allows you to set which PHP version to use for the project This will affect the internal debugger code analyzer and con
71. Zend Server Settings in Zend Studio for more information 6 Click Next to continue or go to the next Tab E PHP Server Creation lpi x Tunneling Settings SH Specify the Tunneling settings E Vv Enable Decke Settings E Specty Rem How 101 3250 T Automatically Connect on Startup Authentication E Send Authentication Information Loos Mame Lee Password Less 7 Inthe Tunneling Settings section check the Enable Tunneling option 8 In some system configurations a dedicated tunneling server is used which allows debug connectivity between Zend Studio and the server which is being debugged In 344 Tasks this case unmark the Specify Return Host checkbox and enter the IP address of the tunneling server to which the tunneling connection will be opened 9 If your Web server requires HTTP authentication enter your User Name and Password in the Authentication category Zend Studio sends the authentication information in the header Note This assumes the user account is set up on the Web server 10 Click Finish or OK Your server is now configured to allow tunneling in Zend Studio The next step is to Activate your Tunneling Connection 345 Zend Studio 7 User Guide Activating Tunneling Once you have configured all the necessary settings in Zend Studio and on your server you can activate your Tunnel connection This procedure describes how to open a tunnel between Zend Studio an
72. a Giferent server select the Akernate Server option below Evert Deia Summary Issue ID S Server localhost b E a Function trigger _error File Name C Program Files Zend Apache2hedocs issues php Une CO Run diagnostics on O Originating Server O Akemate Server http flocathost 81 Others E Add debug session to debug history menu 4 By default the event will be debugged on the server according to the server address defined in the event file To debug on a different server select the Alternate Server option and enter the address for the alternate server Ensure the server on which you are running the debug session is configured to run 211 Zend Studio 7 User Guide 212 remote debugging sessions See Setting Up Remote Debugging for more information By default a server defined on a local machine will have the server URL localhost 127 0 0 x If the address configured for the server from which the file was exported is configured as localhost selecting the Originating Server option will run the debug session on the localhost server of the machine on which Zend Studio is located which could be different than the server from which the event was exported In this case to debug the event on the originating server select the Alternate Server option and enter the URL of the originating server Mark the Add debug session to debug history menu checkbox for the debug session to be availa
73. applied within the element selected in the top pane Next Previous Change scrolling arrows AA Scroll through all changes to be applied If you unmarked changes in the top pane these will not be displayed when using these arrows 8 Once you are satisfied with the changes click OK The element will be renamed and all instances where that element is referenced will be updated to reflect the changes 396 Tasks Moving Files This procedure describes how to move a file which will result in the automatic updating of all instances where that file is referenced required included etc within the project to reflect its change of location Ensure that you save any changes to the file before applying the refactoring feature in To move a file 1 In PHP Explorer view right click the file which you would like to rename and select Refactor Move or press Alt Shift V A Move File dialog will appear Choose destination for the selected items L Demo Project LG o1Project W Profile Project eS Project mm Le oe 5 E Refactor Project eg MyFolder amp OrganizeImports i UnitTestingProject ES UnitTesting Project 2 HES ZendFrameworkExample HS Z2FProject Update references to the moved element s Select the new location of the file Check the Update references box and click Preview A preview window with a changes tree will open showing all the changes which will be made to reflect the move of the file
74. are New Window New Editor Open Perspective Show View Customize Perspective Save Perspective As Reset Perspective Close Perspective Close All Perspectives Navigation Working Sets Web Browser and Preferences Gives access to the most updated information on all aspects of Zend Studio as well as allowing access to software updates and registration locations so that you can get the most out of the product The Help menu options are Welcome Help Contents Search Dynamic Help Key Assist Tips and Tricks Software Updates Register Tip of the Day and About Zend Studio 515 Zend Studio 7 User Guide File Menu The File Menu allows you to carry out various functions on active files and folders as well as organizing current files and creating new items The options available from t he File menu are Peres ee ee E Alt Shift N m 8 Close All Ctrl Shift W m e Creates various items and types of files To see the list of new items that can be created through this menu see the New subtopic Note The options available in the New Menu for the current perspective can be configured through the Customize Perspectives option in the Window Menu Opens a previously created file in an editor view If the file is stored in your workspace s active projects the file will be displayed in PHP Explorer Navigator views Closes the active file s editor If there are unsaved changes in the file you will be promp
75. available in the Zend Server Code Tracer perspective see Working with Code Tracing 206 Tasks Opening the Trace Data Source Opening the source of trace data execution data allows you to see the source of the functions inside Zend Studio This functionality does not allow for editing of the source but rather is used to pinpoint exactly where in the source the event is occurring You may then edit the source inside of the corresponding local file Important Note To open the source of trace data you must first Import a Zend Server Event File for which the project already exists locally in your Zend Studio S Opening the source of trace data 1 To open the Zend Code Tracer perspective go to Window Open Perspective Other Zend Server Code Tracer In the Tracer view go to the Statics per Function tab A list of the functions appears To see the memory usage of each function mark the Show memory usage option in the view Double click on a function The Open Resource dialog opens w Open Resource Select an item to open any character any string Tome Matching items P Formiine drupaljincludes e Celtes Use the drop down menu in the dialog to Show the status line Shows the status line in the current window Show the derived resources Resources that are not original data but can be recreated from their source files For more information see Derived Resour
76. be created with several parameters to be edited with the relevant information The default code comments generated for different elements can be configured through the Code Templates Preferences page 244 Tasks Using Local History The following actions can be carried out using the Local History functionality Comparing Files Replacing Files Restoring Deleted Files 245 Zend Studio 7 User Guide Comparing Files This procedure describes how to compare a current version of a file with one from the Local History J 246 To compare the current file state and a previous one Right click the file in PHP Explorer view and select Compare with Local history The History View will be displayed with a list of all the previous saved versions of the file E problems Tasks DI console men 2 D Sifi o pope ag gt ee mg EH Revision Time 20 06 2007 16 50 20 06 2007 16 46 A E 19 06 2007 14 38 19 06 2007 13 33 P lt 2 Double click the version that you would like to view The Text Compare dialog will be displayed with the current file version displayed in the left pane and the previous version displayed in the right pane Any changes that have been made between the current version and the previous version will be highlighted t l P Text Compare F Local Denge z 2 1 lt php 1 lt php This is the original file i This is the original file I
77. comes bundled with Zend Server Zend Core and Zend Platform but can also be downloaded as a separate component from http www zend com en products studio downloads Ensure the machine on which your Zend Studio is installed is an allowed host for your debugger The method for configuring this setting will depend on whether you have Zend Server Zend Platform Zend Core or the standalone Zend Debugger installed on your system See Setting your Zend Studio to be an Allowed Host for more information In Zend Studio configure your server according to the instructions under Adding Servers in the PHP Servers Preferences Ensure the correct settings are configured in your Debug Preferences and Installed Debuggers Preferences pages Ensure you have a dummy php file in your remote server s document root If your server is situated behind a firewall or other security device see Setting Up Tunneling for information on how to enable a communication tunnel If you don t know whether your server is situated behind a firewall contact your System Administrator Tasks Setting your Environment to be an Allowed Host This procedure describes how to ensure the machine on which your Zend Studio is installed will be an Allowed Host for initiating your Debug and Tunneling session on the remote server The steps you need to follow will depend on whether you have Zend Server or the standalone Zend Debugger installed on your server KY If Zend Se
78. comment and uncomment lines and blocks of code w To comment a line 1 2 Place the cursor anywhere on the required line of code Press Ctrl Two slashes will be added to the front of the line causing it to be recognized as a comment lt php D is a comment d line KY To comment more than one line 1 2 won A in Select all the lines that you would like to be commented Press Ctrl Two slashes will be added to the front of each line causing them to be recognized as a comment lt php This fThis is another comment is a comment one fand another w To uncomment a line lines 1 2 242 Select the required line s Press Ctrl The commenting formatting will be removed from the code Tasks w To comment a block 1 Select the required block of code 2 Press Ctrl Shift The beginning and ending characters will be added in the appropriate places in order to mark the selected block as a comment lt php comment b i block mb wn pb 243 Zend Studio 7 User Guide Adding PHP DocBlock Comments This procedure describes how to add PHPDoc Comments to PHP elements w To create a PHPDoc Comment In the line above the code for the PHP element enter the DocBlock characters and press Enter Or Right click the relevant element in the Outline View and select Source Add PHPDoc A PHPDoc Comment will
79. create a new Zend Framework Project that is organized into Framework s Controller Model View system The project will have Zend Framework s libraries added to its include path allowing access to all Zend Framework s elements The new Zend Framework project that is created in Zend Studio will contain basic files for a simple Hello World program When a Zend Framework Project is created you will be prompted to open the Zend Framework Perspective containing the MVC Outline view DZ Outline s PHP Proj O kz BIS SE zr Project gt application Ei default controllers D D ErrorController php E P IndexController php R Zend Controller Action php IndexController si models m ES views The MVC Outline view provides an outline of all controller model and view classes files variables and related functions To manually open the Zend Framework Perspective go to Window Open Perspective Zend Framework 141 Zend Studio 7 User Guide Once you have created a Zend Framework project you can use Zend Studio s New Zend Table Zend View Zend Controller Zend Module Zend View Helper or Zend Action Helper Wizards to create new Zend Framework elements Zend Framework Content Assist Once Zend Framework s libraries are included in a project s include path its classes functions iterators and variables will be available for use from the Content Assist window Simply press Z
80. debug_coverage edetug port 10137 Bstart_profie 1 Path C Documerts and Settings keren siZendiworkspacesiDef ath Total Request Time ms 548 06 Number of Fles 2 Date Tue 2d OS 13 1 0S IDT 2007 E tryPerson php 180 7 ms 67 6 Person php 86 73 ms 32 4 The right side of the view displays time division in a pie chart and the left side provides the following information URL The URL analyzed if applicable Query The specific query parameters Path The location of the first file called Total Request Time Total processing time for the entire page Number of Files Number of files processed Date Date and time that the profiling took place The Profiler Information View view is displayed by default as part of the Profiling Perspective To manually open the view go to Window Show View Other PHP Profiler Profiling Monitor 503 Zend Studio 7 User Guide Execution Statistics View The Execution Statistics view displays the list of files that were called during the profiling process and detailed information on processing times for elements within the files IT Profiler Information Execution Statistics 2 db Execution Flow CX Code Coverage Summary Si BE WH A Function Cals Court Average Own Time Own Time s Others Time s Total time s ki P tryPerson php 0 18070 man 1 0 180701 0 180701 0 036728 0 267429 F Person php 0 086728 5 D Person 0 086722 __constru
81. displayed once a Profile session has been run If the file contains include or require calls to files which are not contained within the project you must add them to the project s Include Path in order to simulate your production environment 351 Zend Studio 7 User Guide Remotely Profiling a PHP Script This procedure describes how to profile a PHP Script from your workspace using the Zend Debugger installed on your remote server Your server must be running the Zend Debugger or XDebug in order for remote debugging and profiling capabilities to function The Zend Debugger comes bundled with Zend Server Zend Core and Zend Platform but can also be downloaded as a Separate component from http www zend com en products studio downloads w i To remotely profile a PHP script 1 Click the arrow next to the Profile button db on the toolbar and select Open Profile Dialog or from the main menu go to Run Open Profile Dialog or right click in PHP Explorer view and select Open Profile Dialog 2 A Profile dialog will appear PHP 5 C Program Fies Zend Zend Studo lor Ecipse Betah Sl P Double click the PHP Script option to create a new Profile configuration Enter a name for the new configuration 5 Select the PHP Web Server option and select your server from the drop down list If you have not yet configured your server click the underlined PHP Servers shortcut The Servers preferences page will open 352
82. editing your code in a WYSIWYG view you can install the WST Web Page Editor plugin This plugin provides functionality while allowing you to view something very similar to your end outcome before the project has been completed To download the necessary plugin follow this link http kb zend com index php View entry amp EntryID 419 For more information on adding a plugin see Update Manager More information about writing HTML can be found at hittp www w8schools com html 410 Tasks Using Code Galleries The Code Gallery view gives you access to code snippets that you pre defined or that are available through a Code Gallery site The Code Gallery view can be accessed from Window Show View Code Gallery Problems Z Tas EI Ce Gegen HESE Ee type fiter text Details checkdigit modulo 10 E User Code Gallery A Author amp Zend Code Gallery Created ENE F Agoatims Last Update i Arrays Conversions Description Passwords Sorting Calculates the checkdigtt cdv 10 for ackdigt modulo 10 either a integer or string value a Cdv10 are often used in account numbers etc Check israed Teudat Zehut nun eels Preview Convert IP string XXX YYV W Convert to base 10 function cdv10 str A CRC check sum e ee Ae if is_string str doman chass v _ ei lt gt See Inserting Code Snippets into your Script Creating and Editing Code Gallery Entries and Interacting with Code Gallery Sites
83. error fora variety of occurrences divided into the following categories Compile Errors Potential Programmer Problems To select a severity level for an event click the E arrow next to each header to display the possible options if not displayed and select the severity level from the drop down list next to each option 3 Click Apply to apply your settings A prompt dialog is displayed indicating that a rebuild of the project must occur for the settings to take effect 4 Click Yes to rebuild the project Click No for a rebuild to be performed only when Zend Studio is restarted Click Cancel to cancel the operation Compile Errors Allows you to select the severity level error warning or ignore for the following Duplicate PHP element declaration in same file Duplicate PHP element declaration in file hierarchy Class element visibility reduce Unimplemented abstract methods Potential Programmer Problems Allows you to select the severity level error warning or ignore for the following Undefined local variable Undefined function Undefined field slow check Undefined method slow check Undefined class or interface Assignment in condition e g if a b Assignment has no effect e g a a Bad escape sequence in string 614 Reference w To apply Semantic Analysis Preferences settings to a specific project only 1 Select the link labelled Configure Project Specific Settin
84. field will have been automatically populated with the name of the original folder Edit this entry if required 4 Adding a folder to a project s Build Path could cause a conflict between the inclusion exclusion patterns configured for the project root and those configured for the selected folder In order to avoid these nesting conflicts select one of the following options Replace existing project source folder entry to solve nesting This will remove your parent directory as a source folder from the Build Path configuration and replace it with the currently selected folder Update exclusion filters in other source folders to solve nesting This will exclude the currently selected folder from the parent directory s Build Path but will add it as a separate entity so that different inclusion exclusion patters can be configured for it 375 Zend Studio 7 User Guide Ignore nesting conflicts The selected folder will be added as a separate entity to the Build Path list but will need to be manually excluded from the project root s Build Path to avoid nesting conflicts 5 Click Finish The folder will be added to your Build Path and displayed in the Build Path list You can now configure a pattern for including excluding resources for the linked folder by following the instructions under Configuring Inclusion Exclusion Patterns above 376 Tasks Adding a Server Location Path Map This procedure describes how to add a Pat
85. file will take you to the Zend Controller Action Helper s declaration class NewZendController extends Zend Controller Action Jeca t trict how ch H e jage public function indexAction Shelper I e helper gt 292 Tasks Searching the Zend Framework Site Zend Studio s workbench contains a search box which allows you to quickly and easily retrieve information from the Zend Framework site without having to leave the application This procedure describes how to search for information in the Zend Framework site To search the Zend Framework site 1 Open the Zend Framework Perspective by going to Window Open Perspective Zend Framework The Workbench will switch to the Zend Framework Perspective and the Zend Framework search box will appear in the bottom right of the Workspace 2 Enter aterm in the Zend Framework search box action helper x zz GO 3 Click the Go button A new browser window will open in Zend Studio displaying a list of relevant results from the Zend Framework site The browser will open according to the settings defined in Window Preferences Web Browser 4 Click the required result to be taken to the page containing the relevant information SEARCH THE SITE Search the Site Search term control You searched for control Language Engish Documentation Search in e 44 Zeng Cache backenas jen Wii issue Tracker Comments D I Kemmer m
86. filter text ERC Pa Debug a PHP Pa PHP Debug C Code Coverage View Covered Lines I OF Code Coverage View Uncovered Lines H Ji Structured Text Editors a y SVN ae se lt i gt All Description The color is used for the background color of uncovered lines in Code Coverage View Preview No preview available Restore Defaults Apply Reference 2 Select the required background color for covered lines and uncovered lines by selecting the relevant option and clicking the required color in the color selection box top right corner Click Apply The changes will be displayed in the Code Coverage preview page More color and font options can be configured by opening the preferences page Window Preferences and selecting General Appearance Colors and Fonts General Editors Text Editors Annotation General Editors Text Editors Quick Diff Run Debug Run Debug Console Team CVS Console 555 Zend Studio 7 User Guide Code Gallery Preferences The Code Gallery preferences page allows you to add and edit code galleries Code Galleries are pre defined code snippets sites Code snippets can be used to easily insert pre defined sections of code into your script The Code Gallery Preferences page is accessed from Window Preferences PHP Code Gallery Preferences Code Gallery Of oe Field Assist Help Install Update User Code Ga
87. find relevant sections quickly and easily Completing the relevant element will cause the required color and font settings to be applied to it The default color and font settings for PHP elements are PHP tags Comment HereDoc Keyword Normal Number PHPDoc String Task Tag Variable The color and font settings can be configured from the Syntax Coloring preferences page accessed from Window Preferences PHP Editor Syntax Coloring Syntax Coloring will also be available for JavaScript elements if JavaScript support was enabled for the project See Enabling JavaScript Support in PHP Projects for more information To configure JavaScript syntax coloring preferences go to Window Preferences JavaScript Editor Syntax Coloring 120 Concepts Automatic Completion Zend Studio can be set to automatically complete certain types of patterns To use the auto complete function type the opening character of the pattern in the editor and press Enter The pattern will be automatically completed by the relevant characters being inserted The following types of patterns can be auto completed Strings Automatically inserts a pair of double quotes Parentheses and Square brackets Automatically inserts a pair of brackets Braces Automatically inserts a pair of curly brackets PHPDoc and comment regions Automatically inserts the PHPDoc characters The types of patterns that can be auto co
88. folder will also delete the file on the FTP SSH server Adding new files to the linked folder in your workspace will upload the new files to your FTP SSH server 270 Tasks Developing with Zend Framework When developing using the Zend Framework you should first create a Zend Framework project which has the Zend Framework library added to it s include path You should then use the New Zend Framework item wizard to add Zend Framework elements to your project For information on how to create Zend Framework Projects see Creating Zend Framework Projects To trial using Zend Framework you can create a Zend Framework Example Project For information on creating Zend Modules Zend Controllers Zend Tables Zend Views Zend View Helpers and Zend Action Helpers see Creating Zend Framework Elements For information on how to search for information on Zend Framework see Searching the Zend Framework Site Once you have created your Zend Framework application you can run or debug it on your server by following the instructions in Running and Debugging Zend Framework Projects 271 Zend Studio 7 User Guide Creating Zend Framework Projects Zend Framework Projects are PHP projects which contain Zend Framework s libraries in their Include Path and which are organized into Framework s Controller Model View format if selected Zend Framework 1 8 projects are based on the Zend Tool ensuring your projects comply with the latest
89. for IBM i PHP API Toolkit functions 3 Content Assist for The Zend 5250 Bridge BM i PHP API Toolkit functions Free Registration System i users who have downloaded Zend Studio are entitled to a free license To receive and activate your free license 1 Togo to the Zend registration website go to the Menu Bar Help Get a License 2 Inthe site enter your System i server serial number and optionally check the box to have the license emailed to you Click the Generate License button When prompted enter you Zend User ID and Password The license key will be generated and you will see your User Name and License Key displayed 5 In Zend Studio from the Menu bar go to Help Register and enter your User Name and License Key 6 Click OK Your Zend Studio for IBM i will be registered and all functionality will be available 178 Concepts IBM i PHP API Toolkit functions Templates For information on Templates and how to use them see the Using Templates topic Zend Studio contains templates for the following IBM i PHP API Toolkit functions IBM i Template Explanation i5ActiveJobs i5Connect i5DataAreaCreate i5DataAreaDelete isDataAreaRead isDataAreaWrite isDtaqReceive isDtaqReceiveKey Enables retrieving the system s active jobs 1 Connects to i5 server Opens active job list Gets array for an active job entry 2 3 4 Closes handle received from i5_job_list function 5 Closes connecti
90. for more on working with Code Galleries 411 Zend Studio 7 User Guide Inserting Code Snippets into your Script This procedure describes how to insert existing code snippets into your script S To insert a code snippet into your script di 2 Open the Code Gallery view by going to Window Show View Code Gallery Place the cursor at the place in the editor into which you would like the code snippet to be entered Expand the nodes next to the required User Code Gallery in the Code Gallery view or enter a string into the type filter text box to search for a particular category or snippet Select the required code snippet The details of the code snippet including its description and a preview of the code will appear in the right hand pane Right click the snippet and select Insert or click the Insert button on the view s toolbar The selected snippet will be entered into your script Many snippets contain PHP tags If necessary ensure that you remove existing PHP tags from your script to avoid duplication 412 Tasks Creating and Editing Code Gallery Entries This procedure describes how to create a new code snippet and add it to your User Code Gallery so that you can quickly and easily insert it into your script S To add a code snippet to your list 1 Open the Code Gallery View by going to Window Show View Code Gallery 2 Right click the User Code Gallery from the list and select New Entry or c
91. in the editor when selected If unselected elements will be displayed in the editor when they are double clicked 490 Reference PHP Debug Perspective The PHP Debug Perspective can be launched automatically when a Debug session is run It contains views which allow you to control and monitor the debugging process wi Debug file C Doc uments 20and 20Settines miriam m Zend works paces DefaultWorks pace 7 phppreject sample sampte htmi Ze gt Bes File Edit Navigate Search Project Run Window Help s Ze Ge ebe E So a X Debug 7 WA Servers DI 00 Variables a Breakpoints lt gt Scripts 53 a i E Sy 2 ww file C Documents 20and 20Settings miriam m Zendj workspaces DefaultWorkspace Ll sample html 2 Mozila Application Ss file C Dacuments 20and 20Settings miriam m Zend workspaces DeFaultWorkspace amp file C Documents 20and 205ettings miriam m Zend workspaces DefaultWorksp _ p Application Thread running B Mozilla Browser ei Silke SE es VK e E Lei http pc karnaF zend net Ku mozilla Browser 23 7 sample html Pi B Outline ES Sa Q O vn amp address file c Documents 20and 20Settings miriam mj Zend workspaces Defaultwo J B is outline is not available a af 7 Ge Classic jQuery example See more examples at jQuery home page jQuery Jr Selected None E console A Tasks 7 L Debug Output L Browser Output iamas
92. in the project s controllers folders and displayed in the MVC Outline view 285 Zend Studio 7 User Guide Creating a Zend Table File This procedure describes how to create a new Zend Table file A Zend Table is a class for working with the model portion of the model view controller pattern The Zend Table manages the information and data manipulation in your application vn To create a new Zend Table file 1 In PHP Explorer view right click the models folder in your Zend Framework Project and select New Zend Framework Item Zend Table The New Zend Table Wizard will be displayed New Zend Table New Zend Table Create a new Zend Table Source Folder ZendFrameworkExample applic ation def auk models File Name TableName php lt eack Iva II pe JI Geet 2 The default location for the file will be in the application s models folder Click Browse next to the Source Folder field to change the location 3 Edit the file name 4 Click Finish A new Zend Table file will be created with the Zend Table template The new file will be displayed in the MVC Oultine view 286 Tasks Creating a Zend View File This procedure describes how to create a new Zend View file A Zend View is a class for working with the view portion of the model view controller pattern The Zend View manages the graphic interface aspect of your application See hitp framework zend com manual en zend view htm for more informati
93. include require call Example include ot L Debug php E PHPDecument1 php gt P test Debug php 16 include Debug php 115 Zend Studio 7 User Guide Class Type Hints By using a comment you can assign a variable its exact class value This assignment will affect the content assist of this variable accordingly be Example lt php function getClass return new Test II class Test function printValues Za b echo Values fa b Over Smart Test SmyVar gerClass myVar gt printValues a b Test Without the comment content assist will not be available for the function Concepts Content Assist for Magic Members Zend Studio supports Content Assist options for magic members These are properties and methods which were declared using the property or method tags within PHP DocBlock comments rather than in the PHP script itself See http manual phpdoc org HTMLSmartyConverter PHP phpDocumentor tutorial_tags property pkg html for more information on magic members abt Example lt php property t property method class Magician private thingy private _bar Sblah nev Magician blah gt e bopl Location ge ber Class i o foo Maggan 117 Zend Studio 7 User Guide Camel Case Matches Content Assist supports camel case matches when entering code which displays Content Assist options based on an ele
94. inform Zend Server of the method of connection to Zend Studio This allows Zend Server to automatically detect your Zend Studio Debug settings 221 Zend Studio 7 User Guide 6 Click Save 7 Restart your Web server for the settings to take effect Configuring Zend Server to Auto Detect Studio Settings This procedure describes how to configure Zend Server so that Zend Studio s settings are automatically detected during the Debugging Profiling of Zend Server events S To establish a communication tunnel between Zend Server and Zend Studio 1 Open your Zend Server GUI 2 Go to the Server Setup Monitor tab 3 Inthe Zend Server Settings section configure the following Auto detect the Zend Studio Client Settings Set to Om to inform Zend Server of the method of connection to Zend Studio This allows Zend Server to detect your Zend Studio Debug settings 4 Click Save 222 Tasks Using Content Assist This procedure describes how to use Content Assist in order to quickly and easily insert code elements into your script KY To use Content Assist 1 Enter the first few characters of the required code element into the editor 2 The Content Assist window should be automatically displayed 3 If the Content Assist window does not pop up automatically press Ctrl Space lt php det gt A defaut oF DEFAULT_INCLUDE_PATH CF definelsting name maxed value boolloptional e define_syslog_variables void det
95. information Your server must be running the Zend Debugger or XDebug in order for remote debugging and profiling capabilities to function The Zend Debugger comes bundled with Zend Server Zend Core and Zend Platform but can also be downloaded as a separate component from http www zend com en products studio downloads URL Debugging Allows you to enter a URL to debug an application on a server Only server files will be debugged so the files do not need to exist locally in your Workspace See Debugging a URL for more information Your server must be running the Zend Debugger in order for remote debugging and profiling capabilities to function The Zend Debugger comes bundled with Zend Core and Zend Platform but can also be downloaded as a separate component from http www zend com en products studio downloads 147 Zend Studio 7 User Guide Toolbar Debugging Allows you to Debug files and applications directly from your browser using the Zend Debugger Toolbar available for download from the Zend Studio Resources site http Awww zend com en products studio downloads See Debugging Using the Zend Debugger Toolbar for more information 148 Concepts Profiling The Zend Profiler displays a breakdown of the executed PHP code in order to detect bottlenecks in scripts by locating problematic sections of code These are scripts that consume excessive loading time The Profiler provides you with detailed reports tha
96. locally and remotely A conflicting change means that the file has been changed locally and remotely A manual or automatic merge will be required Also any entries in the view that contain children that are conflicts will also be decorated with the conflict icon This is done to make conflicts easy to find A conflicting deletion means that the resource was deleted locally and remotely 438 Tasks Upload to a Server This procedure describes how to upload resources to a server This action enables you to move files to a local connection Before uploading you must have already created a remote server connection and synchronized the project that contains the resource s wi To export resource s via PHP Explorer 1 Select the chosen resource s in PHP Explorer 2 Right click on the resource and from the right click menu select Team Export The chosen resource s will be moved to the remote location You can also export resources via the Synchronize View To export files via the Synchronize View 1 Select the chosen resource s in the Synchronize View 2 Right click on the resource and from the right click menu select Team Export The chosen resource s will be moved to the remote location Download from a Server This procedure describes how to download resources from a server Before downloading you must have already created a remote server connection and synchronized the project that contains the resource s
97. mark the Use existing repository location option and select your repository from the list Click Finish Depending on your authentication settings a dialog might appear asking you to provide authentication information Re enter your password and click Next Mark the Save Password checkbox to ensure that this screen does not reappear A Commit dialog will open 6 Enter a comment if required and click OK Your project will be uploaded to the SVN repository Your project will now have a repository icon a next to it in PHP Explorer View indicating that it is linked to an SVN repository Once the project has been committed other team members will be able to access and edit it See the Subversive User Guide for more information on SVN Additional user guides can be accessed from inside Zend Studio by going to Help Help Contents or from the Eclipse Online Documentation site http help eclipse org ganymede index jsp 263 Zend Studio 7 User Guide Using FTP and SSH Zend Studio s FTP and SSH support is given through the RSE Remote Server Explorer plugin Files from FTP SSH servers opened in Zend Studio can be edited using Zend Studio s PHP editing functionality such as Debugging Profiling Content Assist Outline views Formatting and Getter and Setter generation To view and edit a file from an FTP SSH server in Zend Studio you must first create an FTP SSH connection There are then two ways of working with files link
98. new folder Select the required folder and click OK The folder will be added as a separate source folder in the Build Path list In order to overcome the nesting conflict you should exclude the folder you have just added from the parent folder s Build Path See Configuring Inclusion Exclusion Patterns above for information on how to exclude the folder and all resources contained within it PHP Build Path a Source folders on build path SS Wont roa 7 Included Al 537 excluded resources Folder a CE 22 Induded 8 Te L wess _ x erat From PHP Explorer view 1 Right click the project and select Build Path New Source Folder The New Source Folder dialog will be displayed 373 Zend Studio 7 User Guide New Source Folder Source folder Add a new source Folder relative to Job Folder name Replace existing project source folder entry to solve nesting O Update exclusion fiters in other source folders to salve nesting 2 Enter the name for the new folder in the Folder name field 3 Adding a folder to a project s Build Path could cause a conflict between the inclusion exclusion patterns configured for the project root and those configured for the selected folder In order to avoid these nesting conflicts select one of the following options Replace existing project source folder entry to solve nesting This will remove your parent directory as a source folder from the Build Path config
99. of PHP Classes Functions and Constants For more see Searching for PHP Elements Opens the File Search dialog File Search enables you to locate text in all files in your workspace To run a File Search or Replace 1 Enter the required text to be searched for 2 Select the types of files to search in Click Choose for a full list of file type extensions Select whether to search in e Workspace the entire workspace Selected resources Select these in PHP Explorer view before opening the Source dialog Enclosing projects The projects which the selected resources are in Working Set Click Choose to select the required Working Set To search for the string click Search Search results will be displayed in the Search view To replace the string click Replace The Replace dialog will open By default the PHP Search dialog will be tabbed with the File Search dialog To make the PHP Search dialog unavailable click Customize within the File Search dialog and unmark the PHP Search dialog option Ctrl AlttG Workspace Searches the Workspace for text selected in the editor 534 Reference E Project Searches the current active project for text selected in the editor File Searches the current active file for text selected in the editor Working Set Searches the current active Working Set for text selected in the editor 535 Zend Studio 7 User Guide Project Menu The Project menu allows you to carr
100. on the CVS repository they can be checked out imported by anyone with access to that repository CVS repository connections allow you to import projects from your repository to your workspace which you can make and upload changes to This procedure describes how to import check out projects from an CVS repository location to your desktop If you have resources on your file system which are already linked to CVS you can access them in Zend Studio by following the instructions under Accessing an Existing CVS Checkout eu To import a project from an CVS repository 1 2 3 Go to File Import CVS Projects from CVS Click Next Select your repository If you have not yet created a repository enter the information required to identify and connect to the repository location Host The host address e g mycomputer com Repository path The path to the repository on the host e g usr local cvsroot User The user name with which you connect to the repository Password The password for the user name Connection Type The authentication protocol for the CVS server If the host uses a custom port enable Use Port and enter the port number Click Next A Select Resource dialog will appear Expand the nodes until you see the required project Select your project and click Finish A Check Out As dialog will appear Select one of the following options Check out as project configured using th
101. or as a New PHP Block at the end of the file Class Name Enter the name for the class If you chose the Create New File option this will also be the name of the file Superclass Click Browse to select a Superclass to extend Interfaces Click Add to select interaces to extend implement Method stubs mark the checkboxes of the method stubs to be created if any from the following options a Constructor Destructor Inherited abstract methods Comments mark the checkboxes of the comments to be created if any from the following options e PHPDpc Blocks e TODOs 3 Click Finish The new class will be created with the required code class MyClassi function construct function _destruct D 195 Zend Studio 7 User Guide Creating a New PHP Interface This procedure demonstrates how to create a new PHP interface using the new PHP Interface wizard vn To create a new PHP interface 1 In PHP Explorer view right click the project file in which you want to create the new interface and select New Interface The New PHP Interface wizard is displayed New PHP Interface PHP Interface Source Folder Create New File Add in existing File MyClass php 1st PHP Block O New PHP Block Which comments would you like to create C Generate PHPDoc Blocks Cal Ces 2 Enter the following details Source Folder If necessary click Browse to change the soruce folder
102. other users of the same repository Importing a library will only import a description of the library in xml format and will not include any of the library s content Before importing a user library you must first have access to an exported user library For more information see Exporting User Libraries w To import a user library 1 Goto Window Preferences PHP PHP Libraries 2 Inthe PHP Libraries Preferences page click Import The Import User Libraries dialog will open 3 To choose where you would like to import your library from fill in the File location text field with the URL or click Browse and select the location 4 Select the libraries you would like to import from the options in the Libraries contained in the selected file box or press Select All or Deselect All 5 To apply changes click OK Your library s description in ml format has now been imported into Zend Studio If the library of the user who imports it is stored in the same location on the disk as the user who exported it Zend Studio will automatically find the libraries content and store it accordingly If the user library is stored in a different place for the two users the Edit button allows you to replace the location URL See Editing PHP User Libraries for more information 364 Tasks Exporting PHP User Libraries This procedure describes how to export user libraries making them accessible to whoever has access to the repository wh
103. question mark 03 display_workers 04 OS echo undefined variable Example If a breakpoint has a condition of var gt 5 the debugging process will stop at the breakpoint only if the value of var is greater than 5 1 Properties for 155 Zend Studio 7 User Guide PHP Include Paths The PHP Include Path is a set of locations that is used for finding resources referenced by include require statements Elements added to a project s Include Path affect the following Running Debugging Profiling Files that are called with a relative path will be searched for during runtime in the resources and order specified in the include path Go to source content assist for include statements Files that are called with a relative path will be searched for according to the resources and order specified in the project s include path Content Assist Adding projects libraries to a project s Include Path will make elements defined within the included projects libraries available as Content Assist options to the project In include require calls file locations can be defined in three ways a Absolute Path The exact file location is specified e g C Documents and Settings MyProject myfolder a php During Remote PHP Script PHP Server or PHP Web Page Running Debugging Profiling when the Local Copy option is selected under the Source Location category in the Advanced tab the Path Mapping mechanism will
104. required element from the list To open a PHP Manual right click in the Editor and click Open PHP Manual or press Shift F2 135 Zend Studio 7 User Guide Real Time Error Detection Zend Studio automatically highlights errors and problems in your PHP script Errors and warnings will be displayed in the Problems view accessed from Window Show View Other General Problems In addition error icons and warning icons willbe displayed in the vertical marker bar to the left of the editor window as well as next to the relevant project in PHP Explorer view these will be indicated in the PHP project file icons e g ef All warnings errors and problems in open projects will be logged in the Problems view which displays the following information Hf Problems 28 1 Tasks El console D PHPunit 7 errors 1 warning 0 infos g l The Problems view groups problems according to Errors Warnings or Info Description A detailed description of the error Resource The name of the resource containing the problem Path The name of the Project containing the resource Location The line number s of the error within the file Type The Type of error occurring Description Resource E Errors 7 items Syntax Error Demo php Syntax Error Demo pbp Syntax Error Demo php Syntax Error unexpected 123 DemozZ php Syntax Error unexpected 23 Demo2 php Syntax Err
105. same files and projects simultaneously and to revert file and project states back to previous versions CVS functionality can be accessed from the CVS Repository Exploring Perspective accessed by going to Window Open Perspective Other CVS Repository Exploring See Working in a Team Environment with CVS in the Workbench User Guide for more information Additional user guides can be accessed from inside Zend Studio by going to Help Help Conients or from the Eclipse Online Documentation site http help eclipse org ganymede index jsp 139 Zend Studio 7 User Guide SVN SVN or Subversion is a Source control system intended to allow a team or group to work on the same files and projects simultaneously and to be able to revert file and project states back to previous versions SVN functionality can be accessed from the SVN Repository Exploring Perspective accessed from Window Open Perspective Other SVN Repository Exploring See the Subversive User Guide for more information on SVN 140 Concepts Zend Framework Development Zend Framework is Zend s open source object oriented web application framework implemented in PHP 5 For information on Zend Framework visit the Zend Framework site at http framework zend com or http framework zend com manual en for the Zend Framework Reference manual Zend Framework Project and Element Creation Zend Studio s Zend Framework integration functions allow you to
106. seeseeseee en 467 Open Method AA 233 Open PHP Element 232 OPEN lee 202 open the source of trace data 202 Open Tvpe sssssseseeesinesinssensssnssensreessressne 233 Organize Includes 67 157 401 Others Time 70 Outline view o oo eeeeececeesteceeeesteeessnateeeeeaes 467 override implement method 417 Override Indicators cccceeeeeteeeeneeees 116 650 OWN TIME aeiee a eie 70 P Parameter aiii el iets aac 517 Parameter Stack view 517 Pa rentheSes cccccesececeesseceeeeeeeeeensenes 106 IS un aaa er a 70 Path Mia e aeaea aaraa a due 350 386 Path Mapping eerie a 145 REI EE 106 performance ISSUE s es 154 perspective Zend Server Code Tracer 199 PHP API Toolkit cccccccseeeeeseeeeeeees 166 PHP Debug Perspective 00saenenensnennea 510 PHP element 229 PHP Elements 668 PHP Evecutable 57 97 PHP Executables Preferences 625 PHP Explorer view 497 PHP Filgi nigros 35 181 182 467 PHP Functions view 532 Welte TE 668 PHP Include Pat 143 PHP Interpreter aaeessrserresrrrrnsrr 97 PHP Interpreter Preierences 627 PHP Manual 120 PHP Manual preterences 631 PHP Preferences annsseseensssennenseeesnna 573 PHP Profile Perspective n 520 PHP tee 35 PHP Project Outline view 499 534 PHP projects JavaScript support 467 PHP Script 70 130 132 135 315 317 PHP Script Local Debugging 00100 132 PHP Script Local Proflmg 135 P
107. sensitive S To apply Task Tags settings to a specific project only 1 Select the link labelled Configure Project Specific Settings 2 Select the required project from the list A Task Tags Properties dialog will appear 3 Select the required settings and click Apply A prompt dialog will appear stating that a rebuild of the project must occur for the settings to take effect 4 Click Yes to rebuild the project Or Click No for a rebuild to be performed only when Zend Studio is restarted Or Click Cancel to cancel the operation 590 Reference Templates Preferences The Templates Preferences page allows you to create edit delete import and export templates Templates are shortcuts used to insert a pre defined framework of code The purpose is to save time and reduce the potential for errors in standard repetitive code units Once a template is inserted you can complete the code quickly using manual and automated code entry methods To insert a template into your code enter the first few letters of its name and press Ctrl Space to activate the Content Assist function and open the content assist list Select the required template from the list Templates are marked with a icon For more on using the content assist function see Working with Content Assist The Templates Preferences page is accessed from Window Preferences PHP Templates Templates wei 7 Create edit or remove templates Name Context
108. that will open by default in Zend Studio It allows you to manage and create PHP projects and files PHP Debug Allows you to manage and track the debugging process CVS SVN Repository Exploring Allows you to manage and view your source control Database Development Allows you to view and manage your database content Zend Studio allows connection with several types of databases PHP Profile Allows you profile and analyze file running times Source Code Repositories Allows you to upload and synchronize files through FTP See PHP Perspectives and Views for more information 24 Getting Started First Steps for Developing Applications with Zend Studio Zend Studio the leading development environment for PHP Web applications maximizes developer productivity by allowing you to develop and maintain code faster resolve application issues quickly and improve team collaboration Backed by Zend and built on top the Eclipse platform Zend Studio offers unmatched reliability and extensibility The following steps will help guide you through the basic process of using Zend Studio to develop and run your PHP applications Install Zend Studio Install Zend Studio by running the Zend Studio executable file and following the instructions in the dialogs Zend Studio 7 0 0 gE Introduction The installer will guide you through the installation of Zend Studio 7 0 0 Click the Next button to proceed to the next screen Ifyou
109. the required source content Create project on a local server Creates the project on a local server This option will only be available if a local Zend Server has been configured in the PHP Servers Preferences page PHP Version Select whether to use the default PHP version settings or unmark the Enable project specific settings checkbox to configure the PHP version used for this project See PHP Interpreter Preferences for more information Use default PHP settings Uses the default PHP Interpreter settings Use project specific settings Select the PHP version to be used for the project and whether ASP tags are used as PHP tags See PHP Version Support for more information Project Layout Select whether to Use project as source folder All resources within the project will be added to the Build Path by default Create separate folders for source files and public resources Separate folders will be created in which you can place resources which should be included or excluded from the Build Path See Configuring a Project s PHP Build Path for more information The default setting for this option can be configured from the New Project Layout Preferences page JavaScript Support Mark the Enable JavaScript support for this project checkbox for JavaScript functionality e g JavaScript Content Assist options to be available to the project See Enabling JavaScript Support in PHP Projects for more information 7 Click Ne
110. the code element its value africa and all other information available lt php define siet ekhddhd gt Location Tip of the Day newfile php Value africa Press F2 For focus 53 Zend Studio 7 User Guide Class Type Hints By using a comment you can assign a variable its exact class value This assignment will affect the content assist of this variable accordingly To see and trial this feature Create a new PHP file with the following code lt php function getClass return new Test Class rest function printValues Sa Sb echo Values Sa Sb f var omy EE SmyVar getClass SmyVar gt EE Place your cursor after myVar gt on the line above the closing PHP tag and press Ctrl Space to activate Content Assist Content Assist will open with the function defined in Test class printValues a b Double click it to enter it into your code Without the comment Content Assist will not be available for the function Configuring Content Assist Content Assist options can be configured through the Content Assist Preferences page accessible from Window Preferences PHP Editor Content Assist 54 Getting Started Working with CVS The purpose of this tutorial is to teach you how to work with the CVS source control system You will learn how to configure your CVS repository upload projects and files to it check out import projects an
111. the default layout for new PHP projects The default layout will configure whether all folders under the project root will be considered as source folders for the Build process or whether separate folders will be created for resources which are included or excluded from the Build process The preferences configured in the New Project Layout Preferences page will affect the default option selected in the Project Layout category of the New PHP Project wizard This setting can be modified per project during creation PHP Project New PHP Project Create a PHP Project Project name Contents Create new project in workspace O Create project from existing source PHP Version Use defauk PHP settings C Use project specific settings Project Layout Use project as source folder C Create separate folders for source fles and public resources 598 Reference The New Project Layout Preferences page is accessed from Window Preferences PHP New Project Layout Preferences New Project Layout Pr v Select the default project layout for new PHP projects this will affect the resources that are scanned during the build process Source and public folder Ouse project as source Folder Create separate folders For source files and public resources Default source Folder name application Default public Folder name public Restore Defaults Apply TS To configure the default New PHP Pr
112. the repository location Host The host address e g mycomputer com Repository path The path to the repository on the host e g usr local cvsroot User The user name with which you connect to the repository Password The password for the user name Connection Type The authentication protocol for the CVS server There are four connection methods i pserver a CVS specific connection method ii extssh an SSH 2 0 client iii pserverssh2 provides a pserver connection over ssh2 iv ext the CVS ext connection method which uses an external tool such as SSH to connect to the repository e If the host uses a custom port enable Use Port and enter the port number 4 Click Finish to create your connection Your repository will be displayed in the CVS Repositories view Sharing Projects Through CVS projects can be shared and worked on by numerous team members w This procedure demonstrates how to upload a project you have created so that other users can work on it 1 Create a new PHP project called MyCVS Project 2 Within the project create a PHP file called CVSFile1 with the following code lt php This is a new file ZS 3 In PHP Explorer View right click your project and select Team Share Project A Share Project dialog will open From the repository list select CVS and click Next Select Use existing repository location and select your CVS repository from the list Click Next In the Module Nam
113. the required Zend Framework library in your project and give you access to the relevant content assist options 4 Select the Project Layout from the following options Zend Framework empty project Creates a regular PHP project structure Zend Framework default project structure Creates a project organized according to Zend Tool conventions Full featured Zend Framework and Dojo project Select this option if you are going to be developing using the JavaScript Dojo framework in this project This will create a link to the external Dojo toolkit library See Setting Up and Using Dojo Integration for more information 5 Click Finish Your Zend Framework Project will be created It will be represented by a Zend Framework icon za in PHP Explorer view 6 Click Yes when prompted to open the Zend Framework perspective Your Zend Framework project will be displayed in the MVC Outline view To open the MVC Outline view manually go to Window Show View PHP Tools MVC Outline GE Outline PHP Proj O a Ee ZF Project a gt application d Ei default E L controllers amp Je Error controller php E P IndexController php P Zend Controller Action php E Indexcontraller S models H SS views The MVC view provides an outline of all controller model and view classes files variables and related functions You can now start to add your own Model View and Controller files See Creating Zend Framewo
114. type will be displayed in the Type Hierarchy view figs gr Cl 236 Tasks Creating PHP Working Sets PHP Working Sets can be created from a variety of locations where working sets can be selected This procedure describes how to create PHP Working Sets from the Window Menu in the PHP Perspective y To create a PHP Working Set 1 In the PHP Explorer view click the View Menu arrow Si The PHP Explorer menu options will open Select Select Working Gei The Select Working Sets dialog will open e Se lect Working REES Select a working set Window working Sets C No Working Sets O Selected Working Sets 2 Click New The New Working Set dialog will open 3 Select PHP and click Next The New PHP Working Set dialog will appear Enter a name for the Working Set Mark the checkbox next to the projects files folders to be included in the Working Set 237 Zend Studio 7 User Guide New Working Set PHP Working Set Enter a working set name and select the working set elements L amadas man Ta 6 Click Finish Your new PHP Working Set will be added to the Select Working Sets dialog and will be available for selection for Working Sets actions 238 Tasks Using Mark Occurrences The Mark Occurrences feature allows you to see where a variable method or type is referenced within the active PHP file To use Mark Occurrences 1 Enable the Mark Occurrences feature by cli
115. use of the Front Controller pattern You must therefore rewrite all incoming requests except those for static resources which your application need not handle to a single script that will initialize the FrontController and route the request If you re using mod_rewrite for the Apache web server create the file public htaccess with the following contents public htaccess RewriteEngine On RewriteCond REQUEST_FILENAME s OR RewriteCond REQUEST_FILENAME 1 OR RewriteCond REQUEST_FILENAME d RewriteRule NC L RewriteRule z index php NC L Some web servers may ignore htaccess files unless otherwise configured Make sure that your web server is configured to read the htaccess file in your public directory 4 Restart your Web server from the command line windows user can use the Apache Monitor tool Once you copy your Zend Framework project files to the server you will be able to run and debug the project as you would a normal PHP project 276 Tasks Where is My Apache Configuration File Apache uses a main configuration file for all its settings typically this file is called httpd conf or apache2 conf The location of this file varies depending on your installation Windows e lt install_dir gt Apache2 2 conf httpd conf e f you changed the location of your Zend Server installation your document root will be located at lt installation_directory gt Apache2 2 conf
116. will open with a number of views detailing information about the debugging process See the Running and Analyzing Debugger results topic for more information on the outcome of a debugging process 326 Tasks This procedure describes how to debug using the Zend Browser Toolbar In order to enable Zend Studio to debug files located on the server remote debugging needs to be configured See Setting Up Remote Debugging for more details S To debug using the Zend Browser Toolbar 1 Ensure the Zend Browser Toolbar is installed on your browser If you have not yet installed the Zend Browser Toolbar see Installing and Configuring the Zend Browser Toolbar for more information Open your browser and browse to the page from which you would like to start debugging Ensure Zend Studio is open You can open it by clicking the Zend Studio button je Zend in the toolbar Click the Bro button on the Zend Browser Toolbar to debug the page currently displayed in the browser To do this the page is reloaded and instructions are automatically transmitted to the server for the execution to be done in debug mode This means that if the POST data has been transmitted to the current page the browser will ask if the user wishes to post them again before executing the page in debug mode In the same way if the page uses frames including hidden ones the toolbar will request which frame the user wants to debug Or select one of the follo
117. within the PHP manuals and can be used in order to easily add these functions into your scripts To add a function to your code simply place the cursor in the required position in the Editor and double click the required element from the list L BE outl 83 PHP 18 Demo php 53 1 lt php append Iterator it ba 2 o Preme a 3 getArrayIterator ges gone stats P 3 o getIteratorIndext Se nevkii You can open a PHP manual site with an explanation about most of the functions on the list by right clicking a function in PHP Functions view and selecting Open Manual A new browser window will open with an explanation of the function from the PHP Manual site Arayiterator ken Z M Prev PHP Manual Next Arraylterator key no version information might be only m CVS nateost nedi Arraylterator key Return current array key cilsetE xists index Sindex Steal anday tindas Mia Description E A eeee e ee e Some functions will not have a description assigned to them in the PHP Manual site In this case a browser will open with a Cannot find server error message PHP Manual sites can be added and edited from the PHP Manual Preferences page 134 Concepts In addition The PHP Functions view can be used in order to easily add functions into your scripts To add a function to your code simply place the cursor in the required position in the Editor and double click the
118. you create view and manage your connections to remote systems such as FTP and SFTP AF Remote Systems amp 3 Kat 4 Si e ZS 7 EP Local al z Fy LOCALHOST om y 10 1 2 241 ig MyConnection h Files E My Home ea ob amp db amp file types H O Beg JB acnadi nbo Remote Systems view Toolbar Commands ere ee Define a Opens the New Connection dialog connection to remote system Refresh Refreshes the connection information of selected information of resources selected resource amp Back Forward Scrolls backwards and forwards through your projects Navigates up one level C E ollapse All Collapses the list of elements Link with Editor H selected files will immediately be displayed in the editor when selected If unselected files will be displayed in the editor when they are double clicked 483 Zend Studio 7 User Guide Remote Systems View Menu Commands The Remote Systems view menu can be accessed through the view menu icon x E E Opens the New Connection dialog Work with Profiles Opens the Team profile view See Remote System Explorer Profiles in the RSE User Guide for more information Additional user guides can be accessed from inside Zend Studio by going to Help Help Contents or from the Eclipse Online Documentation site http help eclipse org ganymede index jsp Refresh All Refreshes all connections Quality Connection Names Displays the connection
119. you have previously checked out from SVN This means you do not have to check out resources again to a new location in order to have access to Zend Studio s functionality w To access previously checked out projects 1 Launch the New PHP Project Wizard by going to File New PHP Project or right clicking in PHP Explorer view and selecting New PHP Project The New PHP Project wizard will open In the Project contents category unmark the Use default checkbox and browse to the location of your checked out SVN resources PHP Project New PHP Project Create a PHP project Project name SVNProjectt Project contents C Use defauk Directory C MySVNProjectLocation Click Finish A new PHP Project will be created with the contents of the project you had checked out In PHP Explorer View right click your project and select Team Share Project A Share Project dialog will open From the repository list select SVN and click Next If you have not yet configured an SVN repository you will need to enter your SVN 261 Zend Studio 7 User Guide repository details See Configuring an SVN Connection for more information If you have already configured an SVN connection mark the Use existing repository location option and select your repository from the list Click Finish Depending on your authentication settings a dialog might appear asking you to provide authentication information Enter your pas
120. your files Profiling URLs Debug applications on your server by entering a URL Toolbar Profiling Debug files and applications directly from your browser Profiling PHP Scripts Files can be profiled using either Zend Studio s internal debugger or your external remote server Use the remote profiling function if you want to test the execution of the file on your server s environment This is especially relevant if your server s loaded extensions are different to Zend Studio s internal server Your server must be running the Zend Debugger or XDebug in order for remote debugging and profiling capabilities to function The Zend Debugger comes bundled with Zend Server Zend Core and Zend Platform but can also be downloaded as a separate component from http www zend com en products studio downloads 84 Getting Started The following procedure demonsirates how to profile a PHP Script either locally or remotely 1 Create a file called Person and copy paste the example code into it See the Working with the Profiler Tutorial in Zend Studios Online Help for the example code 2 Create a second file called tryPerson and copy paste the example code into it See the Working with the Profiler Tutorial in Zend Studio s Online Help for the example code 3 Save both files 4 Click the arrow next to the Profile button dp on the toolbar and select Profile Configurations or from the main menu go to Run Profi
121. 367 Zend Studio 7 User Guide Removing a PHP Library or Library Folder This procedure describes how to remove a user library or library folder from Zend Studio Removing a user library or library folder means that its contents will no longer be available in Zend Studio including in it s functionality such as Content Assist and Refactoring Important Note If your PHP user library or library folder is associated with specific projects removing it will delete it from the projects as well S To remove a PHP library library folder 1 Go to Window Preferences PHP PHP Libraries 2 Inthe PHP Libraries Preferences page select the user library or library folder to remove and click Remove Removing a user library will remove all of the folders within it as well Your user library or library folder is deleted 3 To apply changes click OK Your user library or library folder has been removed If you would like to import a library see Importing PHP User Libraries To add a folder to an existing library see Adding External Folders to PHP Libraries 368 Tasks Configuring a Project s PHP Include Path Adding external resources to a project s include path makes resources outside the project available for operations such as debugging refactoring and content assist See PHP Include Paths for more information This procedure describes how to configure your project s Include Path d To configure your project s Include Path
122. 4 Getting Started Checking Out Projects from SVN Once projects are placed on the SVN repository they can be checked out imported by anyone with access to that repository S The following steps demonstrate how to check out import projects from SVN into your workspace 1 Delete the MySVN project from from your workspace in order to simulate being a new user who has not previously had access to this file Note Deleting the project from your workspace will not delete it from SVN 2 Go to File Menu and select Import Projects from SVN 3 Click Next 4 Select your repository 5 Click Next 6 A Select Resource dialog will appear Expand the nodes until you see your project by default this will have been placed under Trunk 7 Select your project and click Finish A Check Out As dialog will appear Leave the Check out as a project with the name specified option marked and click Finish The project will now be imported into your workspace Note that the project will have an SVN repository icon Ef in your PHP explorer view Now that you have imported a project from SVN into your workspace you can add files edit existing files and commit your changes to the SVN repository See below Adding Files to Existing Projects You can add files to existing projects in the SVN repository and commit them so that other users can access them w The following steps demonstrate how to add and commit a file into
123. 426 Incorporating W SDE Files E 427 Viewing RSS EE 429 Working with Remote Seet iisccieceteceeint cteaghs teens ssecuegete seed bhatt E Eanan Aaa a AREE aari a NEEN ESS 430 Working with Remote Gerver 430 Creating a Connection via the Server View 431 Creating a New Remote PDrolect A 433 Downloading a Project from an Existing Connection 436 Sharing a Local Project to a Connecton tenets cae eeeaaeeeeaeeseaeeesaeeeeaeeeeneeees 437 Synchronizing a Local Project to a Connechon 438 Beef e EE padeda anaa dap aidd cnr alarida aavan nia Tania 439 Download from a Server c cccccceesceceeeeeeeaeeeeeaeeeeeeeceaeeeeaaeseeneeseaeeesaaeseeaaeseeeeeseaeseeaaeseeneeee 439 xi Zend Studio 7 User Guide Downloading Selected Files from a Folder cccccceceeeeeeeeeceeeeeceeeeeeaaeeeeeeeseaeeeseaeessaeeeenees 440 Uploading Resources to Your Server cccccceeeceeeeeeeeeeeeeeaeeceeeeeceaeeeeeaeeseaeeseaeeesaeeeeaeeneeeeees 441 Uploading a Project to a Remote Gerver 441 lte ei le Leg LEET 442 Working with Mylyn Integration eeeccceeeeeneceeeeeneeeeeeaeeeee eases eeeaaeeeeeeaeeeeesaeeeeeeaeeeensnaeeeeneed 443 Task ListiPresentatlon s joie tivities a a Ate a A 443 Icon Legend and Color Coding cccccccccceeeeeeceeeeceeeeeeaeeeeeeeceeeeseaeeseaeeseeeeeseaeeesaeeseneeee 443 Creating ENEE 443 Local TASKS orana is Z ee T E deed 444 Repository EE 445 EA E E eene be hee Se bes 445 SE 446 ee 446 NEI EEN 446 Fask Foc
124. A Server Setup Adminstration Dashboard Events Server into PHP into Logs Pag troteshed 17 Jun 2009 1555 ge 11 Slow Request Execution Absolute urt 2009 15 oO Occurred once at 47 Jun 2009 15 48 Status Open Severity Wam URL NSp MocalnostZencServerProfling c to 1_ conver moe EARCH Request Server Export i tia Y GET W array degrees gt 10 conversion gt ert gt POST empty l0SdebuggesFsesent gt php phtal phes Zend Studio Diagnostics Dedug Event Profile Event Settings 11 Click Profile Event A profiling session is launched in Zend Studio using the same parameters as were used during the slow request execution If no session is launched see Setting Up Zend Server Integration to ensure you have correctly configured your integration settings in both Zend Studio and Zend Server 12 Click Yes if asked to open the PHP Profile perspective The Profiling views will display information regarding the request 13 Explore the Profiling Execution Flow to detect the execution bottle neck You should see that the execution of r myFunction r took most of the time Getting Started Eg Profiler Information lf Execution Fle wei Ca Code Coverage Summary File Total Execution Time Duration Time ms myFunction convertCTF e printMessage D hitp Pocalhost 80 zendserverProfinaic totconvertiphp A http ocaho
125. And now i have made 2 gt ZC A 3 Click the next previous difference buttons to scroll between the differences Tasks Replacing Files This procedure describes how to replace a current file with a previous version from the Local History S To revert a file to one of it s previous states i 2 3 4 Right click the file in PHP Explorer view and select Replace With Local History The Compare dialog will be displayed with a list of the previous versions of the file according to when they were last saved Double click a previous version to view it in the Text Compare pane Once you have found the required version click Replace The current working file will be replaced by the chosen local history file To replace a file with the last saved file right click anywhere in the editor and select Replace With Previous From Local History Restoring Deleted Files This procedure describes how to restore a file that has been deleted S To restore a deleted file 1 In PHP Explorer view right click the project which previously contained the file and select Restore From Local History A Restore From Local History dialog will be displayed containing a list of all files that have been deleted from the folder Select the required file to view its revisions Select the required revision and click Restore The file will be restored into the selected folder 247 Zend Studio 7 User Guide Using C
126. Apply and OK In the main toolbar click Go gt to start the Debugger or from the Menu Bar select Debug Go See Locally Debugging a PHP Script for more information 35 Zend Studio 7 User Guide To debug a PHP script using your server debugger Zend Studio 5 x Zend Studio 7 x Open the Preferences window by selecting Tools Preferences from the main menu Select the Debug tab From the Debug Server Configuration area of the Debug tab select server from the Debug Mode category Enter the URL of the server on which you want to Debug your files Click Apply and OK In Zend Studio s main toolbar click Run gt to start the Debugger Click the arrow next to the debug button El on the toolbar and select Debug Configurations or In PHP Explorer view right click and select Debug as Debug Configurations A Debug dialog will open Double click the PHP Script option to create a new debug configuration and enter a name for it Select the PHP Web Server option under the Debugger Location category and select your server from the list Under PHP File click Browse and select your file Click Apply and then Debug The next time you want to run this debug session click the arrow next to the debug button ll on the toolbar and select your launch configuration See Remotely Debugging a PHP Script for more information 36 To debug applications on a server Zend Studio 5 x From th
127. Coverage view displaying the code with the lines of code that were run highlighted in blue 7 Once you have corrected errors you can re run the PHPUnit Test by clicking the Run Last Test button K in the PHPUnit view until all tests pass successfully 387 Zend Studio 7 User Guide Reporting on PHPUnit Test Results Once you have run a PHPUnit Test Case Suite you can quickly and easily create a report to view the results of your test w i To generate a report 1 Runa PHPUnit Test Case Suite See Running a PHPUnit Test Case or Running a PHPUnit Test Suite for more information 2 Inthe PHPUnit view click the arrow next to the Report Generator icon on the view s toolbar to select a report type or click the Report Generator icon itself to generate the last generated report See PHPUnit Testing for more on the different types of reports a G E Open Original XML E Generate with plain xsl ES Generate with packages xsl Generate with XSL 3 A report will be automatically generated and opened in a browser window 388 Tasks Unit Test Results Designed for use with PHPUnit and Zend Studio Summary 75 00 0 066 Note failures are E and checked for with assertions while errors are unanticipated Overview Name Tests Failures Errors Time s CalculatorTest 4 1 0 0 066 TestCase CalculatorTest testAdd 0 012 testDivide Failure PHPUnit Diego zeenee ailedException Fail
128. Debugger Go to the Installed Debuggers preferences page to configure Zend Debugger settings Server Choose which server the debugger will use by default Click the PHP Servers category to be taken to the PHP Servers management page For more on this see PHP Servers PHP Executable Choose the required default PHP version Click the PHP Executables category to be taken to the PHP Executables management page For more on this see PHP Executables Encoding Settings Debug Transfer Encoding Select the required debug transfer encoding from the drop down list Debug Output Encoding Select the required debug output encoding from the drop down list Break at First Line Mark this checkbox to force the debugging process to stop at the first line of code by default Further PHP encoding options can be accessed from the preferences menu under General Content Types Text PHP Content Type vi 572 To apply Debug Preferences settings to a specific project only 1 Select the link labelled Configure Project Specific Settings 2 Select the required project from the list A Debug Preferences Properties dialog will appear 3 Select the required settings and click Apply A prompt dialog will appear stating that a rebuild of the project must occur for the settings to take effect 5 Click Yes to rebuild the project Click No for a rebuild to be performed only when Zend Studio is restarted Click Cancel to cancel the ope
129. Description Auto Insert A New F author PHPDoc add the user as author on brdes PHP Birt report design on V brdeseh PHP Birt report design with error handing on V brdoc PHP Birt report document on V brdoceh PHP Birt report document with error handling on cn PHP Clone an object on cls PHP class statement on eco PHP echo a string on elif PHP ee statement on els PHP else statement on fnec PHP function statement on fore PHP foreach stabement on forek PHP foreach with key statement on F my_fo PHP mysql_fetch_object loop on Lal me br PHP mysql_fetch_rove loop on Jl my ae PHP Trap code output on m Preview Use code formatter To remove a template from the list of available options unmark its checkbox in the list To edit an existing template select it from the list and click Edit 591 Zend Studio 7 User Guide Creating a new Template This procedure describes how to create a new template to be added to the template list TS To create a new template 1 Click New 2 The New Template dialog will open ew Template Name B p Context PHP Description Pattern Insert Variable 3 Enter the template s details Name A short name to identify the template e g while for a template for a while loop Context The code context when the template will be available PHP PHPDoc New PHP BIRT or Zend Framework e g PHP templates will only be available for use when writ
130. File containing errors Library Source Folder included in the Build Path Folder excluded from the Build Path PHP Class public PHP Class default Only displayed in Content Assist list PHP Interface PHP Method PHP keyword only displayed in Content Assist list PHP Function Method public PHP Function private PHP Function protected PHP Variable public PHP Variable private PHP Variable protected Static Constructor PHP Constructor Constant Abstract Member Final Member Template only displayed in Content Assist list Unknown Type only displayed in Content Assist list Namespace 639 Zend Studio 7 User Guide Zend Framework Elements Icon Zend Framework Element li Ia Zend Framework project qi Zend Controller displayed in MVC Outline view a Zend Model displayed in MVC Outline view e Zend View displayed in MVC Outline view Other Icons Icon PHP Element Ch PHP project connected to a repository e g CVS SVN 640 Keymap The following table displays a list of commonly used keyboard shortcuts which can be printed for quick access Reference To see a full list of shortcuts and to configure the keymap go to Window Preferences General Keys To bring up a list of commonly used commands press Cirl Shift L in the Editor Show Key Assist CA v w VK 3 D Vi Execution Action Add Block Comment Toggle Comment Generate Element Comm
131. Fix option enables you to easily change your problematic code according to suggestions supplied by the Semantic Analysis mechanism This includes suggested actions for element creation or implementation Example 1 lt abstract class A abstract function foo j class 5 extends A Add unimplemented methods 1 Neu to implement Make type B abstract E IH Rename in workspace Alt Shift R direct acce lt See Applying Quick Fixes for more information Preferences To enable disable Semantic Analysis and to configure which occurrences will trigger warning or error messages go to the Semantic Analysis Preferences page accessible by going to Window Preferences PHP Semantic Analysis 137 Zend Studio 7 User Guide Local History A Local History of a file is maintained when you create or modify and save a file Each time you edit and save a new version of a file a copy of it is saved in local history Each state in the local history is identified by the date and time the file was saved This allows you to compare your current file state to a previous state replace the file with a previous state or restore a file that was deleted There is no Local History associated with Projects or with Folders See the Using Local History topic for more information 138 Concepts CVS A Concurrent Versions System CVS repository is a source control system intended to allow a team or group to work on the
132. HP Script Remote Debugging 132 PHP Script Remote Profiling 135 Nd el e le eluent 57 PHP Servers Preferences n 633 PHP version 97 PHP Web Page 57 130 132 319 PHP Web Page Debugging eeeesseeese 132 PHP Web Page Profiling seeee 135 PHP HTML WWW 422 PHP BEE 419 phpDoc Block Comments 112 PHPDoc Comment 244 phpDoc comments 112 PNPDOC Tags 112 PHPDocBlock ssssssssssssssssnsesssrernnnssserrnns 242 PHPDocBlock comment 242 PIP Ber 160 PHPDOCUMENT1 ccceeeeeseteeeeeeeeeetees 182 Phpocumentor 160 PHPUnit Preferences ccce 638 PHPUnit Reporting seenen 155 PHP UIt TeStii nkveri ieee 155 PHPUnit Test Case 77 155 PHPUnit Test Reports i e 77 PHPUnit Test Gute 77 155 PHPUNI VIEW srai iniae atnan 77 W EE 433 Platform Integration ceeeeeeeeeeeeee 354 Platform Geer 433 DUGE tuea dee 96 Ell GET 149 636 POM e EEN 636 port manage cece eee eee ee seen teen tees 636 preferences Iracer 636 problemS ssssssssenessessnnnneneseeeennnneee 122 123 Problems view ccceceeeeeeeesenteeeeeeeees 122 EU 135 Profile Perspective 520 Wl te UE 70 Profiler Information 2 eeeeeeeeeeeeees 70 Profiler Information View 522 ProRes aae 135 Profiling Monitor view 521 Profiling Perspective ccceeeesteeeeeenees 70 Profiling PHP Des 70 Profiling PHP Gett 70 te 467 Prototype JavaScript Uibranm 467 Q QUCK YS
133. HP Servers Tracer ine d mm dra ES Restore Defaults Apply E a E Editing the Tracer Listener Settings This procedure describes how to change the port the Code Tracing functionality will use By default Zend Studio will find the first available port Important Note The ports in the Tracer preferences should only be changed if the default port is blocked or in use by another application 610 Reference S To edit the tracer listening port 1 Go to Window Preferences PHP PHP Servers Tracer The Tracer preferences page opens with the Use a random port option selected by default The random port that has been selected is expressed in the Use a user specified port text field 2 Select the Use a user specified port option and enter the port number in the text field 3 Click OK to save the changes The Tracer listening port has been changed If you would like Zend Studio to revert back to a default port select the Use a random port option To revert back to the original port that was used click Restore Defaults 611 Zend Studio 7 User Guide PHPUnit Preferences The PHPUnit Preferences page allows you to see your PHPUnit Library Path and set the PHPUnit s communication port PHP Unit tests are a way of constantly testing your code to ensure the right output is being generated each time For more on PHP Unit Testing see the PHPUnit Testing Tutorial The PHPUnit Preferences page i
134. HP Web Server PHP Servers Enter a name for the new configuration Select the PHP Web Server option under the Debugger Location category Select your server from the list 310 Tasks If you have not yet configured your server click the underlined PHP Servers shortcut The Servers preferences page will open Configure your server by following the instructions on adding a new server under the PHP Servers Preferences page For more information on configuring the communication between Zend Studio and your remote server see Setting Up Remote Debugging Under the PHP File category click Browse and select your file If necessary you can add arguments in the PHP Script Arguments tab to simulate command line inputs 10 Click Apply and then Run Your script will be run and displayed in a browser If the file contains include or require calls to files which are not contained within the project you must add them to the project s Include Path in order to simulate your production environment In addition if a file defined with an absolute path to a server location See Include Paths for more on absolute file locations is called a Path Mapping dialog will appear See Path Mapping for more information 311 Zend Studio 7 User Guide Running PHP Web Pages This procedure describes how to run whole applications projects files or collections of files that are on the server Using this process you can run eit
135. HP button to apply your settings 219 Zend Studio 7 User Guide 220 6 Browse to the Server Setup Monitor tab Rute Management hh Server Setup db Monitor Components Extensions Directives Debugger Monitor Zend Studio Client Settings A Administration Zend Studio IP address Zend Studio debug port 10137 oO Encrypt communication using SSL Save Mail Server Settings SMTP server address SMTP server port Senders email address Administration interlace URL http Wu Use Browser IP Address gt Restart PHF VA 7 Configure the following settings under the Zend Studio Client Settings category Zend Studio IP address Enter the IP address of the machine on which your Zend Studio is installed or mark the Use Browser IP address to use the IP address of the machine on which the Zend Server UI is running Zend Studio Debug Port This should match the debug port configured for the Zend Debugger in Zend Studio s Installed Debugger Preferences page Window Preferences PHP Debug Installed Debuggers page The default port number is 10137 Encrypt communication using SSL mark this checkbox for the communication between Zend Studio and Zend Server to be encrypted using SSL 8 Click the Restart PHP button to apply your settings Tasks Configuring Studio Communication Settings in Zend Server In order for you to be able to view debug and profile Zend Server Events in Zend Studio you mu
136. IT ln 54 Configuring Content Assist cccccceeeeeeeeeeeceeeeeceaeeeeaaeeeeneeseeeeecaaeeesaaeseeeeeseaeeesiaeeeeeeeeenees 54 WY Orig WIT VS EE 55 Ile 55 Adding a CVS Repository prosei nas aa ai aa a a aa a a a EaR iaa aati 56 Step E tele ege eege a Ee E a A 57 Checking Out Projects from CNS 58 Adding Files to Existing Projects eccceeecseeeeeeeneeeeeeeaeeeeeeaaeeeeeeaaeeeseeaaeeeeeeaaeeeeeeaeeeeseaaes 59 Making Changes Comparing Changes and Committing Changes 60 Replacing Files with Older Version 61 Deleting Files from CVS v2 sewn evel nl ain deen eit 62 Working With SVN EE 63 Neie ise Fein eee A a en ee i ee EE E 63 Adding an SVN Repository ezccccieiece attic es Eegeregie gege D eg E Leeder Eet 63 SHAING Gite 64 Checking Out Projects from SVN A 65 Adding Files to Existing Projects eccscccccecceccuscccetivesecedesveccehectve ERER E ANNEER 65 Making Changes Comparing Changes and Committing Changes 66 Replacing Files with Older Version 68 Deleting Files from SVN EE 69 Workiniguwith the DeDUQQEN EE 70 Purpose ne USA TE 70 Debugging Local PHP Files PHP Gett 71 Debugging PHP Applications PHP Web Pages 78 Working with Refactoring c cccccceeesenceeeeeeeeeeeeeeeeeeeeeaeeeeeeaeeseseeaeeeseeaaeeeseeaaeeeseeeneeeseeeneeeees 81 Purpose and MET Le CEET EN Renaming Moving Fles 0 cceceeeeseeeeeeeneee seen ee eeea aces ee eaaeeeeeeaaeeeeeeaaeeeeeeaaeeeeeeaeeeeeenaeeeeneaa 82 Renaming Elem
137. Iterators The PHP Functions view can be used in order to easily add functions into your scripts To add a function to your code simply place the cursor in the required position in the Editor and double click the required element from the list S constants C __PHP_Incomplete_Class constructi append lterator iterator current getArraylterator getlnnerlterator getlteratorndex Right clicking a function in PHP Functions view and selecting Open Manual will open an online version of the PHP manual with an explanation about most of the functions on the list A new browser window will open with an explanation of the function from the PHP Manual Arayitetator key 3 bh PHP Manual Prev Next o v DI e Arraylterator key bi A no version information might be only in CVS 8 Arraylterator key Return current array key cffsetE netsiindex ridex e e Steal atferdey Bechet Mia Description j 511 Zend Studio 7 User Guide If the browser opens with a Cannot find server error message it means the function does not have a description assigned to it in the PHP Manual Sites for viewing the PHP Manual can be added and edited from the PHP Manual Preferences page PHP Functions View Toolbar commands Description type fiter text filter text Filter Text box Allows you to find a particular function Start typing the function name Relevant results will be displayed below it PHP Functi
138. N Hepoesitonm 50 Allowed Host 347 AIA A E E AE 199 amf fleiniad adaini 199 ANAly Ze senisesse 123 Appearance Drelerences cee 574 Auto Detection Port 222 353 Average Own Time 70 B Bookmarks 113 Bookmarks view 113 bottlenecks AA 70 Boundry Maker AA 105 bracket E E S 107 Drackere reiniciar anii 106 Dreakpoinmt 141 breakpoints ccceeeeeeeeeeees 57 132 515 Breakpoints view 515 Browser Toolbar seeen 148 Build Path 144 Build Path JavaScript ceceeeeees 467 C Called Parameters cccccceeseeeeeeee 517 Calls Count ceceeeeceeeeeeeseeeeeeeeeeeeeeeaees 70 Check Out 252 Checking Out Projects 000seeseeeee 42 50 Class Type Hmts 37 Code Analyzer asesseeseeeseeeeeeeee neee 123 Code Aeelsi 37 100 223 Code Assist Dreierences 603 Code Coverage Preterences 576 Code Coverage Summary sses 70 Code Coverage Summary View 527 code elements asssesssessrrnseerreerrrnseen 223 Code Foldimg 110 227 Code Gallery 162 423 424 425 428 Code Gallery preferences s nssse1e 578 Code snippet 162 423 424 425 428 code tracing cceeeeeeeeeeeeeeeeeeeeees 154 198 code tracing integrate ee eeeeeeeee 154 code tracing Zend Server s 154 ee e E 105 COMMING E 242 Commentinmg ereere reenn 111 Commenting Code 111 Comments 111 communication Dot 149 Communication Gettngs 149 communication Tunnel 222 353
139. New name RenFile php Update references Enter the file s new name Check the Update references box and click Preview A preview window will open with a change tree showing all the changes which will be made to reflect the rename of the file sorted according to the files in which the changes will be made 1 Rename File __ Refactored Source 1 lt 2 require RenFilel php gt 2 require RenFile php 34a Si 53 Ze 8 d s 42 gt 391 392 Zend Studio 7 User Guide Note that if the file has been referenced required included etc in other files the name of the file will also be updated in those instances You can scroll through the different changes using the Select Next Previous Change scrolling arrows oF 5 lf you are satisfied with the changes press OK The file will be renamed and all instances where that file is referenced will be updated to reflect the change Tasks Renaming Elements This procedure describes how to rename a PHP element and ensure that all references to that element are updated All PHP elements can be renamed and refactored from PHP Explorer view The following is a list of applicable PHP elements Classes Interfaces Variables Methods Functions Constants Class Members Ensure that you save any changes to the file before applying the refactoring feature Elements can either be renamed from within the editor itself if t
140. Nothing echo Too lazy In ob GA interface facingd job function doSomething CH LO 0 A O class ITperson extends Person implements facingAjob O ZE function doSomething L3 echo Oh nooo acn Mi L4 5 function doNothing Smanager new Person t E Sdeveloper new ITperson iz Occurrences can be of 2 types Write Occurrence for occurrences that are in a write mode or Read Occurrence for occurrences that are in a read mode These will be highlighted in different colors according to the setting configured for PHP elements read and write occurrences in the Annotations preferences page Window Preferences General Editors Text Editors Preferences Here you can also configure the indicators used in the vertical ruler marker bar to the left of the editor and the annnotations bar to the right of the editor The types of elements whose occurrences will be highlighted can be configured in the Mark Occurrences preferences page Window Preferences PHP Editor Mark Occurrences 123 Zend Studio 7 User Guide By default the following types of elements are marked Method Exit Exit points throws return end of flow of a method will be marked Break Continue Scope for foreach while do while or switch structure of a break continue statement will be marked Local variables Global variables Parameters Functions Methods Fields
141. Overwrites Select whether choosing an item from the Content Assist list will cause new code to be entered or existing Insert single proposals automatically If enabled the content assist suggestion will be inserted automatically when only one content assist option Insert common prefixes automatically If enabled Content Assist will 463 Zend Studio 7 User Guide automatically insert the common prefix of all possible completions similar to Unix shell expansion This can be used repeatedly even while the Content Assist window is being displayed Fill argument names on completion If enabled Content Assist will add arguments when completing a method Guess filled function arguments If enabled Content Assist will fill the arguments with the best matching function according to the context Sorting and Filtering Sort proposals Select how the proposals should be sorted in the Content Assist list Hide proposals not visible in the invocation context If enabled the Java element proposals are limited by the rules of visibility For example private field proposals of other classes would not be displayed Show camel case matches If enabled camel case matches are displayed e g NPE is expanded to NullPointerException Hide forbidden references If enabled references to JavaScript elements forbidden by access rules are not displayed Hide discouraged references If enabled references to JavaScript elements discourage
142. PHP Script Arguments tab to simulate command line inputs 11 Click Apply and then Debug 12 Click Yes if asked whether to open the PHP Debug Perspective A number of views will open with relevant debug information See the Running and Analyzing Debugger results topic for more information on the outcome of a debugging process If the file contains include or require calls to files which are not contained within the project you must add them to the project s Include Path in order to simulate your production environment 320 Tasks Remotely Debugging a PHP Script This procedure describes how to debug files in your workspace remotely using your server s Zend Debugger Use this function if you want to test the execution of the file in real time on the production server This is especially relevant if your server has loaded extensions Your server must be running the Zend Debugger or XDebug in order for remote debugging and profiling capabilities to function The Zend Debugger comes bundled with Zend Server Zend Core and Zend Platform but can also be downloaded as a separate component from http www zend com en products studio downloads S To remotely debug a PHP Script 1 Set breakpoints at the relevant places in the file that you would like to debug 2 Save the file 3 Click the arrow next to the debug button E on the toolbar and select Debug Configurations or select Run Debug Configurations A D
143. PHP code Click the new Easy PHP File icon on the toolbar 1 lt php gt Add your code to the new file Save the file by clicking the Save button lal on the toolbar To complete your project create more PHP files by repeating steps 1 7 Once you have created all your files you can edit debug profile test and monitor them After taking all the necessary steps in order to obtain a server you will be ready to deploy the project to the live server on which it will be running For more information on methods of deploying and synchronizing information with a remote server see Working with Remote Server 49 Zend Studio 7 User Guide Working with Content Assist The purpose of this tutorial is to teach you how to use Zend Studio s Content Assist function in order to write code quickly easily and accurately Contents Purpose and Usage Activating Content Assist Making Content Assist Elements Available Within the Same Scope Function Parameter Hints Class Type Hints Configuring Content Assist Purpose and Usage The Content Assist feature enables the selection and insertion of existing code elements to complete partially entered code A list of possible code elements appears in relevant locations within your files according to the context of your cursor which you can then select to be automatically entered into your code Each type of code element will have a unique icon A Reserved PHP Words S Func
144. Person php 0 01 0 03 Person isetLastame 8 Person php 0 0 0 01 Person setAge F Person php 0 0 0 01 Person setGender F Person php 0 0 0 02 Person __construct P Person php 0 01 0 05 Person i__construct F Person php 0 01 0 06 mp Person printData IS Person php 0 05 0 28 D Person printDate P Person php 0 01 0 04 Person printData F Person php 0 01 0 05 Code Coverage Summary Summary of how many lines of code were covered Element The file folder that was called Covered Lines Visited Significant Total Percentage of lines covered within each file Visited Number of lines covered Significant number of lines excluding comments and declarations Total Total number of lines in the file 87 Zend Studio 7 User Guide E9 Profiler Information Execution Statistics il Execution Flow 3 Covered Lines Visited Significant Total E Profile Project 2 68 39 57 72 B Person php 63 31 49 62 P tryPerson php 100 8 8 10 Show Code Coverage Clicking on the Covered lines percentages will open an editor containing the debug file with the covered lines highlighted private lastName private fage 3 private gender private static SpersoniId 1 public static personCount 0 Person personCount 88 Getting Started Profiling PHP Web Pages Zend Studio also allows you to profile whole applications
145. Port 80 Rapp Servers view Toolbar Commands A Description Enable Tunnelling Opens a tunneling connection to the server selected in the Servers list Show Server Opens the Zend Server event list for the Zend Server Event List selected in the Servers list if applicable Auto Detect Zend Auto detects a Zend Server installed on the local machine Server Collapse All Collapses the list of servers Opens the PHP Server Creation dialog 486 Reference Outline View Menu Commands i 7 v7 The view s menu can be accessed through the view menu icon E Import Server Preferences l Export Server Preferences i Filters en ams Peete O E Import Server Launches the import server preferences dialog le JL E Export Server Launches the export server preferences dialog Lee 1 2 Filters Launches the PHP Server Filters dialog which allows you to apply filters to the servers displayed in the Servers list The Servers View is displayed by default as part of the PHP Perspective To manually open the view go to Window Show View Other Zend Servers Servers 487 Zend Studio 7 User Guide Type Hierarchy View The Type Hierarchy view display the hierarchy for a given type a class name interface name or class methods constants and fields This allows you to view an element s supertypes types higher in the hierarchy or subtypes lower in the hierarchy withi
146. Preferences page Under the File Project category click Browse and select the form1 file This will be the file from which the debugger will start debugging the debug target 10 Ensure that the URL pointing to the file location is correct If this is not correct unmark the Auto Generate checkbox and manually change the URL You can choose whether the file content will be taken from the local copies of the files or from the files located on your server To select the file s Source Location select the Advanced tab and select the relevant option under the Source Location category 11 14 15 16 17 Name New configuration 1 Server Advanced ml Common Saver Server Debugger Zend Debugger Ki PHP Server Del af PHP Web Server new contigue Fle lt r frealport F Break at First Line unt 7 Auto Generate Click Apply and then Debug 12 13 Click Yes when asked whether to open the PHP Debug Perspective The Debug Perspective will open with several views relevant to the debugging process See PHP Debug Perspective for more information on the different views In the editor view you will see the code for the form1 file In the Debug view click Resume to resume the debugging process The browser output will display a form asking you to enter your Name and Age Select the browser view tabbed with the editor window This will display the output 79 Zend Studio 7 User Guide
147. Purpose and Usage This tutorial demonstrates how to use Zend Studio s integration with Zend Server in order to constantly monitor your application and easily detect and diagnose performance issues and code errors during run time You must have Zend Server installed on your local machine before commencing this tutorial See Zend Server Integration for more information on the Zend Server and where to download Configuring Zend Server Integration A Zend Server installed on the same machine as Zend Studio is automatically detected and configured in Zend Studio To automatically configure a Zend Server The auto detection is triggered when Zend Studio is launched or when the Auto Detect Zend Server button is clicked For auto detection when Zend Studio is launched 1 Ensure Zend Server is installed and running on the local machine 2 Open Zend Studio A popup balloon will appear in the bottom right corner of the window indicating that a Zend Server installation has been detected and configured 100 Getting Started Zend Server Found x 4 Zend Server installation has been detected on your local machine and added s your defauk PHP server Chick here to learn more 3 Click the icon to close the balloon or the click here link to be taken to the Zend Server Integration help page To auto detect Zend Server after Zend Studio has been launched You can manually trigger a Zend Server auto detection through the Ser
148. SE The comments should now be edited with the relevant description and parameters Descriptions that are added for a code element are also automatically added to the Content Assist bank so that the next time the code element is used it is readily available from the Content Assist list The element s descriptions will also appear in the Outline view Zend Studio offers Content Assist support for magic members declared in code comments See the Content Assist concept for more information phpDoc blocks also serve as the input for creating a PHPDoc 127 Zend Studio 7 User Guide Bookmarks Bookmarks can be used as placeholders within your scripts to allow easy navigation to pre defined places within your scripts and resources in the vertical marker bar to the left of the editor Bookmarks are indicated by a bookmark icon Bookmarks are displayed in the Bookmarks view which can be opened by going to Window Show View Bookmarks fa Problems fz Tasks g Console Ll Bookmarks x x o eh Description Resource Location jparaph_bar php Demo Project line 249 Function 3 Demo php Demo Project Remember This debug php Demo Project For more on bookmarks see the Bookmarks topic in the Workbench User Guide Additional user guides can be accessed from inside Zend Studio by going to Help Help Conients or from the Eclipse Online Documentation site http help eclipse org ganymede index jsp 128 Concept
149. SQL tab Sse Right click and select Add Server The Add SQL Server dialog will open Enter the required SQL Server Settings Click OK Your Server Tree will be added to the SQL tab 3 In Database Development Perspective click the Create New SQL Connection icon D on the Data Source Explorer view toolbar The New JDBC Connection Profile wizard opens Select a driver from the list and enter the required information Click Finish Your new connection profile will be added to your databases list in the Data Source Explorer view See Creating a Database Connection Profile for more information To connect to your SQL database server Zend Studio 5 x Zend Studio 7 x Create an SQL server connection by following the instructions under To create an SQL server connection above Select the SQL tab M5 from Studio s File Manager Double click the Server you want to connect to The SQL Database tree will be displayed See Connecting to a Database for more information 44 Create an SQL server connection by following the instructions under To create an SQL server connection above Open the Database Development perspective by going to Window Open Perspective Other Database Development In the Data Source Explorer view expand the SQL Databases node right click your SQL server connection profile and select Connect The SQL Database tree will be displayed Getting Started To view th
150. Script Build Path is determined by the resources included in the project s JavaScript Libraries properties page To configure the project s JavaScript Build Path 1 In PHP Explorer view right click the required project and select Properties JavaScript JavaScript Libraries In this properties page you can add the following elements to the project s JavaScript Build Path Libraries Built in and user defined libraries contain pre written collections of JavaScript source files that have prototyped object class definitions and JsDoc Global Super Types Each object field function in the added libraries will be added to the project s Global Scope Every JavaScript file in the project will then have access to these objects fields functions Source Other folders files variables from your file system or linked from an external source Projects Other projects in the workspace or on your file system 452 Tasks Libraries Tab If your project references a JavaScript library it should be added to this list so that it s elements can be available for Content Assist options Through the Libraries tab you can add Zend Studio s built in libraries or create and add your own User Libraries The default Runtime Libraries Script Language Libraries Web Project support for JSDT and ECMA 3 Browser Support Library are added to the JavaScript Build Path automatically Properties for phpprajeci Libraries Resource
151. Statements esineseeeeeeeeeneeenesereserssersstnnsrnssrnssrensrensrensrnnnrnn 115 Glass Type Hints eeina anina Lego tebearetels ae araa Aaa a beatin baT EAr aSa ieee Eet 116 Content Assist for Magic Members 117 Camel Case Mathe Simsion ineat aeann traa aaae aera aaa E Aea a bende 118 N MESPACES prosen ei n EA TA AE A A R 118 Configuring Content ASSISt sesser aaaea de DEEL aaa a a aaaea aaa e EEEa e ARENAS 119 SYNTAX COON EE 120 Automatic Completions EE 121 Matching Oe EE 122 Marke oireann enana ec ca eens te spac laaan sta e panid dart ee 123 Code F Olding TE 125 G de e ln lu EE 126 phpDoc Block Comments 127 BOOKMANKS EE 128 Hover Supporte idan iia dant ada e snes nl Sieh eins dain aie aie ees 129 Zend Studio 7 User Guide Configuring Hover Preferences seessesssessisssrsstrtetrtstnnttnttnurtnnstnnntunstnnntnnsnnnsntnsrnnnnn 130 Override Indicator Sania haitata iepa ves aces deeded at Nees eege ieaie Hae pestle 131 PHP Working Sets nsii iat stds Seege Ad ENER gesagt annie eee 132 Type Hierati EE 133 PAF Manual Integration iiss ceccicetcs Jegeeeieeiegegdt e een deveetenct a E 134 Real Time Error Detection nesiekiame a a a a 136 EE nen EI 137 QUICK dE 137 NEE 137 LOCA PISIN 138 AAE E E TE E ee Eege be E 139 SA AEE toate EE ATE n E eebe eebe 140 Zend Framework Development 141 Zend Framework Project and Element Creaton 141 Zend Framework Content Assist ccc ccceeceeeeeeeeeeaeeeeeeeceeeeeceaeeee
152. Studio source folders and files that will be imported to them Import into multiple projects C impart into a single project The following project s wall be created 7 If the project roots folders and files contained within your folder were not mapped to a Version Control System CVS or SVN they will all be contained within a single project in Zend Studio 7 This includes folders and files linked to FTP If the project roots folders and files contained within your folder are mapped to a Version Control System each project root will be imported into a separate project 8 If you would like all projects root to be combined into one Zend Studio 7 project select the Import into a single project option Note that in this case the Version Control System mappings will not be created 9 Click Finish Your project s will be imported into Zend Studio 7 and will be available in PHP Explorer view The selected Version Control links will be maintained Any required FTP connections will be created in the Remote Systems View See the FTP and SFTP Support topic for more on FTP SFTP connectivity The project root itself needs to be mapped to a Version Control System so that its subfolders can be mapped 199 Zend Studio 7 User Guide Migrating Keymaps from Zend Studio 5 X Zend Studio 5 X keymaps or collection of command shortcuts can be easily migrated and applied to Zend Studio 7 x for a seamless transition from Zend Studio 5 X t
153. Tasks Working with Mylyn Integration The Task List contains two types of tasks Local Tasks and shared repository tasks that are stored in a task repository such as Bugzilla or Jira See how to create new tasks Local tasks are typically contained in categories which you can create by right clicking on the task list and selecting New Category Repository tasks are contained in special categories that represent queries At the top of the Task List you will find the following buttons and features New Task Create a new local or repository task Synchronize Update repository tasks with changes from the server Task Presentation Toggle between Scheduled and Categorized presentations Focus on Workweek See only tasks scheduled for this week Find search for a task by typing in words from the task summary Working set indicator Indicates the currently active working set Use the black arrow on the left to change the working set Current task indicator Indicates the currently active task Use the black arrow on the left to re activate a recently active task Task List Presentation The task list supports several ways to present tasks You can toggle between the following modes by using the Task Presentation button in the toolbar Categorized View tasks grouped by their category Scheduled View tasks grouped by the scheduled date Icon Legend and Color Coding See the legend below to interpret the icons
154. Test Suite 2 Click the arrow next to the Run button of on the toolbar and select Run As PHP Unit Test amp or from the Main Menu go to Run and select Run As PHP Unit Test amp or right click the file in PHP Explorer view and select Run As PHP Unit Test All the PHPUnit Test Cases contained inside the PHPUnit Test Suite will be run Runs E Errors 0 E Failures 1 Si Bie CalculatorTest E ko CalculatorTest2 3 The PHPUnit view will be displayed with a section showing all the tests run and the results and two extra tabbed views showing code coverage and failure trace The results of the individual PHPUnit Test Cases will be displayed in a tree diagram 4 Expand the nodes to see the results for each of the individual test cases Tests that have passed successfully will be displayed with a green tick icon te Tests that have failed will be displayed with a blue X icon E Tests that have not been implemented i e that tests have not been written for will have passed but will have a note indicating that they have not been implemented 5 Double click on a failed result if applicable to be taken to the test function in the test file To correct the failed result either fix the test function or the original function on which it was run 6 The Code Coverage display indicates how much of the code in both the original file and the test file was run Click on the code coverage statistics next to each file to open the Code
155. The PHP Company FS zend User Guide Zend Studio 7 x By Zend Technologies Inc In Ti is lend St h cend Studio Si 8 ege PHP i A n a fe e S www zend com Disclaimer The information in this help is subject to change without notice and does not represent a commitment on the part of Zend Technologies Ltd No part of this manual may be reproduced or transmitted in any form or by any means electronic or mechanical including photocopying recording or information storage and retrieval systems for any purpose other than the purchaser s personal use without the written permission of Zend Technologies Ltd All trademarks mentioned in this document belong to their respective owners 1999 2010 Zend Technologies Ltd All rights reserved Zend Studio 7 x User Guide issued April 2010 Product Version Zend Studio 7 x DN ZS UG 210410 07 02 Table of Contents What s New in Zend Studio 73 16 Ma DIE Rane nan Medea iene ee 18 Getting Started iis tae tA ea ae ee a A a A i A eee 19 Ee ET E 20 EE la Bue DE 20 NN De Debt et vite tate tata Bee dae ata aia ets Se ity 20 Workspacesia cadences arti E 20 Greating a PHP Project EE 21 ele ER le IT 21 PHP Debugging WEE 21 Remote Server Explorer RSE cccccccceceeeeeeceeeeeceeeeeaaeeeeneeseeeesaeeesaaeseeeeeseaeeesnaeeneaeeeeaes 22 Source Contro EE 23 PIP Dt e eared eevee ae aa aa ae aed ave a cee 23 Refactoring DE 24 Perspectives Of Interest
156. Toolbar Contribute to the Documentation PHP Preferences Support PHP Project Properties Registering Your License PHP Icons 474 Reference PHP Perspectives and Views Zend Studio incorporates a number of Perspectives and Views for managing all aspects of your PHP code files project and application creation The following PHP perspectives are used for developing PHP PHP Perspective PHP Debug Perspective PHP Profile Perspective Zend Server Code Tracer Perspective See the Workbench User Guide for more on Perspectives and Views Additional user guides can be accessed from inside Zend Studio by going to Help Help Contents or from the Eclipse Online Documentation site http help eclipse org ganymede index jsp 475 Zend Studio 7 User Guide PHP Perspective The PHP Perspective is Zend Studio s default perspective It incorporates all Zend Studio s PHP project file creation inspection and editing functionality PHP MyProject Debupieme php Zend Studio for Eclipse Fle Edt Navigate Seach Project Run Window Hep ei 4 ie 9 0 9 0 we o E F dimen E pe 1 PE E neen nemoe E Gegen sho DE ore 4 aF o Sai n a ron ieiti ed MyPeoject Geier Schei B MyFolder E beier pho 8 P petit ge Debug Dezo i P Rehte tte B PP kds Path border 1 videh 700 BA PP Language Lovey sro bg ged oS re Nare Address acray Biki 227 Meine St San Francs D gt E Pta Ei E Yanks
157. URL of its document root Under the File Project category click Browse and select the tryPerson file This will be the file from which the profiling process will start Click Apply and then Profile A confirmation dialog will be displayed asking whether you want to open the Profiling Perspective 89 Zend Studio 7 User Guide 12 Click Yes If you would like the Profiling Perspective to open by default in the future mark the Remember my decision checkbox The Profiling Perspective will open displaying the Profiling Monitor window with profiling information See PHP Perspectives and Views for details on the information displayed in the profiling perspective 90 Getting Started Working with PHPUnit Testing The purpose of this tutorial is to teach you how to create and run PHPUnit tests on your code You will learn how to create and run single unit test cases and test suites containing a number of test cases Contents Purpose and Usage Creating a PHPUnit Test Case Running your PHPUnit Test Case Analyzing Errors Creating and Running a PHPUnit Test Suite Generating a PHPUnit Test Report Purpose and Usage Unit testing is a procedure to test your code to ensure that individual units of source code are working properly and that the right output is being generated Tests can be run on all or some functions within files meaning that tests can be conducted before the file has been fully developed Each test case sh
158. UT ae s a Servers 2 Defaut PHP Web Server http localhost 80 fg Local Zend Server htp localhost 60 D Zend Server Integration Conversely Zend Server s integration with Zend Studio means that the problems identified by Zend Server can be viewed tested debugged and profiled in Zend Studio 201 Zend Studio 7 User Guide If your Zend Server is situated behind a firewall or other security device you will have to set up a tunnel in order for the integration between Zend Studio and Zend Server to be enabled See Setting Up Tunneling for more information For more on Zend Server go to http www zend com en products server Your Zend Server Integration might not function correctly for one of the following reasons Your Zend Server is not correctly configured in Zend Studio See Defining Zend Server in Studio for more information Zend Server is situated behind a firewall or other security device See Setting Up Tunneling for more information Your Zend Studio Communication is not correctly configured in Zend Server See Configuring Studio Communication Settings in Zend Server for more information Zend Server is situated on an HTTPS Server In this case when trying to connect to your Zend Server from the Zend Server Events view you will receive the following message e For Windows Unable to verify the identity of http lt myserver gt ZendServer index php as a trusted site e For Linux Unable to verify the ident
159. VN Projects from SVN 1 2 3 Click Next Select your repository If you have not yet created a repository enter the information required to identify and connect to the repository location URL The URL on which your repository is located Label Select whether to use the URL as the repository s name or to enter a new Authentication The user name and password you use to connect to SVN Mark the Save password checkbox so that the password will be automatically inserted in the future A Select Resource dialog will appear Expand the nodes until you see the required Select your project and click Finish A Check Out As dialog will appear Check Out As Check Out As You can checkout the selected repostory resource by different ways Select the method of checkout you prefer to use Choose how to check out Folder SVN Project Check out as a project configured using the New Project Wizard CO Find projects in the chidren of the selected resource O Check out as a folder into existing project O Check out as a project with the name specified F Checkout recursively 259 Zend Studio 7 User Guide 7 Select one of the following options Check out as project configured using the New Project Wizard Imports the project as a new PHP project into your workbench with the project s existing name Find projects in the children of selected resource Imports all folders within the pr
160. VS CVS is a source control system intended to allow a team or group to work on the same files and projects simultaneously and to be able to revert file and project states back to previous versions The following tasks describe some of the actions that can be done using Zend Studio s CVS functionality Configuring a CVS connection Importing a project from CVS Accessing an Existing CVS Checkout Uploading projects to CVS See Working in a Team Environment with CVS in the Workbench User Guide for more information on CVS Additional user guides can be accessed from inside Zend Studio by going to Help Help Contents or from the Eclipse Online Documentation site http help eclipse org ganymede index jsp 248 Tasks Configuring a CVS Connection This procedure describes how to configure a connection to a CVS repository Before you can add projects to or export projects from CVS you must define your CVS repository settings Prerequisite To access a repository make sure that a CVS server is already configured S To add a new CVS repository 1 Open the CVS perspective by going to Window Open Perspective Other CVS Repository Exploring 2 Inthe CVS Repositories view click the Add CVS Repository button on the view s toolbar or right click within the view and select New Repository Location The Add CVS Repository dialog will open Add a new CVS Repository Add a new CVS Repository to the CVS Repositories view
161. Zend Framework standards and allow for Rapid Application Development Visit http framework zend com for more on Zend Framework or http framework zend com manual en for the Zend Framework Reference manual This procedure demonstrates how to create a new Zend Framework Project Important Note You must have Zend Framework version 1 8 installed on your machine to be able to create Zend Framework projects Zend Framework comes bundled with Zend Server or can be downloaded from the Zend Framework site at http framework zend com download current KY To create a new Zend Framework Project 1 Go to File New Zend Framework Project or right click in PHP Explorer view and select File New Zend Framework Project The New Zend Framework Project dialog will open Zend Framework Project New Zend Framework Project Create a Zend Framework Project Project name Contents O Create new project in workspace Create project from existing source Create project on a local server Directory C Program Fles zend apache2ihedocs Framework Version Zend Framework Version Le Ke Project Layout Zend Framework empty project Zend Framework defauk project structure Full featured Zend Framework and Dojo project 272 Tasks Enter the project name In the Framework Version drop down list select the Zend Framework version to use for your project Zend Studio supports Zend Framework version1 9 This will include
162. Zend Studio installation select the Zend Firefox Toolbar and or the Zend Internet Explorer Toolbar options Choose Install Set D Description Zend Studio is a powerful integrated development environment for developing and maintaining PHP applications Zend Studio combines a powerful editor code inspectors and analyzers a debugger and profiler and robust code completion engine for all PHP constucts as well as HTML S To manually install the Zend Internet Explorer Toolbar 1 Go to the Zend Studio downloads site http www zend com en products studio downloads and download the Studio Browser Toolbar for Internet Explorer on Windows Save the file to your file system Run the following command by going to Start Run in the Windows Start Menu regsvr32 exe lt ZendIEToolbar d1ll_Location gt ZendIEToolbar dll1 Replace lt ZendlEToolbar dll_Location gt with the path to the directory in which you saved the downloaded file Deke nee of estore Se document oF eeler med vies SCO RI VOS Open regswr32 exe C ZendiETooba dr a Coes Cae 329 Zend Studio 7 User Guide A dialog will be displayed confirming the successful registration of the d Restart Internet Explorer If the Toolbar is not automatically displayed select the Zend Studio toolbar from the Internet Explorer Toolbars list In Internet Explorer 7 the Toolbar list is available from Tools Toolbars You should now configure the Zend Stu
163. a name for the new configuration In your new configuration window select PHP Web Server under the Debugger Location category 8 Click PHP Servers to add your server If you already have a server configured skip to step 12 9 Inthe PHP Servers dialog click New 10 Enter the server s name and its document root URL 11 Click Finish and OK to add your server and return to the debugging dialog 12 Select your server from the drop down list 13 Under PHP File click Browse and select the debug file 75 Zend Studio 7 User Guide 76 14 15 16 17 Mark both checkboxes under the Breakpoint category Click Apply and Debug The Debug Perspective will open In the Debug view click Resume until the debugging process is terminated The output in the views will provide the following information Debug View Here you can control stop pause and resume the debugging process You can also decide whether to step into step over or step return step out off certain functions Oe a E New_configuration 7 PHP Script AS PHP Application ER Testing Debug php suspended Debug php at line 19 Debuag php at line 1 Program Files Zend Apache2 htdocs dummy php at line i S Testing Debug php a CS E Variables Will display the various variables in your script Breakpoints Will display the breakpoints you have entered Parameter Stack Will display the pa
164. aaeseeeeeseeeesaeeesaaeeeeneeeea 142 Database Connectivity o irusiisicri ianiai a a a aaa iaa eeetEn 143 EEA o E E A ee CA an E A 144 PHP Script LocabRunning iniiis eii ain iiaa aeii irii niia iii E w 144 PHP Script Remote Hummimg 144 PHP Web Page RUNNING edaria ai irei iiid AE EA 145 Debugging wate ie oi Aa ee ie Ad ee an ee ee 146 PHP Script Local IDebUgGING itaran seated aa aaa anaiak a Hie 146 PHP Script Remote Debuggimg emiitiecisisrenryoinani intear aeaa a iaaea eaaa 146 PHP Wep Page DeDUggING ieetenuper tayo ieen ean aa Ea E S ASE E EEEREN 147 URE De BUG QING EE 147 Tolpar DEBUGGING WEE 148 PONING EE 149 PHP Script Local ene DEE 149 PHP Script Remote Profilihgkssiaii tisrin neetna eraa aaa a Anaa aa aa aaa 149 PHP WebPage ProM EE 150 URE FONO E 150 Toolbar Site DEE 150 NK ET 151 Break Un CH 155 Conditional Breakpoints scenes seaeeecaaeeesaaeseeeeseaeeesaeeseeeenaes 155 Eeler Lee TEE 156 ele Ee E 157 vi Table of Contents Path Man gescht cvtateecevcntes E E E uated ented A ees 158 Zend Browser Toolbar eitan aa aaa e a 161 REITER 162 Zend SEVEN EE 164 Zend Server Integration 164 Viewing Events from Inside Zend Gpdio 165 Importing Events into Zend Studio cccceeeeeeeeceeceeeeeeeaeeeeeeeceeeeseaeeeeaeeseeeeeseaeeeeaeeeeneeee 166 Gode TRACING E 167 PHP Unit Rue DEE 168 SC leen WEE 170 JavaScript SUPPO n a r a a A a a a a E a a a A 172 PIP Bie e 173 ee ENEE 174 Zend Guard Integration 175 e EE 176
165. acer Perspective The Zend Server Code Tracer perspective allows you to use the Zend Server Code Tracing feature Integrating Zend Server Code Tracing into Zend Studio allows you to open the source of the execution data inside of your environment This feature is useful in resolving time performance issues memory performance issues and workflow errors The perspective is accessed by going to Window Open Perspective Other Zend Server Code Tracer Fj Be PHP Debug G Web jg ze 7 Tracing Tree Statistics per Functon led Show memory usage Total running time all calls Function Name of Calls Including Children Just own Located in file drupal_bootstrapO bootstrap ine drupal_unset_globalsO 0 01 ms bootstrap inc Hmer sam 0 05 ms bootstrap ine conf_initO 12 36 ms bootstrap ine drupal_valid_http_host 0 05 ms bootstrap inc ont path 0 19 ms bootstrap ine Calls for _drupal_bootstrap Memory Consumed Total Time Own Time Called from 5 512 bytes 12 45 ms 0 01 ms bootstrap inc 883 1 932 bytes 16 614 ms 3 66 ms bootstrap inc 883 8 bytes 1 72 ms 4 71ms bootstrap ine 983 468 bytes 37 23 ms 001ms beotstrap inc 983 cement ASE bites AOR MS ALA me bootstran ing 983 6 bootstrap inc 3 bootstrap inc 2 d lt php f f Id bootstrap inc v 1 206 2 12 2009 04 30 00 13 30 goba Exp per file Functions that need to be loaded on every Drupal request
166. ailures 1 Deeg e E Bil caleuotortest Fale Trace DEE ES test_add Element Covered Lines visited Si 5 test_divide Failed asserting that lt integer 3 gt isequalt GH UnitTesting Project 2 2 65 28 43 119 E test_multiply P Calculator php 65 11 17 22 El test_subtract subtract test not implemented P CalculatorTest php 65 17 26 97 3 Inthe main area of the PHPUnit test view the results for each of the tests run will be displayed Tests that have passed successfully will be displayed with a green tick icon te Tests that have failed will be displayed with a blue X icon e Functions with tests that have not been implemented i e functions that tests have not been created for will have passed but will have a note indicating that they have not been implemented 4 The number at the top of the view indicates how many tests have been run Tests may not be run if an exit command is given or if a fatal error is encountered D 5 Click the Show failures only icon to only view failed results 382 Tasks 6 Select a failed result to view it in the Failure Trace view Click the Filter Stack Trace icon to display only functions relevant to your application and not PHPUnit functions 7 Double click on a failed result to be taken to the test function in the test file To correct the failed result either fix the test function or the original function on which it was run 8 The Code Coverage display indi
167. al browser y To run your application 1 Place your application on a Web server If you selected to create your project on a local Zend Server you can skip this step 2 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 Run PHP Web Page Note that no files will be published to the server J Launch URL http localhost 80 MyProject as php __ cance 3 Ensure the URL pointing to the file on the server is correct Edit if necessary 4 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 situated locally on your workspace irrespective of any changes made to the server copies of the files Next Steps In addition to the options and features highlighted in this document Zend Studio contains a wide range of features to help you with all aspects of your PHP development To learn more about the full range of funcitonality offered by Zend Studio See the Zend Studio Online Documentation or User Guide for full information on all the features available in Zend Studio Visit the demo video library http www zend com en products studio videos to view short demo videos on Zend Studio s capabilities Visit the Zend Studio Support Center w
168. al link Phar integration settings are defined per project and are part of the project library settings 1 Properties for my project PHP Include Path Source ki Projects BA Libraries Ss Order Ubraries and external folders on the include path Add Library Project References RunjDebug Settings Add External Source Folder Save Actions 186 Tasks Tasks Creating PHP Projects Creating PHP Files Creating PHP Elements Connecting to Databases Running Files and Applications Configuring a Project s PHP Include Path Configuring a Project s PHP Build Path Adding a Server Location Path Map ing and Profiling Zend Server Events PHPUnit Testing Generating Getters and Setters Overriding Implementing Methods Using Code Galleries Integrating with Zend Guard Working with WSDL Incorporating WSDL Files Viewing RSS Feeds Working with Remote Server Exporting Actions Importing Actions 187 Zend Studio 7 User Guide Creating PHP Projects PHP projects are the containers within which all PHP and other application files should be created Vi 188 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 PHP Project New PHP Project Create a PHP Project Project name Contents O Create new project in workspace O Create project from exi
169. allery entry dialog will open containing the snippet s details New code gallery entry Name Example Author Joe Bloggs Description Example snippet Code This is an example snippet 6 Make the required edits and click OK The code snippet will be updated with the edits you have made You can only edit snippets in the User Code Gallery 414 Tasks Interacting with Code Gallery Sites The Code Gallery view allows access to Code Gallery sites that contain a variety of code snippets These procedures describe how to connect to the Zend Code Gallery site to download Zend s code snippets how to add a new Code Gallery site how to update your Code Gallery list how to suggest code snippets you have created to the site for use by others and how to give a rating to downloaded code snippets w To access the Zend Code Gallery 1 Open the Code Gallery view by going to Window Show View Code Gallery 2 Expand the node next to the Zend Code Gallery list EH If no node appears click the synchronize with site button to reactivate it 3 A login dialog will appear Don t have an ID Sign up User name d Password Save password Cancel 4 Enter your Zend Network User name and Password If you don t have a Zend Network ID click the Sign up link to be taken to the Zend Developer Zone registration site or follow this link https devzone zend com member regi
170. amples are Script util Jinternal org e 4 From the Resolution drop down menu select one of the following Forbidden This will make the file completely unaccessible in the relevant project Discouraged This will make the file available but not highly suggested Accessible This will allow the project to access the file and its contents freely Inthe Rule Pattern field insert a rule pattern to define a pattern for the rule Use wildcards to create a pattern The accepted wildcard values are This will automatically apply the rule to any of the files that match the pattern 362 Tasks To apply changes click OK 5 Inthe Type Access Rules dialog you also have the option to edit remove or change the order of your defined access rules by clicking the buttons Before a file is allowed access into your project it will first confirm that none of the access rules apply to it These rules are checked in the order they are placed here Your PHP Library now has an access rule defined in the hierarchal tree in the PHP Libraries Preferences page You may edit a file s access rule at any time by repeating this procedure 363 Zend Studio 7 User Guide Importing PHP User Libraries This procedure describes how to import existing user libraries that are on the disk or ina repository This allows you to take an already built library and use it in your project as well as share a library with
171. an existing project 1 In your SVNProject create a new PHP file called SVNFile2 with the following code lt php Another new file Re 65 Zend Studio 7 User Guide Save the file In PHP Explorer View select the file right click and select Team Commit A Commit dialog will open Enter a comment Another new file added and click OK The file will be committed to SVN and will be accessible by other users Making Changes Comparing Changes and Committing Changes Once files are stored on SVN you and all other team members can make changes to the files and commit them Before committing changes you have made to a file you can compare the file stored locally in your workspace to the file stored on the SVN repository Making and Comparing Changes w The following procedure demonstrates how to make changes to files and comparing local files to files in the repository Le a 3 Open SVNFile1 in your SVNProject After the text This is a new file add I have made a change Save the file In PHP Explorer view the file and project will have a gt suffix indicating that a change has been made which has not yet been committed So far the changes have only been saved in your workspace In order to compare the local file to which you have made changes with the one sitting in the SVN repository right click the file in the PHP Explorer view and select Team Synchronize with Repository Click Yes when a
172. and color coding in the task list You can view this legend by selecting Show UI Legend from the menu that appears when you click the white down arrow next to the minimize button in the top right corner of the Task List view Creating new Tasks You can create new tasks by clicking on the New Task button in the Task List s toolbar This will open the New Task dialog and prompt you to select a repository There are two main types of tasks Local tasks Repository tasks 443 Zend Studio 7 User Guide Local Tasks You can use local tasks if you do not have a shared task repository or if you would like to create a private personal task that is local to your workspace To create a local task 1 Select Local Task Finish from the New Task dialog You can then provide the following details about the task 444 Task Description Your task is called New Task by default Replace this with a brief description of your task Priority Set the priority of your task This will affect the tasks icon and order in the task list Status Set your task to complete or incomplete In your task list completed tasks have a strike through font and will appear lower in the list URL You can associate a URL with this task Retrieve Task Description from URL button Set the task description to the title of the associated URL page Open with Web Browser button Open the URL in the integrated web browser Scheduled For S
173. ans jissu Tracker Issues e e Appendis B Zend Framewnr PHP Coming Stancard en e 256 Attachments en 293 Zend Studio 7 User Guide Using the Zend Tool Floating Window Zend Studio provides you with the ability to execute Zend_Tool commands from within Zend Studio using the Zend Tool Floating Window This replicates entering a command in your CLI command line interface The Zend_Tool Initative allows PHP programmers to programme according to Rapid Application Development principles See http framework zend com wiki display ZFDEV Zend Tool Initiative for more information on the Zend_ Tool initiative You must have Zend Framework version 1 8 installed and configured in your php ini file for Zend_Tool commands to function The latest version of Zend Framework comes bundled with Zend Server or can be downloaded from the Zend Framework site at http framework zend com download current To execute a Zend_Tool command 1 In PHP Explorer view select a Zend Framework project 2 Press Ctrl 2 or from the menu bar go to Project Zend Tool The Zend Tool Floating Window displays options 3 3 Enter the required command The Zend_Tool currently supports a limited number of functions The content assist list displays possible options as you type ZS options DI zf create co E zf create controller name index action included 1 ZF controller ZF controller name 294 Tasks
174. applications during development Zend Studio includes several different methods of running your files and applications PHP Script Local Running Allows you to run files situated in your workspace This enables you to locally validate freshly developed code before deploying to a Web server Using this option you can run applications which do not require user input or responses from the server When running internal files the Zend Studio internal debugger uses its own PHP executable that was installed together with Zend Studio See Running PHP Scripts Locally for more information PHP Script Remote Running Allows you to run files situated locally on your workspace using your server s Zend Debugger This allows you to test your files in the production environment and allows you to utilize the extensions installed on your server See Running PHP Scripts Remotely for more information Your server must be running the Zend Debugger or XDebug in order for remote debugging and profiling capabilities to function The Zend Debugger comes bundled with Zend Server Zend Core and Zend Platform but can also be downloaded as a separate component from http www zend com en products studio downloads 144 Concepts PHP Web Page Running Allows you to run applications situated on a server including any required interactive user input The PHP Web Page Run dialog has an option to give the files you are working on first priority when ru
175. ascript 467 Typing preferences eeeeeeeseeeeeeeeee 619 U UNCOMMON iisi sisisi 242 Unit testing ecceeeeeeeeeeeeeeeeteeeeeeees 77 155 Update Manager 96 URL Debug Qing cc eeeeeeeeeeeeeeeeeeeeees 132 URL Profiling 135 Use and Configure JavaScript Content ASSIST stieceezec che E blessed gaat 467 Use and Configure JavaScript Mark OCCUITENCES ueiaire iaasa 467 Use and Configure JavaScript Syntax COON NG BE 467 V Vanat acina 379 Variables view 513 MIGW een ee en a 127 276 View JavaScript Elements in the Outline Vu 467 view Outline 20 ee eeeeceeeeeeeee testes eeeeeeteeeees 467 W WANING WEE 122 123 Web Page Debugging s 132 Web Page Profiling cceeeeeteeeeeees 135 Web Services Description Language 165 Ve Te EE 164 wizard Import 0 eect eee eeee eect enteeeeeenaeeeeee 199 Work with jQuery JavaScript Library 467 Work with Joe 467 Work with Prototype JavaScript Library 467 WOSKDEN CH AA 5 Workbench Options preferences 600 WOFKPIOW CFT OF o oo ee eeeeeeeeeeeeeeeeeeteeeeeteeeeeees 154 Working Get 237 Working Sets cccceceeseeceeeeeeseeeeeeeees 117 working with 198 W SDL E PEE 165 441 WYSIWY Ginesta aa a anid 422 X aM E EE TET 165 199 Au 199 Index Z Zend 5250 Bridge iseen 166 Zend Action Helper 294 Zend Browser Toolbar ssssseesseseneeeeens 148 Zend Code Gallen 428 Zend Controller cceecececseceesessee
176. at the correct dummy file with the correct content is placed in the correct directory on the target server The correct dummy file is created and located properly as part of the installation procedure The problem here is post installation You are not allowed to connect with You must have tunneling permissions in the the server via the communication php ini file Make sure that the tunnel zend_debugger allow_tunnel variable is properly configured For any other cause or additional information use one of our support options 347 Zend Studio 7 User Guide Profiling Files and Applications The following Profile functionality is available in Zend Studio Profiling a PHP Script Profile PHP Scripts on your Workspace Locally Profiling a PHP Script Profile a PHP Script using Zend Studio s internal debugger Remotely Profiling a PHP Script Profile a PHP Script using your remote server s debugger Profiling a PHP Web Page Profile PHP files on a remote server Profiling a URL Profile a URL Profiling Using the Zend Debugger Toolbar Profile directly from your web browser Once a Profile session has been launched the PHP Profile perspective is used to view and analyze the results of the profiling process See the PHP Profile Perspective topic for more on the information displayed once a Profile session has been run 348 Tasks Profiling a PHP Script Files located in your workspace can be profiled in two w
177. ation is launched in Zend Studio s browser F io E ctof_convertpho 2 edkegengt 8 5 Rp flocalhost ZendServerProfiingletof_convert2 pchp w Er a Fahrenheit Celsius PHP Convertor Enter number of degrees Celsius to Fahrenheit Convert In the temperature field enter 30 and select the Fahrenheit to Celsius conversion type in the drop down list Click the Convert button Open the Zend Server Event list by right clicking your Zend Server configuration in the Servers view and selecting Show Server Event List Or by clicking the arrow next to the Zend Server icon on the toolbar OR and selecting your Zend Server configuration from the drop down list Getting Started If you have not configured your Zend Server password i A message will appear asking whether you want to configure this now ii Click Yes to be taken to the Zend Server preferences tab PHP Server Creation Zend Server Configuration Configure Zend Server integration options F Enable Zend Server integration Zend Server URL luse Defaut Port Number d Password iii In the Authentication field enter your Zend Server UI password and click Finish iv Reopen the Zend Server Event List as described in Step 9 above 10 The Zend Server Event list is displayed The last event displayed should be a PHP Error as a result of our PHP code error El ctot convertznhe 2megeg 2 TELI P E amp index phpzioadctrt montor u
178. ayed in the debugging process Controlling the debugging process The debug process can be controlled using the various buttons in the Debug view 1 2 The Debug process will automatically stop at each breakpoint The various views will display information about the debugging process up to that point only You can use the various buttons in the debug view to decide how to continue with the debugging process Click the Resume button SS to continue the debugging process until the next breakpoint or until the end of the debugging process Click the Terminate button to stop the debugging process Click the Step Over Ca button to step over the next method call without entering it at the currently executing line of code The method will still be executed Click the Step Return button The remainder of the code that was skipped by returning is still executed to return from a method which has been stepped into Click the Step Into button E to step into the next method call at the currently executing line of code Click the Use Step Filters button x to change whether step filters should be used in the current Debug View Once the debugging process has terminated you can click the Remove Terminated Launches button to remove any terminated debug sessions from the list During the debugging process for PHP Script PHP Web Page or URL various views will provide the following information 334 Debu
179. ays Locally Profiling a PHP Script Using Zend Studio s internal debugger Remotely Profiling a PHP Script Using your server s Zend Debugger 349 Zend Studio 7 User Guide Locally Profiling a PHP Script This procedure describes how to Profile a PHP Script from your workspace using Zend Studio s internal debugger w To locally Profile a PHP Script 1 Click the arrow next to the Profile button db on the toolbar and select Open Profile Dialog or from the main menu go to Run Open Profile Dialog or right click in PHP Explorer view and select Open Profile Dialog 2 A Profile dialog will appear Eat PHP 5 C Rogan Fies Zend Zend Studo fo Ecipse Bet 3 Double click the PHP Script option to create a new Profile configuration Enter a name for the new configuration a Ensure that the PHP Executable setting is selected under the Debugger Location category Select the required PHP executable Under PHP File click Browse and select the required file Click Apply and then Profile oe ON A confirmation dialog will be displayed asking whether you want to open the Profiling Perspective Click Yes If you would like the Profiling Perspective to open by default in the future mark the Remember my decision checkbox The Profiling Perspective will open displaying the Profiling Monitor window with various Profiling views 350 Tasks See the PHP Profile Perspective topic for more on the information
180. ays any error and warning messages Tasks View External Link Displays tasks that were added to your script if applicable 491 Zend Studio 7 User Guide By default a dialog will appear asking whether you want to open the Debug Perspective when a debugging session is run To change this behavior open the Perspectives Preferences dialog by going to Window Preferences Run Debug Perspectives and select Always Never or Prompt in the Open the associated perspective when launching category 492 Reference Debug View PHP Debug Perspective The Debug view displays the stack trace and allows you to monitor and control the Debugging process Be Sry mmm bb S 22 E ry E Debug PHP Script E AS PHP Application o Debug php suspended display_workers Debug php at line 77 display_workers Debug php at line 73 Debug php at line 103 e H 18 geg E k Debug View Toolbar Commands eon pe e oS SA Remove Remove any terminated debug sessions from the list Terminated Launches Resume Continue the debugging process until the next breakpoint or until the end of the debugging process Terminate Stop the debugging process the debugging process Step Into e EE into the next method call at the currently executing line of code be Step Over Step over the next method call without entering it at the currently dg executing line of code The method will still be executed
181. be activated b Relative to the Current Working Directory File names preceded with a or a These will only be searched for relative to the PHP Current Working Directory You can find out the location of your Current Working Directory by running the command echo getcwd c Relative Path Only the file name or partial path is specified e g myfolder a php In this case Zend Studio will search for the file s path according to the resources and order configured in the project s Include Path If the path of the file being searched for exists in more than one location the file that is called will be the first one Zend Studio encounters during the search process By default the order in which Zend Studio searches for the file s path is as follows i Projects in the debug target the first file to be debugged project s Include Path according to the order in which they are listed If a project specified in the Include Path refers to other projects libraries in its own Include Path the file path will be searched for there before the search process continues ii The debug target file s project See http il2 php net manual en function include php for more on PHP s search mechanism 156 Concepts PHP Build Path The PHP build process scans all resources that are on the project s PHP Build Path so that elements defined within them can be made available for Content Assist options and Refactoring operations This is done
182. be accessed from inside Zend Studio by going to Help Help Contents or from the Eclipse Online Documentation site http help eclipse org ganymede index jsp 252 Tasks Accessing an Existing CVS Checkout This procedure shows you how to access projects in Zend Studio that you have previously checked out from CVS This means you do not have to check out resources again to a new location in order to have access to Zend Studio s functionality w To access previously checked out projects 1 Launch the New PHP Project Wizard by going to File New PHP Project or right clicking in PHP Explorer view and selecting New PHP Project The New PHP Project wizard will open In the Project contents category unmark the Use default checkbox and browse to the location of your checked out CVS resources 1 PHP Project New PHP Project Create a PHP project Project name SVNProject1 Project contents C Use defauk Directory C MySVNProjectLocation PHP Version _ Enable project specific settings Click Finish A new PHP Project will be created with the contents of the project you had checked out In PHP Explorer View right click your project and select Team Share Project A Share Project dialog will open From the repository list select CVS and click Next If you have not yet configured a CVS repository you will need to enter your CVS repository details See Configuring a CVS Connection for mor
183. behavior in the editor Smart caret positioning determines where the cursor will jump to when certain positioning keys e g Home End are pressed The Editor Preferences page is accessed from Window Preferences PHP Editor Editor PHP editor preferences Note that some preferences may be set on the Text Editors preference page Smart caret positioning at line start and end Smart caret positioning in PHP names Overrides basic behavior To configure Smart Caret Positioning Preferences A 1 Mark the required checkboxes to configure the following options Smart caret positioning at line start and end If this checkbox is unmarked the cursor will jump to the beginning end of a line when Home End are pressed If it is marked the cursor will jump to the beginning end of the typed line i e ignoring the tabs at the beginning end of a line Smart caret positioning in PHP names If this checkbox is marked the cursor will jump to the beginning end of a word within a PHP element class function variable when Ctrl left arrow right arrow are pressed When unmarked it will jump to the beginning end of the whole element 2 Click Apply to apply your settings More editor settings can be accessed by clicking the Text Editors link 578 Reference Content Assist Preferences The Content Assist feature enables the selection and insertion of existing code elements to complete partially entered code The
184. ble clicked The PHP Explorer View is displayed by default as part of the PHP Perspective To manually open the view go to Window Show View Other PHP Tools PHP Explorer 479 Zend Studio 7 User Guide Outline View The Outline view displays all PHP elements and element types in the current active file The elements are grouped according to type and are displayed in a tree like browser See PHP Icons for a description of the icons displayed in the Outline view Features G2 Quine 2 TE PHP Piol PHP Fu H i ZE E age DI Guscbent o mg Giadienti mg FiedReciangel xi t x b O GaCoraithom_color tto_color BaP 4 Extends Piot width abswadth H co Ge eoeeoee co e pe eo e Q EE The Outline View is updated interactively according to changes made in the files Each type of PHP element is represented by a unique icon eener S Reserved PHP Words Functions Templates Classes Interfaces Constants Variables public Namespaces PHP 5 3 only Use Statements PHP 5 3 only The Outline view is integrated with the Editor Therefore if you select a PHP element in the view the Editor will jump to the element s declaration in the file in which it is declared 480 Reference Toggle the link to Editor on off using the Link with Editor button g f The View enables you to add PHPdoc blocks and if available Getters and Setters to any PHP
185. ble from the debug menu Click Finish The debug session will launch See Running and Analyzing Debugger Results for more information on running a debug session Tasks Debugging Profiling Events from Zend Server Zend Studio allows integration with Zend Server so that Zend Server Events can be viewed debugged and profiled in order to detect and locate errors and issues causing slow script execution Before debugging Zend Server events ensure the integration between Zend Studio and Zend Server is correctly configured as described in Setting Up Zend Server Integration To debug an event directly from Zend Server 1 Open your Zend Server Event List This can be done from within Zend Studio either through the Servers view or by selecting the server on which you have configured your Zend Server integration from the drop down list next to the Zend Server icon on the toolbar OR See Configuring Zend Server Settings in Zend Studio for more on configuring a Zend Server in Zend Studio 2 Access the Event list by browsing to the Monitor Events tab 3 Click the Event which you want to debug d Monitor EI Rute Management A Server Setup Dashboard Events Server info PHP info Logs 5 PHP Error Occurred once at 19 Feb 2009 17 25 URL hitpocalhost tissues php Function Name trigger_error Error String This is a user triggered error Last Time WER Function Data Request Server Backtrace 19 Fed 17 25 1 Function Name tri
186. can be displayed in Zend Studio s internal browser Each new item will be listed according to the RSS channel or time 2 Problems Tasks EI console RSS Ea p eT TY b Zend Developer Zone fa Zend In the Press Yahoo Acquisition Target Pioneers PHP Framework Use Zend Framework hits 1 0 milestone Zend Will Launch New Version of Web Development Program Coming Soon Zend PHP Framework 1 0 Zend Framework 1 0 Ready To Compete 176 Concepts WSDL Web Services Description Language WSDL Web Services Description Language is an XML formatted language used to describe Web service capabilities Web services are a standardized way of allowing applications to interface and share data across the network Web service messages are written in XML thus allowing for different applications in different programming languages to interface with each other WSDL files define how the Web services work and the operations they perform Zend Studio provides an integrated means for incorporating and inspecting WSDL files and a wizard for generating your own WSDL files 177 Zend Studio 7 User Guide Zend Studio for IBM i Extras The features listed below are only available in the Zend Studio for IBM i Zend Studio for IBM i contains additional extras to help you connect to and use IBM i functionality Zend Studio contains the following extras 1 The ability to register for a free Zend Studio for IBM i Edition license 2 Templates
187. cates how much of the code in both the original file and the test file was run The percentage in the Covered Lines column displays the percentage of lines executed out of the total number of executable lines The number of visited lines are the number of executable code lines The number of significant lines are the number of significant i e executable lines The number of total lines is the total number of lines in the file 9 Click on the code coverage statistics next to each file to open the Code Coverage view displaying the code with the lines of code that were run Visited lines will be highlighted in blue Significant lines will be highlighted in pink Once you have corrected errors you can re run the PHP Unit Test by clicking the Run Last Test button Rx in the PHPUnit view until all tests pass successfully 383 Zend Studio 7 User Guide w To Debug a PHPUnit Test Case 384 Ie 2 17 Problems F Tasks El Console S Open your PHPUnit Test Case file in the editor Click the arrow next to the Run button of on the toolbar and select Run As PHP Unit Test amp amp endash or from the Main Menu go to Run and select Run As PHP Unit Test amp Or to debug the PPHUnit Test Case click the arrow next to the debug button H on the toolbar and select Debug As PHP Unit Test amp amp endash or from the Main Menu go to Run and select Debug As PHP Unit Test s The PHPUnit view
188. ces in the Scope field Selects Enclosing projects in the Scope field Selects Working set in the Scope field Opens the Select Working Sets dialog Alt S Performs the search and shows the results in the Search View Alt Z Opens the Search Page Selection dialog and allows aa you to customize the search page 231 Zend Studio 7 User Guide Opening PHP Elements This procedure describes how to use the Open PHP Element function to navigate to a PHP element Class Function or Constant in an open project S To open a PHP Element 1 From the Menu Bar go to Navigate Open PHP Element or click the Open PHP Element icon on the Toolbar The Open PHP Element dialog will open 2 Enter the first few characters of the element which you want to open Resources that begin with those letters will appear in the Matching Resources pane listed alphabetically Open PHP Element Select from the list to open any character any string Fitter by type Vidasses Functions Constants Matching resources O IndexController in fabc application def ault cantroliersfIndexControber php Q indexController in ZendFrameworkExample appbcation controllers IndexController php 3 You can filter by element type class function or constant by marking unmarking the relevant checkboxes 4 Select the required element and click OK The file containing the element declaration will open in the editor wit
189. ces in the Eclipse Online Documentation Select Deselect Edit a working set For information about working sets see Working Sets in the Workbench User Guide 207 Zend Studio 7 User Guide You can also use the Open button drop down menu to open the resource in a PHP editor Text editor System editor n Place editor Default editor Other Opens the Editor Selection dialog and allows you to choose the editor either an internal editor or an external program to open your resource w Editor Selection Choose the editor for opening bootstrap inc O Internal editors External programs Eib Class File Viewer fin Class File viewer E C55 Editor ae Default Compare Editor DTD Editor f Ecore to Ecore Mapping Editor F Ecore to XML Mapping Editor B EMF Generator E HTML Editor BD Internal Web Browser 5 Select the resource and click Open The source code of the resource opens in an editor view The source of the resource is read only To edit a resource open the local project file in which it is located 208 Tasks Debugging and Profiling Zend Server Events Zend Server events can be debugged and profiled in Zend Studio either directly from Zend Server using Zend Server integration or by exporting an event from Zend Server and importing it into Zend Studio Importing xml Events Into Zend Studio Debugging Events from Zend Server Importing xml Events Into Zend
190. ck Browse The Select Folder dialog will open 268 Tasks Select foldat 5 Inthe Connection drop down list select your FTP SSH connection If you have not yet established a connection click New and follow the instructions under Creating an FTP SSH Connection Your FTP SSH file system will be displayed Select the folder you would like to link to your Workspace and click OK You will be returned to the New Remote Folder dialog New Remote Folder Remote Folder Create a ink to a remote folder resource Enter or select the parent folder MyProject i E jS MyProject Linkname ai Remote folder rse 10 1 2 241 deviaudool 9 The link name will be automatically be updated with the name of your folder Edit this if required 269 Zend Studio 7 User Guide 10 Click Finish Your FTP SSH folder and its contents will be added to your Workspace Most of Zend Studio s functionality such as Content Assist Formatting Outline Models and Getter and Setter Generation will be available to help you edit the file Any changes made to the files and folders in your Workspace will be updated in the FTP copy and conversely any changes made on the FTP copies will be updated in your Workspace Folders that are linked to FTP will be displayed with a linked connection icon Ga Deleting an FTP SSH folder from your Workspace will only delete it from your Workspace However deleting a file contained within a
191. ck Next If you would like to enable Tunneling mark the Enable Tunneling checkbox and enter the relevant information Specify Return Host If the debug session occurs on a node other than the central server unmark the checkbox and specify the IP address of the central server to which the tunnel will be opened Automatically Connect on Startup Send Authentication Information User Name and Password Reference See Setting Up Tunneling for more information 10 Click Finish Your new server configuration will be added to the server list and will be available for actions such as debugging profiling and Zend Server integration 609 Zend Studio 7 User Guide Tracer Preferences The Tracer Preferences page displays the ports that the Code Tracing functionality will use The ports that Zend Studio chooses by default should not be changed unless they are specifically blocked or in use by another application The Tracer Preferences page is accessed from Window Preferences PHP PHP Servers Tracer ar el ELE AW Tracer ele gt General a w Data Management Dynamic Languages Tracer View Port 10086 Field Assist Help Tracet listener settings ee Using Random Port DOC ee NC ECH Di Appearance O Using user specify Port 19333 Code Coverage Code Gallery Code Refactor Code Style Debug mm Editor New Project Layout PHP Executables PHP Interpreter PHP Libraries PHP Manual P
192. cking the Mark Occurrences icon on the toolbar z or pressing Alt Shift O When the Mark Occurrences feature is enabled the icon will be highlighted 2 Place your cursor on the required element in your file tryManager php P tryPerson php P 17 class_interfacep 3 ia Tm 1 lt php 2 class Person 3 public name 45 function doNothing 5 echo Too lazy e interface facingdAjob function dosSomething Ip g class ITperson extends Person implements facingAjob L20 function doSomethingi echo Oh nooo F H function doNothing manager new Person E developer new ITperson iz Ianev All instances where the element is referenced within the file will be highlighted and annotations will be displayed in the annotation bar See Mark Occurrences Preferences for information on configuring your Mark Occurrences settings 239 Zend Studio 7 User Guide Finding and Replacing This procedure describes how to do a Find and Replace for a string within a file wi To find and replace a string 1 From within the file press Crtl F or from the Menu Bar go to Edit Find Replace 2 A find and replace dialog will appear 3 Enter the required string to find 4 Enter the required string to replace it 5 If necessary configure the settings under the direction scope and options category 6 Click Replace The found string will be replaced by the n
193. cktrace Error Data 17 Jun 1712 1 Function Name conven TC Function Arguments 1 30 Zend Studio Diagnostics Debug Event Profite Event Show File in Zend Studio 12 Browse the Function Data and Request tabs to see the event details 13 Click Debug Event A debugging session is launched in Zend Studio using the same parameters as were used during the initial PHP error occurrence If no session is launched see Setting Up Zend Server Integration to ensure you have correctly configured your integration settings in both Zend Studio and Zend Server 14 Click Yes if asked to open the PHP Debug perspective The debug views display information about your code 15 Click the Resume button CG in the Debug view or click F8 to be taken to your problematic line of code Bictotconvertz phe O bebe break 2 4 4 4 4 44 function convertCTF degrees 4 result sprintf 80 2f tdegrees 9 5 32 iz 46 message S degrees deg Celsius is fresult deg Fahrenheit 47 printHessage message 17 4s 49 O function convertFTC degrees ESA EA Ce 32 j bvision d sult printf degres message S degreessdeg Fahrenheit is printMessage message e Zi Sresult deg Celsius 108 Getting Started 16 Click the Step Over button in the Debug view or click F6 A Debug Warning message appears in the Console view detailing the error and its cause El console 3
194. click and select New PHP Project The new PHP Project wizard will launch Enter the required information in the various fields To enable JavaScript support mark the Enable JavaScript support for this project checkbox i New PHP Project Create a PHP Project Create a PHP project in the workspace or in an external location Project name Contents Greate new project in workspace O Croate project from existing source Remote Server E Enable Remote Web Ste new 4beren pc Local C Documents and Settings mor g Desktop PHP Version O Use def ak PHP settings Use project speck settings PHP Verson PHP S I PHPS 2 e Project Layout Use project as source folder O Create separate folders for source files and public resources JavaScript Suppart 7 Enable JavaScript support for this project 450 Tasks 4 Click Finish A new PHP Project will be created with full JavaScript support You must now set the project s JavaScript Build Path in order for the required JavaScript libraries and files to be accessed by the project Enabling JavaScript Support for Existing PHP Projects JavaScript libraries and features can be added to existing PHP projects in your workspace To enable JavaScript Support for existing PHP Projects In PHP Explorer view right click the project for which you want to enable JavaScript support and select Configure Add Java Script Support JavaScript support will be enabled for the project
195. cognized as a task See the Tasks view topic in the Workbench User Guide for more information on using tasks Additional user guides can be accessed from inside Zend Studio by going to Help Help Contents or from the Eclipse Online Documentation site http help eclipse org ganymede index jsp The Task Tags Preferences page is accessed from Window Preferences PHP Editor Task Tags Task Tags pir Configure Project Specific Settings Strings indicating tasks in PHP comments The entry marked as default wil be used in the code templates Tag Priority D ay CS Ra d toma E Case senstive task tag names Restore Defauts Ca Four common strings are included in the list by default 589 Zend Studio 7 User Guide w To add a new Task Tag 1 Click New 2 Enter a tag name and priority High Normal Low Tags may contain any character string 3 Click OK 4 Click Apply to apply your settings The new tag will be added to the list and will trigger a task when inserted in the editor To edit a tag 1 Double click the tag or select it and click Edit 2 Edit the tag name or priority 3 Click OK 4 Click Apply to apply your settings Selecting a tag and clicking Default will set the task tag as the default one to be used in Code templates See the Templates Preferences topic for more on template preferences If the case sensitive task tag names checkbox is marked task tag names will be case
196. components in Custom mode If you choose not to install Zend Server make sure you install the following i PHP 5 ii Apache 2 iii Zend Framework files downloadable from http framework zend com download Make sure your php ini settings are properly configured as follows These can be configured through Zend Server or by manually configuring your php ini file Tasks If you are using Zend Server these settings should be configured by default i Your include path is pointing to your Zend Framework library e g C Program Files Zend ZendServer share ZendFramework library This is configured in the include_path directive In Zend Server this directive can be found under the Paths and Directories category in Server Setup Directives ii The session settings are configured to save path points to a temporary directory writable by the Web server e g C temp on Windows or tmp on UNIX Linux This is configured in the session save_path directive In Zend Server this directive can be found under the session category in Server Setup Directives iii PHP Short Tags are enabled This is configured in the short_open_tag directive In Zend Server this directive is on by default It can be found under the Language Options category in Server Setup Directives iv If you want to display errors set your display error setting to on This is configured in the display_errors directive In Zend Server this can found u
197. cript Build Path and click OK The Variable points to a folder To choose an archive inside the folder click Extend 5 Click OK You can choose to include or exclude specific resources or file name patterns from within source folders which you have added To include exclude specific resources from the JavaScript Build Path 1 Expand the node next to the folder from which you would like to include exclude resources A list of the resources which are included and excluded will be displayed by default all resources within the folder are included 2 Select the Included or Excluded list and click Edit The Inclusion and Exclusion patterns dialog is displayed 3 Click Add next to the Inclusion or Exclusion patterns panes The Add Inclusion Exclusion Pattern dialog is displayed 4 Enter or select the required resources pattern to Include Exclude and click OK 5 Click Finish All resources in the folder which match an Inclusion pattern but do not 458 Tasks match an Exclusion pattern will be added to the JavaScript Build Path JavaScript Libraries ER 4 BA bester o Global Supertype W Source Projects Source files and folders in the Gobal Scope se res Included srej H5 Excluded srcjtest Unk External Folder Add File From Filesystem R P Projects Tab The Projects tab allows you to select projects from your Workspace to add to the JavaScript Build Path JavaScri
198. crolls through the previous next edited Alt Rigt last edited file locations in all edited file in the current session 548 Reference Shortcut Description Keys Enable Creates a Tunneling connection Tunneling Click the arrow next to the Tunneling icon to select the server for which you want to enable a Tunneling connection Encode Project Encodes your project with Zend Guard with Zend This will only be available when Zend Guard Guard integration is enabled through the Zend Guard Preferences page 549 Zend Studio 7 User Guide PHP Preferences Below is a list of the different PHP preferences which can be configured To access this menu go to Window menu and select Preferences PHP Configures the display in PHP Explorer view ppearance Configure the display of elements in Outline views Code Coverage Preview code in the Code Coverage view with the current color and font settings Code Gallery Define and add code galleries Code Refactor Configure code re factoring preferences Code Style Expand the list to access the Code Templates and Formatter Preferences Code Templates Configure generated code and comments Set preferences for the auto formatter Debug Configure your debug preferences Installed Configure the settings for your installed debuggers Debuggers Step Filtering Configure the Step Filtering options when debugging Workbench Configure the workspace s behavior when a debug session i
199. ct 3 0 028747 0 036240 0 000116 0 085356 o geid 3 0 000004 0 000013 0 000000 0 000013 setFirstName 3 0 000016 0 000047 0 000000 0 000047 getFirstNome 3 0 000003 0 000009 0 000000 0 000009 setlastName 3 0 000005 0 000016 0 000000 0 000016 getlasthame 3 0 000003 0 000010 0 000000 0 000010 sethge 3 0 000006 0 000017 5 000000 0 000017 a netine 3 D eeng NANANA D reen Dez ad The window contains statistics relevant to each element as follows Function The name and location of the function Calls Count The number of times that the function was called Average Own Time The average duration without internal calls Own Time s The net process duration without internal calls Others Time s Time spent on calling other files Total Time s The total time taken to process Click the Show as percentage button on the toolbar to see the statistics as percentages rather than times Right clicking a function in the list gives you the option to Open Function Invocation statistics This will open a view with statistics about the selected function the functions it was invoked by and functions that it invoked 504 Reference Execution Statistics View Toolbar Commands ee eee Filters Click the arrow next to the icon to select to display only the results with Highest 10 own time Highest 10 calls Highest 10 total time Highest 10 average time Or No filter Click the icon itself or select Manage Fi
200. ct and from the menu bar go to Project Properties Refactoring History 4 Refactoring History Eet Refactorings affecting project abc i my SU Yesterday Dec 16 2008 Peemeeemn Gy 5 36 PM Delete resource Person 4 11 PM Rename Script project Calculator 1 Details Rename Script project Calculator 1 to People Original element Calculator 1 Update references to refactored element C Persist project refactoring history in project folder instead of workspace 634 Reference Run Debug Settings Properties The Run Debug Settings Properties page is not applicable for PHP projects 635 Zend Studio 7 User Guide Save Actions Properties The Save Actions Properties page allows you to remove trailing whitespace from a file each time you save it To access the Save Actions Properties page right click a PHP project in PHP Explorer view and select Properties Resource or select the project and from the menu bar go to Project Properties Save Actions Properties wi To configure Save Actions Properties for the project 1 Mark the Enable project specific settings checkbox 2 Configure the settings according to your preferences See Save Actions Preferences for more information on the settings available 3 Click OK to apply your settings Default Save Actions Properties for all projects can be set in the Save Actions Preferences page accessed by going to Window Prefer
201. ctions such as connecting to databases and creating PDF s into one easy to use application For more on using the Zend Framework example see the Zend Framework tutorial This is contained in a readme html file within the readme folder of the ZendFrameworkExample project To view the file right click it in PHP Explorer view and select Open With Web Browser For more information on Zend Framework see http framework zend com 520 Reference Allows access to all other types of items not in the main list To configure which items will be available from the main list go to Window menu Customize Perspective The options in the list are divided into categories Class Folder Interface Java Project Java Project from Existing Ant Buildfile Plug in Project General File Folder Project Remote Folder Unitled Text File Connection Profiles Connection Profile Connection Profile Repository CVS CVS Repository Location Projects from CVS Eclipse Modeling Framework EMF Model EMF Project Empty EMF Project Example EMF Model Creation Wizards Ecore Model Ecore to Ecore Model Ecore to XML Model XSD Model ZSD to Ecore Model Java Annotation Class Enum Interface Java Project Java Project from Existing Ant Buildlife Package Source Folder DBUnite Test Case Scrapbook Page JUnit Test Case JUnite Test Suite Serviet Test Case Java DbUnit DbUnit Test Case Java Emitter Templates Convert Projects to JET Projects JavaServe
202. cursor at the marked by Location_1 This is within function media 52 Getting Started 3 Type the letter m The Content Assist window will be displayed with the variables messenger and music which were defined within the function Note that the variable Small not within the scope of media is not available Next place the cursor at the marked by Location_2 Type the letter m The Content Assist window will be displayed with the variable mail which is within the same file Note that media s variables music and messenger are not within the function media and so are not displayed 6 Select mai from the Content Assist window to insert it into the script Added Code Available Within the Same Project Code elements defined in one file are also available for use by other files within the same project S The following steps demonstrate using Content Assist for inserting elements within the same project 1 Within the same project as File1 create a new PHP file called File2 2 On the line beneath the opening PHP tag type def and press Cirl Space to activate Content Assist Double click one of the define options 3 Between the parentheses type cont and press Ctrl Space to activate Content Assist The element Content defined in File1 will be available 4 Double click continent to enter it into your code When the element is highlighted Content Assist displays the original location of
203. d Average Own Time The average duration without internal calls Own Time s The net process duration without internal calls Others Time s Time spent on calling other files Total Time s The total time taken to process IT Profiler Information A Execution Statistics 5 i Execution Flow CX Code Coverage Summary o SE WH e Function Cals Court Average Own Time Own Time s Others Time s Total time s B tryPerson php 0 18070 man 1 0 180701 0 180701 0 036728 0 267429 F Person php 0 086728 5 D Person 0 086722 __construct 3 0 028747 0 036240 0 000116 0 085356 o getid 3 0 000004 0 000013 Dog 0 000013 setFrstName 3 0 000016 0 000047 0 000000 0 000047 o getFirsttiome 3 9 000003 9 000009 0 000000 0 000009 setLastName 3 0 000005 0 000016 0 000000 0 000016 e getiasthame 3 0 000003 0 000010 0 000000 0 000010 e sethge 3 0 000005 0 000017 9 000000 0 000017 m oet oe 3 D DNA NAAN nan bh CCOk Si Click the Show as percentage button on the toolbar to see the statistics as percentages rather than times Right clicking a function in the list gives you the option to Open Function Invocation statistics This will open a view with statistics about the selected function the functions it was invoked by and functions that it invoked 152 Concepts Execution Flow view Shows the flow of the execution process and summarizes percentages and times spent on each function Function
204. d Covered Lines Visited Significant Total Percentage of lines covered within each file Visited Number of lines covered Significant number of lines that were significant to the function call Total Total number of lines in the file ED Profiler Information a Execution Statistics i Execution Flow Element Covered Lines Visited Significant Total te Profile Project 2 68 39 57 72 P Person php 63 31 49 62 war P tryPerson php 100 8 8 10 du Show Code Coverage Clicking on the Covered lines percentages will open an editor containing the file with the covered lines highlighted ij Profiler Informatio 7 Execution Statistic d Exeastion Flow CS Code Coverage S cy Sp _ Pesaro ys SS Saas private lastName private fage 3 private gender private static SpersonId 1 public static personCount O conscractor function construct newFirstNeme nevLastNeme nevage new this gt id Person personId this gt setFirstName nevFirstName this gt setLastName newLastName this gt setage newAge this gt setGender newGender Person personid Person personCount v lt mm gt The Code Coverage Summary view is displayed by default as part of the Profiling Perspective To manually open the view go to Window Show View Other PHP Profiler Code Coverage Summary 508 Reference Zend Server Code Tr
205. d click Edit The Edit External folder dialog will open 3 Select the folder that contains the user library content or create a new folder by clicking Make a New Folder 4 To apply changes click OK You have now edited your user library s URL which will import the content from the proper location on the disk If the imported location of the selected file you are editing is different than the new location the new location will overwrite it 366 Tasks Editing PHP User Libraries This procedure describes how to edit user libraries You will need to edit a user library when you would like to change it s name Changing a library s name allows you to create descriptive differentiations between your libraries In order to edit a library there must be libraries available For more information see Importing User Libraries or Adding a PHP Library w To edit a user library 1 Go to Window Preferences PHP PHP Libraries 2 Inthe PHP Libraries Preferences page select the user library you would like to edit and click Edit The Edit User Library dialog will open Enter the user library name in the User Library Name text field In order to add the given user library to your environment you must select the Add to environment box Otherwise your library will be added on a project level 5 To apply changes click OK You have now edited your user library To edit a folder within your library see Editing Library Components
206. d only PHP breakpoints will be displayed Go to File for Breakpoint Opens the resource in which the breakpoint is located Skip All Breakpoints If selected all breakpoints will be skipped and execution will not stop F Expand All Expands all items in the list z Collapse All Collapses all items in the list Link with Debug View If selected clicking a breakpoint will link with the Debug view 496 Reference Breakpoints View Menu Commands The view s menu can be accessed through the view menu icon Group By Breakpoints Breakpoint Types Breakpoint Working Sets Files Projects Resource Working Sets Advanced Select Deselect Allows you to choose the default Default breakpoint working set from the Default Working Set Working Set dialog Working Sets Opens the Working Sets dialog The Breakpoints View PHP Debug Perspective is displayed by default as part of the Debug Perspective To manually open the view go to Window Show View Other Debug Breakpoints 497 Zend Studio 7 User Guide Parameter Stack View PHP Debug Perspective The Parameter Stack view displays the parameters executed when stepping into a function during the debugging process s tnewLastName string 6 Bloggs newAge int 35 z newGender string 4 male The following information can be gathered from the Parameter Stack view Called Parameters The called parameters as written in the line or cod
207. d by access rules are not displayed Hide deprecated references If enabled references to deprecated JavaScript elements are not displayed Auto activation Enable auto activation If enabled the Content Assist list will automatically be displayed when the first letters of an element are typed If this is unmarked you can display the Content Assist list by pressing Ctrl Space Auto activation delay Determines the delay before the Content Assist box is automatically displayed Auto activation triggers for JavaScript Sets the characters that determine JavaScript context Auto activation triggers for JSDoc Sets the characters that determine JSDoc context 3 Click Apply to apply your settings 464 Tasks Using JavaScript Syntax Coloring JavaScript Syntax Coloring can be applied to JavaScript code within a PHP file or a JavaScript file To enable JavaScript syntax coloring Enter the relevant JavaScript tags KI lt HTML gt lt script type text javascript gt lt script gt lt HTML gt Any code enclosed in the JavaScript tags will have Syntax Coloring applied to it according to the configuration in the JavaScript Syntax Coloring Preferences page lt HTML gt lt script type text javascript gt Fi t This is a multiple line comment f var index 0 var arr UI function pushielem f f This comment may span only arr index elem this line lt script gt lt
208. d files from it and commit changes which you have made to files Contents Purpose Adding Files to Existing Projects Adding a CVS Repository Making Changes Comparing Changes and Committing Changes Sharing Projects Replacing Files with Older Versions Checking Out Projects from CVS Deleting Files from CVS Purpose A Concurrent Versions System CVS repository is a source control system intended to allow a team or group to work on the same files and projects simultaneously and to be able to revert file and project states back to previous versions 55 Zend Studio 7 User Guide Adding a CVS Repository Before you can add projects to or export projects from CVS you must define your CVS repository settings To access a repository make sure that a CVS server is already configured This procedure describes how to create a CVS repository connection which you can access in order to be able to carry out CVS functionality To create a new CVS repository connection 1 Open the CVS perspective by going to Window menu and selecting Open Perspective Other CVS Repository Exploring 2 Click the Add CVS Repository button H on the view s toolbar or right click within the CVS view and select New Repository Location The Add CVS Repository dialog will open Add a new CVS Repository Add a new CVS Repository to the CVS Repositories view CNS 56 Getting Started 3 Enter the information required to identify and connect to
209. d for JavaScript elements if JavaScript support was enabled for the project See Enabling JavaScript Support in PHP Projects for more information JavaScript hover settings can be configured from the JavaScript Hovers preferences page accessible by going to Window Preferences Web JavaScript Editor Hovers 130 Concepts Override Indicators Override Indicators are markers that display special decoration icons to indicate methods that override or implement other methods from a super type s class interface The override indicators will be displayed as triangles in the marker bar the vertical ruler to the left of the editor next to the method s definition P OverrideIndicators php 3 function methodToOverride echo Overriding function abstractMethod echo Implement abstract method Green triangles indicate an overridden method while a white triangle indicates an implemented method Hovering over a triangle displays a tool tip that reveals the overridden or implemented method s super type Clicking the triangle will open the type in an editor o b o gt overrides ForExtending methodToOverride He ty Note Markers will not be displayed if the methods do not comply with the overriding rules These are as follows You cannot override a non static method with a static method The overriding method must not be more restrictive than the overridden method
210. d like to add and click OK The library name will be added to the User Libraries list This is just a placeholder name to which you will add the required files in order to create your own library iv Select the name from the list and click Add Isi v In the js File Selection dialog browse to the required JavaScript files on your file system and click Open vi The JavaScript files will be added to your User Library 454 Tasks 4 User Libraries GEN EE number of external JavaScript source files Defined user libraries vii Click OK to return to the User Library selection list 4 Mark the checkbox of the User Library you would like to add to the project s Build Path and click Finish The User Library will be added to the project s JavaScript Libraries Build Path list To add a library folder from your Workspace to the JavaScript Build Path 1 Click the Add a Library Folder button The library folder selection dialog will display a list of available folders 2 Select the required folder s and click OK 455 Zend Studio 7 User Guide Global SuperType Tab The project s Global Scope contains all the objects fields and functions contained in the libraries which have been added to the JavaScript Build Path Elements in the Global SuperType will be available to all PHP and JavaScript files within the project JavaScript Libraries gt BA Ubraries p Global SuperType L Source Le Projects Project
211. d within each file Visited Number of lines covered Significant number of lines that were significant to the function call Total Total number of lines in the file EB Profiler Information E Execution Statistics kd Execution Flow E Element Covered Lines Visited Significant Total a Profile Project 2 68 39 57 72 P Person php 63 31 49 62 P tryPerson php 100 8 8 10 i 153 Zend Studio 7 User Guide Clicking on the Covered lines percentages will open an editor containing the file with the covered lines highlighted private lastNeme private Sage 3 private gender Private static Spersonid 1 public static personCount O 154 Concepts Breakpoints Breakpoints allow you to set places in the code at which the debugging process will pause Setting a breakpoint in your script will cause the debugger to stop at the specified line allowing you to inspect it Breakpoints are represented by a blue ball in the vertical ruler to the left of the editor During the debugging process breakpoints can be monitored in the Breakpoints View Conditional Breakpoints Conditions can be added to breakpoints so that the debugger will only stop at them under certain conditions These can be any valid boolean expressions Conditions can be added to breakpoints through the PHP Conditional Breakpoints Properties dialog Conditional Breakpoints are represented by a blue ball with a
212. d your remote server KY To activate Tunneling in Zend Studio 1 Click the arrow next to the Tunneling icon on the toolbar F and select the server which you configured for tunneling AT y Local Zend Server disconnected Servers 2 The tunneling icon will turn green to show that a tunneling server is connected You can now debug profile on the selected remote server Several Tunneling sessions can be configured in Zend Studio Therefore If the debug session is not working check to see that the Tunnel to the correct server is connected by clicking on the z 7 drop down arrow next to the Tunneling Icon and verifying that the name of the connected server is correct 346 Tasks Troubleshooting the Communication Tunnel If Zend Studio is unable to connect to the target server you will get an error message with the response from the server The table below describes the most likely causes and a recommended action for successfully establishing a connection with the target server Possible Cause Recommended Action Kee The server address you entered is Enter the correct server information in the HTTP authentication is required Enter authentication information in the Tunneling Settings dialog box then click the Send authentication information checkbox The dummy file content or location The dummy file on the server side was either on the server is incorrect changed or does not exist You will need to ensure th
213. de Refactor Sec Y X G a shir Refactoring settings For PHP element name changes Data Management Dynamic Languages Field Assist Help Install Update PHP Appearance Code Coverage Code Gallery Code Refactor Code Style Debug Editor New Project Layout ES 75 Restore Defaults Apply ng CS E Refactoring Options Rename in editor without dialog H ii w To configure your Code Refactor settings 1 Mark the Rename in editor without dialog checkbox to enable you to rename elements in the editor rather than through the refactor dialog 2 Click Apply to apply your changes 558 Code Style Preferences Reference Code Templates Preferences The Code Templates Preferences page allows you to configure the code and comments that are automatically created for different types of elements The Code Templates Preferences page is accessed from Window Preferences PHP Code Style Code Templates Preferences Code Analyzer Code Coverage Code Gallery Code Refactor Code Style Code Templates Formatter Debug Editor New Project Layout PHP Executables PHP Interpreter PHP Libraries PHP Manual PHP Servers PHPUnit Semantic Analysis Zend Guard H Remote Systems RSS Atom Channels E Run Debug E Server J Tasks 4 Team Validation Web Web Services Code Templates Gr Confiqure Project Specific Settings Code Templates Configu
214. dio communication settings for the Zend Browser Toolbar in order to be able to debug profile KY To manually install the Zend Firefox Toolbar 1 Go to the Zend Studio downloads site http www zend com en products studio downloads and download the cross platform Firefox Browser Toolbar 2 Open the downloaded xpi file by going to Flle Open File from the Firefox menu bar and browsing to the downloaded file 3 A prompt will be displayed asking whether you trust the add on Software Installation Only install add ons from authors whom you trust Malicious software can damage your computer or violate your privacy You have ashed to install the folowing Rem ZendFirefoxToolbar 2 1 xpi_ Author not versed File IC Documents 20and Yo 20Settings heren s Desktop Zend 20Installations T Los 4 Click Install Now The add on will be displayed in the Firefox Add ons list Add ons A amp 809 Extensions Themes Page Updates Installation Restart Frefox to compete your changes tr B Zend Studio Toolbar 2 1 Restart to compl te the update 330 Tasks 5 Click the Restart Firefox button Firefox will be restarted and the toolbar will be loaded 6 If the Toolbar is not automatically displayed select the Zend Studio toolbar from Firefox s Toolbars list In Firefox 3 the Toolbar list is available from View Toolbars You should now configure the Zend Studio communication settings for the Zend Brow
215. dio downloads Debugging a PHP File Locally Files can be debugged using Zend Studio s internal debugger J This procedure demonstrates how to debug a file using the internal debugger or your server s debugger 1 Inside a PHP project create a PHP file called debug and copy paste the example code into it See the Working with the Debugger Tutorial in Zend Studio s Online Help for the example code 2 Seta breakpoint at line 103 by double clicking the marker bar to the left of the editor window A blue ball will appear 3 Save the file 4 Click the arrow next to the debug button E on the toolbar and select Debug Configurations or select Run Debug Configurations from the main menu or right click the file in PHP Explorer view and select Debug Configurations A Debug dialog will appear 5 Double click the PHP Script option to create a new debug configuration 71 Zend Studio 7 User Guide Name New_configuration 3 PHP Script _ PHP Script Arguments PS Environment Common Debugger Location PHP executable PHP Debugger Zend v PHP Executable PHPS C Zend Deviworkspace org zend php debug d Y PHP Executables O PHP Web Server ef ault PHP Web Server PHP Servers PHP File Breakpoint Break at First Line Enter a name for the new configuration To debug the file using Zend Studio s PHP Executable debugger s
216. dow Preferences General Editors Text Editors Annotations Tasks Opening JavaScript Types The JavaScript Open Type functionality allows you to search for any JavaScript type in your workspace and opens an editor with the type s declaration wi To open a JavaScript Type 1 Open the JavaScript Perspective by going to Window Open Perspective Other Javascript 2 Click the Open JavaScript Type cs icon on the toolbar or from the menu bar go to Navigate Open JavaScript type The Open JavaScript Type dialog will open 3 Enter the first few letters of the class which you would like to open You can also use wildcards such as or or camel case The list of available types will be filtered to match the expression you are entering If you have previously opened a Type which matches your expression this will be displayed first above a separator line Open JayaScript Type Enter type name prefix or pattern or camel case pt Matching items GQ DateTextBox C Zend Dey runtime New_configuration smetadata plugins or ork eoace Mtateliss a ee Q DateTextBox C Zend Dev runtine New_configuration metadata plugins or Q dojox arid editors DateTextBox Q DocumentType Q Documentype ICH es gt C Zend Dev runtime New_configuration ojo_library dijit form DateTextBox js e 4 Select the required class and click OK An editor wil
217. e The Main Calling Line of Code The line number in which the calling statement occurred in parentheses Parameter Values Shows the parameter values that were passed in the function call The Parameter Stack View PHP Debug Perspective is displayed by default as part of the Debug Perspective To manually open the view go to Window Show View Other PHP Tools Parameter Stack 498 Reference Expressions View PHP Debug Perspective The Expressions view will not open by default when a debugging session is launched but only when you have selected to watch a variable or create a watch expression To watch a variable right click a variable in the editor or from the variables view and select Watch or Add Watch Expression The Expressions view will open and the variable will be added to it The variable s information will be updated as the debugging process continues To manually open the Expressions view go to Window Show View Debug Expressions The Expressions view allows you to monitor certain variables which you have decided to watch during the debugging process Selecting a variable will display details in the detail pane below the view Expanding the list under a variable will display its fields D Variable Zo Breakpo Parame ES a EI t eo RW SY GET Array 7 use remote string 1 1 debug_port string S 10137 gt start det string 1 1 debug_start_session string 1 1
218. e to save the edits made to the file Changes will be updated in the file accessible through Zend Guard Once you have made the required edits click Save on Zend Studio s Menu Bar 425 Zend Studio 7 User Guide Working with WSDL Using Zend Studio you can reference and view existing WSDL files in your PHP Code See Incorporating WSDL Files for more on referencing WSDL files in your code 426 Tasks Incorporating WSDL Files Incorporating a WSDL file is the process of taking a service or services from an existing WSDL file and integrating their capabilities functions into your PHP code To reference a WSDL file and benefit from full integration into Zend Studio code completion and function display in the PHP Project Outline tab the file must be present in your local file system Method 1 or can be referenced by using the WSDL file s URL Method 2 w To create a SOAP Client Method 1 1 Use an external browser to open the URL 2 Save the contents of the URL as a WSDL file e g C GoogleSearch wsd 3 Create the soap client by referencing the WDSL file in your PHP script e g a new SoapClient C GoogleSearch wsdl The WSDL file s methods classes functions etc will now be available in the Code Assist Menu and the SOAP Client now appears in the PHP Project Outline tab y To create a SOAP Client Method 2 1 Create a new SoapClient instance in your PHP code containing the URL of the WSDL file which yo
219. e Click OK An XML file will be created with the required settings PF oO DP 569 Zend Studio 7 User Guide wi To apply Formatter settings to a specific project only 1 Select the link labelled Configure Project Specific Settings 2 Select the required project from the list A Formatter Properties dialog will appear 3 Select the required settings and click Apply A prompt dialog will appear stating that a rebuild of the project must occur for the settings to take effect 4 Click Yes to rebuild the project Or Click No for a rebuild to be performed only when Zend Studio is restarted Or Click Cancel to cancel the operation 570 Reference Debug Preferences The Debug preferences page allows you to configure default settings for the debugging process The Debug Preferences Preferences page is accessed from Window Preferences PHP Debug Preferences PHP Debug Se Configure Project Specific Settings Default Settings PHP Debugger Zend Debugger EN Configure Server Default PHP Web Server x PHP Servers PHP Executable PHP 5 2 10 CGI el PHP Executables Encoding Settings Debug Transfer Encoding UTF 8 lv Debug Output Encoding UTF 8 lv Break at First Line Restore Defaults Apply 571 Zend Studio 7 User Guide The settings that can be configured from the debug preferences page are Default Settings PHP Debugger The default debugger is the Zend
220. e e 265 Zend Studio 7 User Guide 6 Enter the following Remote FTP SSH connection details Parent Profile Select a Profile from the drop down list Host Name Enter a valid Host name or IP address for the FTP SSH Server Connection name Enter a Connection Name A Connection Name is an alias that identifies the server in the Zend Studio file system Description Enter a description to help identify your connection optional Verify host name Mark the checkbox for Zend Studio to verify the existence of the host name before the connection is created 7 Click Finish Your connection will be created and listed in the Remote Systems view For information on editing the default port of your FTP SSH connection see Editing the Default Port of an FTP SSH Connection Editing the Default Port of an FTP SSH Connection This procedure describes how to edit the default port of an FTP SSH connection In order to edit the default port you must have an FTP SSH connection set up For more information see Creating and FTP SSH Connection S To edit the default port of an FTP SSH connection 1 Open the Remote Systems view by going to Window Show View Other Remote Systems Remote Systems Remote Systems Select the Files sub folder of the connection From the right click menu select Properties Subsystem The Subsystem dialog opens 4 Inthe Port text field edit the port number If the Port text field does not allow y
221. e last build This is only available if automatic build is not selected see below pee i Invokes a clean build This will discard all previous build 536 Reference i Performs an incremental build whenever resources are Automatically saved Selecting this option will disable all other manual build options The build function can be configured by selecting General Workspace from the preferences dialog Windows Preferences Zend Tool Ctrl 2 Opens the Zend Tool Floating WIndow for executing Zend_Tool commands See Using the Zend Tool Console more information Generate PHPDoc Creates a PHPDoc from your projects or files A PHPDoc is an online document organized in a book format allowing easy viewing of all elements within your code Properties Opens the project s properties dialog which allows you to view and configure various settings for the project including resource information Builders Code Analyzer Properties Formatter Includes Mapping PHP Debug PHP Include Path PHP Interpreter PHP Java Bridge PHP Task Tags Project References Run Debug Settings Task Tags and Validation See PHP Project Properties for more information on all the properties available for a PHP project Encode a Encodes the selected project using Zend Guard Project This option will be enabled once Zend Guard is installed and configured in Zend Studio Zend Guard integration can be configured through the Zend Guard prefere
222. e 386 Running a PHPUnit Test Suite eccccccccececeeeeee cee eecaaeeeeeaeeeeeeeceaeeeseaeseeeeeseaeessaeeseaeseeeees 387 Reporting on PHPUnit Test Results 200 0 ee ecceeeeenneeeeeenaeeeeeeaaeeeeeeaaeeeeeeaaeeeseeaaeeeeeenaeeeenenaes 388 Using RETACtONING DEE 390 Renaming e E 391 Renaming Element orson araa a ET AN A AA 393 MOVING Hai 397 Extracting Variables serao aE E E AE Deeg 399 Extracting Mehods airesin naana a E E EI E AAE 401 Generating Getters and Setters cccccceceseceeeeeceeeeeceaeeeeaaeeeeeeeeaeeesaaeeecaaeseeeeeseaeeeseaeeseeeseneees 402 Overriding Implementing Meibocde 405 Greating a PHPDOC EE 407 Greating HTML lee geegent oa roe Sle ede Eet 410 Using Code Galleries s 22 c00 ie ee is a a A ve ee ee 411 Inserting Code Snippets into your Script 412 Creating and Editing Code Gallery Entries 00 cc cccseeeeececeeeeeceeeeeeaeeeeaeeseeeeeseaeeseaeeeeneeees 413 Interacting with Code Gallery Sites 0 c cccceeeesceceeeeeeeeeeeeaaeceeeeecaeeeeaaeseeeeeseeeeesaeeeeaeeeenees 415 Configuring Studio Communication Settings in Zend Geer 418 Defining Zend Server in Studio AANEREN 420 Integrating with Zend Guala deed deed tenan aaiae aae aaneees dan EEN ences 421 Encoding Projects Using Zend Guard 422 Opening and Editing Zend Guard Projects in Zend Studio ccceeececeseeeceeeeseeeeeeseeaeens 425 Working with WS isseire anniren Seteaeeteen E d se Deg beac ties Reie E eth eh
223. e Build Path by default e Create separate folders for source files and public resources Separate folders will be created in which you can place resources which should be included or excluded from the Build Path See Configuring a Project s PHP Build Path for more information The default setting for this option can be configured from the New Project Layout Preferences page JavaScript Support Mark the Enable JavaScript support for this project checkbox for JavaScript functionality e g JavaScript Content Assist options to be available to the project See Enabling JavaScript Support in PHP Projects for more information 3 Click Next to configure the project s Include Path this can also be done following the project creation 4 Click Next to configure the project s PHP Build Path this can also be done following project creation 5 Click Finish The new PHP project will be created in your workspace and displayed in PHP Explorer View You can now start to develop your application by creating PHP Files or adding other resources to your project 189 Zend Studio 7 User Guide Creating PHP Files PHP files can be created and opened in Zend Studio in a number of ways Creating a new PHP file associated with a project Creating a new PHP file not associated with a project Opening an external file Creating a PHP File within a Project This procedure describes how to create a new PHP file within an existing project y T
224. e Menu Bar select Debug Debug URL The Debug URL dialog will appear Enter the URL of the file application which you would like to debug Select whether to use the local copy or server copies of the files Click OK Getting Started Zend Studio 7 x Click the Debug URL button 2 on the main toolbar or go to Run Debug URL The Debug URL dialog will appear In the Open Browser at field enter the URL of the first page that should be debugged 3 Click Debug In Zend Studio 7 x creating a Debug launch configuration gives you access to advanced Debugging options and allows you to easily re run past Debug sessions using the same settings To create and execute a Debug Launch Configuration for debugging applications on a server 1 Click the arrow next to the debug button E on the toolbar and select Debug Configurations or select Run Debug Configurations A Debug Configurations dialog will open Double click the PHP Web Page option to create a new debug configuration Enter a name for the new configuration Select your server from the PHP Server drop down list Under PHP File click Browse and select your file Select the Advanced tab In the Source Location category select whether to use the local copy or server Zend Studio 7 User Guide Zend Studio 5 x Zend Studio 7 x copies of the files 8 Click Apply and then Debug The next time you want to run this debug session click t
225. e New Project Wizard Imports the project as a new PHP project into your workbench with the project s existing name Find projects in the children of selected resource Imports all folders within the project as separate projects Check out as folder into existing project Imports the project as a folder into an existing project in your workbench 251 Zend Studio 7 User Guide Check out as project with the name specified Imports the project as a new project into your workbench with a new name Specify the new name in the box To enable all Zend Studio s PHP functionality for the imported projects select the Check out as a project configured using the New Project Wizard option and ensure you create the new project as a PHP project 8 Click Finish The project will now be imported into your workspace Note that the project will have an CVS repository icon Ef in your PHP explorer view Once you have imported a project from CVS into your workspace you can now add files edit existing files and commit your changes to the CVS repository Projects can also be checked out from CVS through the CVS Repository Exploring perspective accessible from Open Perspective Other CVS Repository Exploring Simply right click the project in CVS Repositories view and select Check Out or Find Check Out As See Checking out a project from a CVS repository in the Workbench User Guide for more information Additional user guides can
226. e auto activation checkbox 51 Zend Studio 7 User Guide Function Parameter Hints When entering a function call a Function Parameter Hint box will be displayed detailing the types of parameters that should be entered within the parentheses of the function call IS The following procedure demonstrates using the Function Parameter Hint feature 1 Place your cursor between the parentheses of the above function call define 2 Press Cirl Shift Space A function parameter hint box will be displayed indicating the types of parameters that should be inserted between the parentheses lt php string name mixed value boolfoptional case_insensitive null define gt Making Content Assist Elements Available Within the Same Scope Added Code Available within the same function and file Elements within the same scope e g within the same project file or function will be available for use with Content Assist Variables belonging to different scopes are not available to each other via Content Assist ey The following procedure demonstrates using Content Assist for inserting elements within the same function and file 1 Edit your PHP File File1 so that it contains the following code lt php der sine eon slineioe H Neuer o Seege Viz Smail int eclipse org function media Smusic Smessenger S Ibeesr Zem ei S An Ioxe ne zent Se B 2 Place the
227. e contents of a database table Zend Studio 5 x Zend Studio 7 x Connect to your SQL database server Connect to your SQL database server by following the steps under To connect by following the steps under To connect to your SQL database server above to your SQL database server above Expand the server tree until you see the Expand the server tree until you see the required table required table Double click the table or right click the Double click the required table or right table and select Show Table Data click it and select Data Edit In the Results in Page selector at the The table will open in a database editor top of the Data Display select the displaying all the data within the table number of results you wish to display per screen The Data Display will show the contents of the table according to the selected resolution See Viewing and Editing Database Table Content for more information 45 Zend Studio 7 User Guide Tunneling Zend Studio 7 x allows you to define tunneling connections to a number of servers which can then be easily selected to establish a connection To select a server to connect to using a tunneling connection define the server following the instructions below click the arrow next to the tunneling icon on the toolbar E and select the required server from the list To configure tunneling preferences in Zend Studio Zend Studio 5 x Zend Studio 7 x 1 Go to Tools Tunnelin
228. e dialog select Use project name as module name Click Next o D Jo pm RA Depending on your authentication settings a dialog might appear asking you to provide authentication information Re enter your password and click Next Mark the Save Password checkbox to 57 Zend Studio 7 User Guide ensure that this screen does not reappear The Share Project Resources dialog will open Your project will be displayed as a resource that is to be added to CVS The purple plus icon EP indicates that these are new files that have not previously been added to CVS Click Finish A Commit dialog will open Enter the comment I am uploading files to CVS and click OK In PHP Explorer View your project will now have a repository icon f indicating that it is in CVS Once you have committed your files other team members will be able to access and change the files The instructions below explain how users can check out import projects from CVS edit them and upload their changes Checking Out Projects from CVS Once projects are placed on the CVS repository they can be checked out imported by anyone with access to that repository w This procedure demonstrates how to import check out projects from CVS into your workspace d o mr o bh 7 8 Delete the MyCVS Project from your workspace in order to simulate being a new user who has not previously had access to this file Note Deleti
229. e file was called Files that are open in a Zend Studio editor If the debug profile session was triggered from the Zend Debugger Toolbar all files in the Workspace with the same name will be listed D Path Mapping Select Local Resource The dialog will not appear if a Path Mapping to the called location has already been defined 159 Zend Studio 7 User Guide Selecting a file from the list results in a Path Map being created between the called remote file s parent folder and the parent folder of the similar file selected from the list This means that every time a file is called from the same parent folder it s content will be taken from the file situated in the selected Workspace local folder If none of the options in the Matching items list represent your desired file location you may select the Get content from the server for the following path option This means that whenever this path is called during the debugging profiling process it will only be searched for on the server This is done using PHP s search mechanism see http il2 php net manual en function include php for more information You can click Configure to modify the path to include any parent or child directories Selecting the Get content from the server for the following path option will only affect the current Debug Profile session No Path Mapping will be defined 160 Concepts Zend Browser Toolbar The Zend Browser Toolbar is a
230. e information If you have already configured a CVS connection mark the Use existing repository 253 Zend Studio 7 User Guide location option and select your repository from the list Click Finish Depending on your authentication settings a dialog might appear asking you to provide authentication information Enter your password and click Next Mark the Save Password checkbox to ensure that this screen does not reappear A Commit dialog will open 9 Enter a comment if required and click OK Your project will be uploaded to the CVS repository Your project will have a repository icon K next to it in PHP Explorer view indicating that it is linked to an CVS repository Your can now perform all CVS functions commit update etc on this project 254 Tasks Uploading Projects to CVS Using CVS you can upload projects and files which other team members can work on This procedure describes how to upload a project to your CVS repository location Prerequisites You should have an CVS repository configured before you follow this procedure See Configuring a CVS Connection for instructions S To upload a project to an CVS repository 1 In PHP Explorer View right click your project and select Team Share Project A Share Project dialog will open From the repository list select CVS and click Next Select Use existing repository location and select your repository from the list If you have not yet configured a CVS repo
231. e project will be created on your Zend Server s document root Diagnosing and Profiling Performance Issues on Zend Server Zend Server detects performance issues in your code and stores them as events These events can then be profiled to diagnose the cause of the slow performance KY This procedure creates a purposeful performance issue in order to demonstrates how to profile an event 1 Create a new PHP file in the project you created above by right clicking the project in PHP Explorer view and selecting New PHP File Name the file c to f_convert php and click Finish Copy paste the example code into the file See the Working with Zend Server Tutorial in Zend Studio s Online Help for the example code 4 Save the file Run the application you created by right clicking the c to f_convert php file in PHP Explorer view and selecting Run As PHP Web Page The Run PHP Web Page dialog is displayed 6 Ensure the URL in the Launch URL field points to the location of your file on Zend 102 Getting Started Server and click OK The application is launched in Zend Studio s browser U o Bictot sorwer sho Sgebegengte 3 a tp flocalhost ZendServerProfiing to f_convert2 php v E Fahrenheit Celsius PHP Convertor Enter number of degrees Celsius to Fahrenheit In the temperature field enter 30 and click the Convert button Because the code used for this application contained a purposeful slowdown
232. e received from i5_jobLog_list function 5 Closes connection to i5 server i5ObjectListing Enables getting an array with the message element for an object list entry Connects to i5 server Opens object list Gets for a object list entry Closes handle received from i5_objects_list function Closes connection to i5 server is5Program Enables calling a program and accept results from it Connects to i5 server Opens a program or service procedure and prepares it to be run Calls the program and optionally accepts results Free program resource handle Closes connection to i5 server i5ProgramService Creates Web Services class enabling invoking an RPG program Connects to i5 server Opens a program or service procedure and prepares it to be run Calls the program and optionally accepts results 180 Concepts IBM i Template Explanation 4 Free program resource handle 5 Closes connection to i5 server Enables getting spool file data from the queue and getting the i5UserSpaceCreate i5UserSpaceDelete i5UserSpaceGet i5UserSpacePut Content Assist data from the spool file 1 Connects to i5 server 2 Creates an pool file lists of certain output queue or for all queues Gets spool file data from the queue Get the data from the spool file Free spool list resource Closes connection to i5 server Creates a new user space object 1 Connects to i5 server 2 Creates new user space object 3 Closes connection to i5 ser
233. e server see Setting Up Remote Debugging 6 To check whether your server connection is correctly configured and that Zend Studio can communicate with your server debugger click the Test Debugger button Under PHP File click Browse and select the file which you would like to run The URL to be run will have been automatically created based on the file name and your server address If the URL does not point to the file s location unmark the Auto Generate checkbox and modify the URL The file to be run needs to exist on the server even if you are going to be selecting to run the local copy of your files 9 For further options select the Advanced tab Session Settings E Open in Browser Debiig At Page Dabur esl Mage Ory Source Location The source files used during this session will be taken from O The Server Local copy if available Otherwise the Server 9 Under the Source Location category you can choose whether the content of the files to be run will be taken from the server or from your workspace If a local copy is not available files will be taken from the server Selecting the Local Copy option will result in the Path Mapping mechanism being applied when files are called See the Path Mapping topic for more details The file to be run needs to exist on the server even if you are going to be selecting to run the local copy of your files 313 Zend Studio 7 User Guide 10 Clic
234. ebug dialog will open 4 Double click the PHP Script option to create a new debug configuration Name New_configuration PHP Script gt PHP Script Arguments BG Environment E Common Debugger Location O PHP executable PHP Debugger Zend PHP Executable PHPS C Zend Deviworkspace org ze PHP Executables PHP Web Server Default PHP Web Server PHP Servers PHP File ExampleProject newfile php Breakpoint Break at First Line 5 Enter a name for the new configuration 321 Zend Studio 7 User Guide Select the PHP Web Server option under the Debugger Location category Select your server from the list If you have not yet configured your server click the underlined PHP Servers shortcut The Servers preferences page will open Configure your server by following the instructions on adding a new server under the PHP Servers Preferences page For more information on configuring the communication between Zend Studio and your remote server see Setting Up Remote Debugging Under the PHP File category click Browse and select your file Marking the Breakpoint checkbox will result in the debugging process pausing at the first line of code 10 If necessary you can add arguments in the PHP Script Arguments tab to simulate command line inputs 11 Click Apply and then Debug 12 Click Yes if asked whether to open the PHP Debug Perspective A number of views will open w
235. ect gt CiDoaments ad Saingijaren si General Information Example Proda L Cer and Setings heren siPty Documents atA asad dere Omer 3 3 0 and above See the Zend Guard Online Help for more information on encoding your projects Your production server must be running the Zend Optimizer in order for your PHP to be able to run the files encoded by Zend Guard The Zend Optimizer comes bundled with Zend Server or Zend Core or can be downloaded from the Zend Guard product page http www zend com en products guard optimizer Always test encoded files before uploading them to your production server Tasks Opening and Editing Zend Guard Projects in Zend Studio This procedure describes how to open Zend Guard s file in Zend Studio enabling users to extend Zend Guard with the rich editing features included in Zend Studio This provides users with a seamless workflow for fixing and modifying code through Zend Guard w To open a Zend Guard file in Zend Studio 1 2 3 In Zend Guard go to Edit Preferences Zend IDE Enter the path to Zend Studio and click Apply and OK Right click the required file in Guard Explorer view and select Open with Zend IDE This option will only be available once Zend Studio integration has been configured as described in steps 1 and 2 Zend Studio will open and the file will be displayed in an editor All of Zend Studio s editing capabilities will now be available to the fil
236. ect leg Destination C Documents and Settings keren s Zend workspaces Default Wor Browse PHP exe C Program Files Zend Zend Neon BetaRC5 plugins org zer sel Ce 2 If you have previously created PHPDoc settings which you would like to apply mark the checkbox To create a settings configuration see point 8 3 Ensure that the required project destination for the PHPDoc and PHP Executable are selected 4 Click Next 407 Zend Studio 7 User Guide 408 Generate PHPDoc Basic Options C Parse access private and internal Generate highlighted source code 2avadoe compent description parsing C FEAR package repostory parsing C Descend into hidden directories C Save the settings of this PHPDoc export in an ini file Location F Open generated documentation in browser Col Coe Core Choose the style for your PHPDoc from the Converter Type drop down list This will affect the layout and format of your PHPDoc Select which basic options you want to apply Refer to the phpDoc Manual online at http www phpdoc org for complete descriptions of the options Parse acess private and internal Generate highlighted source code JavaDoc compliant description parsing PEAR package repository parsing Descend into hidden directories Enter the following fields Refer to the phpDoc Manual online at http www phpdoc org for complete descriptions of the options Default
237. ect button a on the toolbar If you have not configured your Zend Guard location in Zend Studio a prompt will appear stating that Zend Guard preferences have not been defined Click on the Define Zend Guard exe link to be taken to the Zend Guard preferences page or go to Window Preferences PHP Zend Guard If you have defined your Zend Guard location Zend Guard will now be opened and a Zend Guard Project dialog will open Zend Guard Project Create Zend Guard Project Project Information Project name Example Projecti Project contents Z Use defaut Guard Product Information Product Name Example_Product_1 v Product Verson 1 0 Ke Output Location C Documents and Settings keren siMy Documents Drafts Guard v Browse Next gt IL Ge TJ Cancel 2 Enter the following information in the relevant fields 422 Project Name This will automatically be taken from the name of your Zend Studio project Tasks This cannot be the same name as an existing project in Guard Project contents The directory into which the project will be placed Unmark to browse to a different location Product Name Enter the product s name Product Version Enter the product s version Output Location Enter the location to which you would like the encoded files to be created Click Next If you want additional files and folders to be added to the project click Add Folder or Add File and browse to the required so
238. ection provides information on how to quickly and easily get started with the most commonly used Zend Studio functionality Quick Start This Quick Start describes how to easily locate and use commonly used features such as creating projects and files Debugging PHP code using Source Control CVS SVN Refactoring and more Getting Started with Zend Studio This guides you through the common process of using Zend Studio to develop and run your PHP applications Basic Tutorials These tutorials demonstrate common processes along with examples and practical information on how to implement the information in order to improve your coding environment Switching from Zend Studio 5 x to Zend Studio 7 x A quick guide for Zend Studio 5 x users on how to access commonly used functionality in Zend Studio 7 x Zend Studio 7 User Guide Quick Start The following Quick Start page will help newcomers and even our veteran users familiarize themselves with this new version The Features covered in the Quick Start are Getting Started Remote Server Workbench Source Control Workspaces PHPUnit Creating a PHP Project Refactoring Creating a PHP File Perspectives of Interest PHP Debugging Getting Started When Zend Studio is first launched a Welcome Page will open containing links to actions and tutorials to help you get started with Zend Studio as well as information on Zend Studio s features and functionality To start using Z
239. ed by Zend Server as events For more on events and how to configure what constitutes an event see the Monitor chapter in Zend Server Online Documentation Zend Server s events can be viewed directly from Zend Studio using the internal browser which displays the Zend Server User Interface vd K KC EE E lene bi m http flocalhost 81 fZendServer index phpoadCtri Monitor LidioadActn Issues Listetoken d10d95263924dc 1 SbdSa65c32b73dF 7d 1237207009015 elt Monitor B Rule Management Dashboard Events Server info PHP info Filler All Open Events Show Filter Detalis gt Gotoeventbyid tal 6 Last refresh time 16 Mar 2009 14 36 D Rute Name Severity Count Status first Occ LastOcc Occurred at 000005 Severe Slow Request Execution Absolute Critical 1 Open 19 Feb 17 25 19 Feb 17 25 hipocaihost8tissuesphp 000005 PHP Error Warning Open 19 Feb 17 25 19 Feb 17 25 C Program Files Zend 4pache2inidocsissues pr Custom Event Warning Open 19 Feb 17 25 19 Feb 17 25 C Program Files Zend Apache2inidocsvssues pt Severe Siow Request Execution Absolute Critica Open 18 Feb 1453 18 Feb 14 53 hitpulocathost 8 tissues php PHP Error Warning 18 Feb 1453 18 Feb 14 53 C Program Files Zend Apache2inidocsiissues pt 001 Custom Event Waring 18 Feb 1453 18 Febd 1453 C Progtam Files Zend pache2inidocslissues pt lt gt Change status to 4 1 on of UI 5 Restart PHP F Problems Zi Tasks Console 5 Servers 52 TA
240. ed 0 031 asserting that lt integer 3 gt is equal to lt double 0 5 gt Trace PHPUnit_Framework_Assert assertEquals GaiculatorTest pho 69 testMultiply Error PHPUnit_Framework_IncompleteTestError multiply test not 0 013 implemented PHPUnit_Framework_Assert markTestIncomplete testSubtract Success 0 011 Report generated at 2007 11 137T10 58 14 02 00 Reports will be generated in the location defined in the PHPUnit Preferences page 4 Clicking the link beneath a failed test result will take you to the relevant test 389 Zend Studio 7 User Guide Using Refactoring The Refactoring feature allows you to Rename Files Rename Elements Move Files Extract Variables Extract Methods Refactoring options will only be available from within PHP Explorer view and not from Navigator view Using the Navigator view s move rename functions will not update any referenced instances of the file element 390 Tasks Renaming Files This procedure describes how to rename files and update all instances where that file is referenced within the project Ensure that you save any changes to the file before applying the refactoring feature to it S To rename a file using the Refactoring feature 1 In PHP Explorer view right click the file which you would like to rename and select Refactor Rename or select it and go to Refactor Rename from the Menu Bar A Rename File dialog will appear Rename File
241. ed Project Selection dialog appears ii Select the projects you would like to add and click OK The selected project s will be added to your project s Include Path To add a library to your Include Path i Select the Libraries tab ii Click Add Library The Add Library dialog appears ii Select the required Library if available and click OK To add external folders to your Include Path i Select the Libraries tab ii Click Add External Folder The Add Include Path dialog appears ii Browse to and select the required folder v Click OK The folder will be added to your project s Include Path The library is a read only file and will not be available for editing To configure the order of elements on your Include Path i Select the Order tab This determines the order in which resources will be searched for in require include calls See Include Paths for more information on the order for which files are searched for If applicable it is recommended that elements appear in the same order as they do in your php ini ii lf necessary rearrange the order of the entries To do so select an element and click Up or Down to move it in the list 2 Once all the elements are added and are in the right order click OK All the selected elements will be added to the project s include path 370 Tasks Configuring a Project s PHP Build Path By configuring your project s PHP Build Path you can select resources which will be incl
242. ed element 4 Click Apply to apply your changes The appearance of the Mark Occurrences annotations which appear in the vertical ruler to the left of the editor and the annotation bar to the right of the editor can be configured in the Annotations preferences page Window Preferences General Editors Text Editors Annotations by selecting PHP elements read or write occurrences Annotations Je ze Annotation types O Eros 4 h gt Feed Search Resuks Vertical ruler i info E Overview ruler gt Matching Tags A gt Occurrences org echtee jdt ui occurrences Eiee Jmgigesg Occurrences org ecipse wst isdt wioccurences Coke fl Override Indicators org eclipse jaui overridelndcator A Override Indicators org eclipse php ul overridelndicator Override Indicators org eclinse wst sch A overridelndicator PHP elements write occurrences Search Results Spelling Errors Tasks M Warnings Write Occurrences e Ree betes toh 585 Zend Studio 7 User Guide Save Actions Preferences The Save Actions Preferences page lets you remove trailing whitespace from a file each time you save it The Save Actions Preferences page is accessed from Window Preferences PHP Editor Save Actions C Remove trailing whitespace O Alllines O ignore empty tines Ca Con S To configure Save Actions 1 Mark the remove trailing whitespace checkbox to enable the rem
243. ed to FTP SSH 1 Viewing and editing files that are located on a remote FTP SSH server only 2 Viewing and editing files in your workspace with a link to the FTP SSH server See the RSE User Guide for more on FTP SSH connectivity Additional user guides can be accessed from inside Zend Studio by going to Help Help Contents or from the Eclipse Online Documentation site http help eclipse org ganymede index jsp 264 Tasks Creating an FTP SSH Connection This procedure describes how you can configure an FTP or SFTP connection in Zend Studio S To create an FTP SSH Connection 1 Open the Remote Systems Perspective by going to Window Open Perspective Other Remote Systems Explorer 2 Open the Remote Systems view by going to Window Show View Other Remote Systems Remote Systems Remote Systems e Click the Define a connection to remote system button on the view s toolbar The New Connection dialog will appear New Connection Select Remote System Type Connection for FTP access to remote systems A System types type fiter text ES Telnet Oniy Experimenta Unis Les Zr Windows 5 Select FTP Only for an FTP connection or SSH Only for an SSH connection and click Next New Connection Remote FTP Only System Connection Define connection information Parent profile Team Host name 10 1 3 242 Connection name My FTP Connection Description V Very host name C
244. edge Base contains an extensive range of articles on commonly encountered problems troubleshooting tips and workarounds Search the Knowledge Base for any Zend product related issue at https www zend com en support knowledgebase php Online Documentation The Zend Product Online Documentation Center is an easily browseable and searchable resource for accessing the most updated information on using all Zend Products Visit http www zend com en resources zend documentation 643 Zend Studio 7 User Guide Open a Support Ticket If you did not find the answer to your question in any of the Support resources you can open a ticket with the Zend Support team who will answer each ticket on an individual basis This can be done through https www zend com en helpdesk newticket php More information on specific Zend Studio component errors is sometimes recorded in Zend Studio s error log This is located in a log file created in the metadata folder of your workspace e g C Documents and Settings Bob Zend W orkspaces DefaultWorkspace metadata log The information in this log can help the Zend Support team to diagnose a specific problem Zend Newsletter Sign up for Zend PHP email updates for the hottest updates special promotions and useful developer information To sign up log in to your Zend account at https www zend com en user myzend enter your email address and click Subscribe Zend Developer Zone The Zend
245. eeaeeeeeeeee 265 Editing the Default Port of an FTP SSH Connection cccceecceeeeeeeeeeeseeeeeseeeeeneeeeeeeeees 266 Viewing and Editing Files on an FTP SSH Geer 267 Viewing and Editing Remote Server Files in your Workepace 268 Developing with Zend Framework AA 271 Creating Zend Framework Projects ccccccceecceceeeeeeeeeeeeeeeceeeeecaeeesaaeeseaeeseeeesaeesenaeeseeeeee 272 Running and Debugging Zend Framework Projects AAA 274 Setting Up Your Server Environment ssssssesessesrrssrresrrssrrssrrssirsstnssrnssrnssrnssrnnsrnssrnnsnent 274 Creating and Running a Zend Framework Example Droe 278 Creating the Zend Framework Example Project 279 Running the Zend Framework Example Proiect AAA 280 Creating Zend Framework Elements sssssessseeseessressrtssrnssrnsrnstnnstnssrnssrnssrnssrnnsrnssrnnsnnnt 281 Creating a Zend Module File 282 Creating a Zend Controller File 284 Cr ating a Zend Table Files eteieigogttege eiaeaen raea eves beasties AEE e AAE es Eech 286 Cr ating a Zend View File iias tent aea ataa aa aaa den AER gue 287 Creating a Zend View Helper Pie 288 Creating a Zend Action Helper 290 Searching the Zend Framework Gite 293 Using the Zend Tool Floating WIndows sissisotaan nania ERE ERA 294 COnNneCting Re RRE EE 296 Connecting to Databases asarana aa aeaaea einai aate Earann aaa aaa a EREN ESS 296 Creating a Database Connection Proftle 297 Connecting to a Database netnnstnnsttnstnnsernstnnsensstnnsrnnsrens
246. eeceeeesaaeeeeaaeseeeeeceaeeesaaeegeneeseeeesaeeeseeeeenees 203 Working with Code Tracing cccccsceceecceeeeeeeeeeeeeeeeceaeeeeeaeeeeneeseeeeecaaeseeaaeseneeesaaeeseiaeeseneeee 203 Importing a Zend Server Event File ccccceesceceeeeeceeeeeeeeeeeeeeecaeeeseaeeeeeeeseaeeesaeeeeaeseenees 204 Opening the Trace Data Source ccecceeececeeeeceteeeeeaeeeeeeeceeeeeceaeeeeaaesgeaeeseeeesiaeeeeaeeseneeee 207 Debugging and Profiling Zend Server Events 209 Importing xml Events Into Zend Studio cccecceeececeeeeeeeeceeeeeceaeeeeeaeeseeeeseeeesaeeeeaeeeneees 209 Debugging Profiling Events from Zend Geer 213 Setting Up Zend Server Integration 215 Configuring Zend Server Settings in Studio ccecseeeeeeceeeeeeeeeeeeeeeeeeeeseeeeseaeeeeeeeeaes 215 Configuring Zend Studio in Zend Server eecceceeeceeeeeceeeeeceeeeeceaeeeeaeeseeeeeseeeeseaeeeeeeenaes 219 Configuring Studio Communication Settings in Zend Server cccccscceceesteeeeessteeeeesaes 221 Configuring Zend Server to Auto Detect Studio Settings ccccccecsseeeesseeeesessteeeeseaaes 222 Using Content ASSIS tere ose ci a eh ee eeneg 223 te RRE 224 Inserting a Template into Code 0 eeeccccceeeeeeceeeee cee eeeeaeeeeeeeeeeeeesaaeeseaaeseeeeeseaeeesaeeneneeee 224 Formatting GAES s iit aea aa fe ae tn ti a Set ae 226 Using Code Folding eege a eas aia en A A vi E SE 227 Searching for PHP Elements ieviesa ia iaaea ei ia 229 FOIKGY
247. eeeeeeeteeeeeesteeeeees 467 Duration Time eeens 70 E Easy File Creation issen 180 Easy PHP File neunit 182 EE 636 Gel DOE eege neti deepens 636 ecltor fs Aken ete annie ete 202 Editor preferences eseese 602 648 Electronic Licensing solution aaaaae 163 elements JavaScript eeeeeeeeee eee 467 enable JavaScript support 467 Enable JavaScript Support in PHP Project EAEE ER Leg Eeer Lee 467 Enable Project Settings cseeee 97 leie 436 ONCOMING EE 163 error WOrKTIOW 2 2 cceeceeeeeeeeeetteeeeeeeees 154 le 122 event le 199 execution data 154 198 199 202 Execution FIOW view sssssssesseeneeesesennn 525 Execution Statistics ccccceeeeeeeeneees 70 Execution Statistics View 523 Execution Time cceeeseceeceeeeeeeeeeneneeees 70 CL RRE 199 export a Zend Server Event File 199 external le 183 external porolechs 143 F Failure Trace 77 UI 181 182 UE Lu E 199 fle PHP tee tik sciences ens 467 Tile XM ae hes Slee deg 199 files JavaScript seeen 467 Filter Stack Trace 77 Finding and Replacing eeeeeeeeeeee 240 Firef oX iiin eee naeh ia aeei 148 Firewall areraeun aes 149 el RE 110 FORMO WEE 227 Folding Preierences 605 ele 105 Format Active Elements 226 Format Document 226 Formatter cececccceeceeeeeeeeeeeeeeeeeteeeeeeeees 226 Formatter preferences neee 584 Framework 127 276 Framework Project sesseseeee
248. eeeen 127 276 Free Registration ssseesersserreeernnsnne 166 Pil E EE 266 267 270 272 502 EIPBISETPRGonnecton 266 Function Parameter Hmt 37 G Get Content 145 getters and eetters neee 414 Goto Gource erener erreren 234 Guardi we i eran tenet 163 439 Guard Preferences cc scccsesseeeeeees 645 H HereDoGs ets eege Eesen 105 Hover Gupport 114 ele te EE 114 Hovers Preierences 606 HTML editing c c ic8s aunts 422 FAT MB E 422 I IS e ue BET 166 i5 Edition Wcense 166 IS PHP API Toolkit cc cccceseeeeeeerees 166 MDOT e aes 192 198 199 Import WIZAM re a 199 importing Zend Server Event File 199 Include Path 143 379 Include Path Libraries 000sssseneneeeeenae 379 Include Paths sseneeeesnnnneeeennnnnnnnneeeennn 145 Include Gtatemente 100 INGIUOE E 408 ue TE 157 inserting element 37 Installed Debuggers preferences 595 due TEE 154 integrate code racing 154 Integration Dolo 467 Internal Debugger eeeeteeeeeteeeteee 132 Internet Explorer 148 ISSUC memorg 154 issue memory performance s es 154 issue performance sssssssessssssserrrrrerssrene 154 J JavaScript159 467 468 471 480 481 485 JavaScript Build Path 467 471 JavaScript Content Assist 467 481 JavaScript debug cccceeeeeeteeeeteees 467 JavaScript Develop s 467 JavaScript elemente 467 JavaScript le 467 JavaScript library cceeeeeee
249. eeseeeeseaeeeeeeenaes 623 Formatter Properties etena cartes eege ead antec boned rate Neate 624 Semantic Analysis PDroperttes eee reettstn tsen nettnttrnsttnntnssrnssrnnstnnstnnsrnnnrnnsnnnt 625 PHP Build Path Properties AANEREN 627 elauter 628 PHP t Hd tele 629 PHP Include Path Properties micra iieenia a a a A 630 PHP Interpreter Properties EE 631 IN ele Ee El tele 632 Project References Properties cccscccceeseeceeeeeeececeseeeeeeeeneececesneeceeesneaeecesneneeeesnneaeeeennaaes 633 Refactoring HIII E 634 Run Debug Settings Propertles nenn nsenn nnn 635 Save Actions Properties bk 636 Task Tags lee 637 Validation Properties dese ENEE ENEE ee ee ee ecb 638 IN el 639 PHP Gu 639 Zend Framework Elements 640 Other CONS iii we ere a a ee ee ee ne 640 KEYMAD E 641 USeTUN Dk sue E ee ve ec Se el Mec ed ea he eas 642 SUPPOMyahesteelecstebear eee ten eege Ze Sieden eee ies eege eege leie 643 Zend SUPPOM ee EE 643 ZNA Kenn 643 Zend Support Knowledge Base nrn netn neturetu nenn nennneennsennsennnenn 643 Online Doc me ntatio Masisira aiea aniraa dee bbe aa EA AEEA AT a hands 643 OPEN SO DDOEECHKEKEE PAETE EAS EEE T eet EE dee 644 Zend ewell et ise eierne an a E AEAN ANARA EE ETA AAA E EAO E AE EETAS 644 Zend Developer e TEE 644 OCOD e 644 Registering Your Licensee arrearen aiani iaae AANE RAEES ASPR AKARAK CR Se ER EES ARAHAN PRAE AE EAA 645 ale TE 647 XV What s New in Zend Studio 7 2 The following new features are available i
250. eesesaes 288 Zend COME seo e seth cieteesnee ds 347 Zend Debugger asserens 132 347 Zend Debugger Toolbear 148 Zend Framework 127 276 279 Zend Framework Elements 668 Zend Framework Example Project 283 Zend Framework Project esen 127 Zend Guard 163 436 439 Zend Guard Preferences s 645 Zend IMPOFtS eee eeeeeeeeeeteeeeeetteeeeeenaes 192 Zend Module ssssssessssenenssseesrnnnenssreerenee 286 Zend Network 162 Zend Platform 149 222 347 353 433 Zend Platform GU 222 353 Zend Server aaisen 151 154 198 199 Zend Server Code Tracer n 199 Zend Server Code Tracer perspective 199 Zend Server Event File 199 Zend Server Event File export 199 ZEN EE le Te EE 194 Zend Giudob cercnsureiiea enrii 192 Zend Studio Browser Plugin 148 Zend Studio Client Settings 222 353 Zend Studio kevmap 194 Zend Tablet nani iden as 290 ZEN TOO seseceiuee eevee eiriaa 298 Zend VOOM EE 148 Zend AE 291 Zend View Helper ssssssssesrresrrrnnen 292 Zendlt Toolbar dl 148 ZONAPlatfOrM osinean 433 653 654
251. efactoring checkbox so that the dialog will not be displayed again 7 Click OK The element will be renamed and all instances where that element is referenced will be updated to reflect the changes 394 Tasks Renaming Elements through the Refactor Dialog d To rename an element through the Refactor dialog As Ensure the Rename in editor without dialog checkbox is unmarked in the Code Refactor Preferences page accessible from Window Preferences PHP Code Refactor In the editor place your cursor on the element to be renamed or select it in the PHP Explorer From the menu bar select Refactor Rename or right click and select Refactor Rename or press Alt Shift R The Rename dialog box will be displayed The name of the dialog will be dependent on the element type Rename Global Variable New name inyName C Update textual occurences in comments and strings forces preview Enter the element s new name You must enter a valid name for the required element i e one that starts with a letter or underscore followed by any number of letters numbers or underscores Check the Update textual occurrences in comments and strings box if you want the element s name to be updated in all comments and strings where it is referenced This will force you to preview the changes before applying them Click OK to apply your changes or click Preview if you want to see a preview of the changes
252. efault this will be inherited from the container this will be determined according to your local settings If your text files use a different encoding scheme because for example they originated from an external source you can change the encoding by selecting the Other option and choosing the required encoding from the drop down list 619 Zend Studio 7 User Guide New text file line delimiter This will define the line delimiter for new text files Select to inherit from container or select Other and choose the required option from the drop down list These settings can be configured for all newly created projects through the Workspace preferences page Window Preferences General Workspace 2 Click Apply to apply your settings 620 Reference Builders Properties The Builders Properties page allows you to configure the External Tool builders that are run when this project is built and add remove or reorder external tools in the build order The Eclipse build process scans external resources which are referenced in a project so that their contents can be made available for operations such as Content Assist and Refactoring To access the Builders Properties page right click a PHP project in PHP Explorer view and select Properties Resource or select the project and from the menu bar go to Project Properties Builders Properties Builders Configure the builders for the project Z pg Project B
253. eference Semantic Analysis Properties The Semantic Analysis Properties page allows you to configure Semantic Analysis Properties for your project The Semantic Analysis feature enables warning and error messages to be displayed when Zend Studio detects possible errors or problems in your script To access the Semantic Analysis Properties page right click a PHP project in PHP Explorer view and select Properties Semantic Analysis or select the project and from the menu bar go to Project Properties Semantic Analysis 4 Semantic Analysis Properties Sch Configure Project Specific Settings Enable Semantic Analysis Select the severity level For the Following Semantic Analysis warnings v Compile Errors lt Duplicate PHP element declaration in same file Error lt Duplicate PHP element declaration in File hierarchy Ignore lt Class element visibility reduce Error lt Unimplemented abstract methods Error v Potential Programmer Problems Undefined local variable Warning v Undefined Function Warning Undefined Field slow check Ignore lt Undefined method slow check Ignore Undefined class or interface Warning Assignment in condition e g if a bi Warning e Assignment has no effect e g a a Warning IL DO lt Bad escape sequence in string Warning my To configure Semantic Analysis Properties for the project 1 Mark the Enable project spec
254. eful in resolving time performance issues memory performance issues and workflow errors endStudio gt ore Zend Server Code Tracer drupal includes bootstrap inc File Edit Navigate Search Project Run Window Help r SCENE EE Ti fe PHP Debug G Web j ze FEA Tracer 53 Tracing Tree Statistics per Functon Show memory usage Total running time all calls Function Name of Calls Including Children Just own Lorated in tile drupal_bootstrapQ bootstrap ine drupal_unset_globalsQ 0 01 ms bootstrap inc zent Ia 41 89 ms bootstrap ine ti CC 4 EJ timer_stano 0 06 ms _bootstrap ine E E drupal_valid_http_host 0 05 ms __bootstrap ine E cont_patho 0 12 ms bootstrap inc Calls for _drupal_bootstrap Memory Consumed Total Time Own Time Called from 5 612 bytes 12 45 ms 0 01 ms bootstrap inc 883 8 bytes 4 72 ms 4 74 ms bootstrap ine 983 1 932 bytes 16 641 ms 3 66 ms bootstrap inc 983 468 bytes 37 23 ms 0 01 ms bootstrap inc 983 An ROR acts DADE MS IN 25 ms bootstiap ing 983 8 bootstrap ine E bootstrap inc Pd lt php f f Id bootstrap inc v 1 206 2 12 2009 04 30 00 13 30 goba Exp grr file Functions that need to be loaded on every Drupal request 166 Concepts Code Tracing Zend Server Code Tracing captures full execution data trace data of PHP applications in real time The e
255. eg tere Lee Een 70 312 Quick Type Hierarchy View 235 R Heiachorimg 67 157 401 402 408 Relative Path 143 Remote Debuggmg 132 Remote Profiling ccceeeeeee 70 135 Remote RUNNING ccceeeeeseeeeesteeeeeenaes 130 remote SEFVEL cccccececeeeeeeeeeeeees 149 356 Remote System Explorer 266 Remote Guvsiems 267 Remote Systems VieW cecesseeeeenes 502 Remotely Debugging PHP Scripts 57 Rename ossis 67 157 401 402 Renaming Elements 404 Renaming Files ccceeeesseceeeesteeeeeees 402 Replacing Files a nn 247 reposlforn er 42 125 126 Repository Location 42 rogue ME 408 Restoring Deleted Files 0008 248 Let 266 502 et E 164 444 RSS tee 164 444 RSS VEW a aa E 164 Ul EE 130 315 317 319 RUNO BEE 130 651 Zend Studio 7 User Guide S Sample Contents cccecceseeeeseeeees 304 SCrapbOOKwiwten EE 312 Searching for PHP Elements 229 security device NEEN 149 SOVET eren haa hee denen an 132 Server Debugoger 57 Server Location 145 Server Path Maps 145 Servers VIEW ou cceccceceesteceeeseeeeesseeeeseaaes 505 le EE 441 Set the JavaScript Build Pat 467 Set Up and Use Dojo Integration 467 SFTP ri 266 267 270 272 502 Share Prolect 256 265 Sharing Projects ccceseeeeseeeeees 42 50 Smart Goto Source s s 234 SOAP Cli iteessc cs dissaciesssccssetecadersiecosetens 441 Ge el 154 202 source Cont
256. el 3 Enter the information required to identify and connect to the repository location URL The URL on which your repository is located Label Select whether to use the URL as the repository s name or to enter a new name Authentication The user name and password you use to connect to SVN Mark the Save password checkbox so that the password will be automatically inserted in the future 4 Click Finish 257 Zend Studio 7 User Guide Your SVN repository will now be added to the SVN Repository view See the Subversive User Guide for more information on SVN Additional user guides can be accessed from inside Zend Studio by going to Help Help Contents or from the Eclipse Online Documentation site http help eclipse org ganymede index jsp 258 Tasks Importing Projects from SVN Once projects are placed on the SVN repository they can be checked out imported by anyone with access to that repository SVN repository connections allow you to import projects from your repository to your workspace which you can make and upload changes to This procedure describes how to import check out projects from an SVN repository location to your desktop If you have resources on your file system which are already linked to SVN you can access them in Zend Studio by following the instructions under Accessing an Existing SVN Checkout S To import a project from an SVN repository Go to File Import S
257. elect the PHP Executable option in the Debugger Location category Or To debug the file using your server s Debugger select the PHP Web Server option under the Debugger Location category and select your server from the drop down list If you have not configured a server click the PHP Servers link to be taken to the PHP Servers Preferences page 8 Under PHP File click Browse and select the debug file 9 Ensure that the Break at First Line Breakpoint checkbox is selected 9 Click Apply and then Debug 10 Click Yes if asked whether to open the PHP Debug Perspective 11 A number of views will open with information about your script 12 The Debug View is where the debug stack trace is displayed and the debugging process can be monitored and controlled 72 13 14 15 16 17 Click Step Return Getting Started 3 P a 2 CS E i Debug PHP Script j AS PHP Application i Debug php suspended display_workers Debug php at line 77 display_workers Debug php at line 73 Debug php at line 103 K iil 2 The debugging process will currently have stopped where your first lt php label appears o gt Click the Resume icon to continue to the breakpoint Click Step Into gt The Debugger goes into the function defined in line 103 and advances to line 77 The Variable view will now display various information about the relevant variables and parameters thr
258. elect the template s for export from the Template list 2 Click Export to open the Export Templates dialog 3 Select the location to save the XML file to 4 Click Save An XML file will be created with the template information 560 Reference To export all code templates 1 Click Export All 2 Select the location to save the XML file to 3 Click Save An XML file will be created with the template information If you selected more than one template to export all of them will be present in the exported XML file Each of the original Templates is bounded by lt template gt lt template gt 561 Zend Studio 7 User Guide Formatter Preferences Formatter Preferences Zend Studio can auto format scripts to organize them into an easily readable format The Formatter Preferences page allows you to customize the way it is formatted The Formatter Preferences page is accessed from Window Preferences PHP Formatter Formatter oe Configure formatting prefererces PHP Convertions buk n v Pow New inport Preview bp class Example var theInt 1 3 function foo fa fb i switch fa case U Oth er gt doFoo break default Ovher gt doBas Oz U function bar Zwir for 1 0 i lt 30 3 f tel fv readd i The default formatting settings are based on the PHP Conventions settings Click Show to see these settings S To create your own set of confi
259. element KY To generate a PHP DocBlock or Getter and Setter 1 Right click the element in Outline view 2 Select Source Add PHP Doc or Generate Getters and Setters The relevant PHP DocBlock or Getter Setter will be created above the code for the selected element in the editc Outline View Toolbar Commands ie a E Collapse All Collapses the list of elements Sorts the list alphabetically Show If selected elements will be displayed in Groups include files Groups constants classes functions Editor single clicked If unselected elements will be displayed in the editor Link with If selected elements will immediately be displayed in the editor when when they are double clicked 481 Zend Studio 7 User Guide Outline View Menu Commands The view s menu can be accessed through the view menu icon v Link with Editor v Show Attributes D php html Link with If selected elements will immediately be displayed in the editor Editor when single clicked If unselected elements will be displayed in the editor when they are double clicked Show If selected element attributes will be displayed These are lt i mem PHP HTML Toggles the view to display PHP or HTML elements See The Outline View is displayed by default as part of the PHP Perspective To manually open the view go to Window Show View Other PHP Tools Outline 482 Reference Remote Systems View The Remote Systems view helps
260. elp Install Update PHP Appearance Code Analyzer Code Coverage Code Gallery Code Refactor Code Style Debug Editor New Project Layout PHP Executables PHP Interpreter PHP Libraries PHP Manual PHP Servers PHPUnit Semantic Analysis Zend Guard Ip Remote Systems Restore Defaults Run Debug oe d OK j Cancel Appearance of PHP elements in Outline views S To display element s return type methods 1 Mark the Show methods return types checkbox 2 Click Apply to apply your settings 553 Zend Studio 7 User Guide Code Coverage Preferences The Code Coverage Preferences page displays a preview of code in Code Coverage view with the current color and font settings Code coverage views are displayed when using various features such as profiling unit testing and debugging to show which lines of code have been covered by this functionality The Code Coverage Preferences page is accessed from Window Preferences PHP Code Coverage n 554 Code Coverage Code Coverage View settings See Colors and Fonts to configure the font and color decorations Preview echo Hello gz if false i echo Worid To configure code coverage colors and fonts 1 Click the Colors and Fonts link The Colors and Fonts preferences page will be displayed with the PHP Debug category open Colors and Fonts T Colors and Fonts any character any string type
261. en Severity Warning hitpocalhost tissues php Source File URL more Function Name trigger_error Aggregation Hint ftesting 1235057125 Error String This is a user triggered error Error Type E_USER_ERROR Function Data Request Server Backtrace ErrorData Function Name trigger_error Function Arguments 1 This is a user triggered error 2 286 Zend Studio Diagnostics Debug Event Profile Event Show File in Zend Studio Change status to Closed A Click the 289 button 5 Select to save the file to a location on your file system C Program Files Zend Apache2intdocs ssues pnp Senge 6 The exported file will be created as an XML file containing the event details Once a Zend Server event file has been created it can be imported and debugged in Zend Studio 210 Tasks Importing and Debugging Zend Server Event Files S To import and debug a Zend Server event in Zend Studio 1 From the menu bar go to File Import Zend Server Zend Server Event File and click Next The Import Zend Server Event File dialog is displayed Import Zend Server Event File Import Zend Server Event File Specify a file to import 2 Click Browse and browse to the location of the event file 3 Click Next A dialog will display with the details of the event Import Zend Server Event File Import Zend Server Event File The URL defined for the originating server is locathost 127 0 0 x To debug on
262. en the test is run Zend Studio will insert these parameters into your original file s functions to see if the result is as expected Once you have completed the file by creating relevant test functions and inserting parameters your PHPUnit test case is ready to be run 381 Zend Studio 7 User Guide Running a PHPUnit Test Case This procedure describes how to run a PHPUnit Test Case and how to analyze the results Before running a PHPUnit Test Case one needs to be created by following the instructions under Creating a PHPUnit Test Case wi To Run a PHPUnit Test Case 1 Open your PHPUnit Test Case file in the editor 2 Torun the PHPUnit Test Case click the arrow next to the Run off on the toolbar and select Run As PHP Unit Test amp or from the Main Menu go to Run and select Run As PHP Unit Test amp or right click the file in PHP Explorer view and select Run As PHP Unit Test Or to debug the PPHUnit Test Case click the arrow next to the debug button E on the toolbar and select Debug As PHP Unit Test or from the Main Menu go to Run and select Debug As PHP Unit Test amp or right click the file in PHP Explorer view and select Debug As PHP Unit Test The PHPUnit view will be displayed with a section showing all the tests run and the results and two extra tabbed views showing code coverage and failure trace 1 Problems 4 Tasks El Console mm Jam ef BH Q WE DI Runs 4 4 E Errors 0 H F
263. ences PHP Editor Save Actions or by clicking the Configure Workspace Settings link on the properties page 636 Reference Task Tags Properties The Task Tags Properties page is not applicable for PHP projects The Task Tags Properties page allows you to configure Task Tags for non PHP files To access the Task Tags Properties page right click a PHP project in PHP Explorer view and select Properties Resource or select the project and from the menu bar go to Project Properties Task Tags Properties Task Tag properties for PHP projects should be configured from the PHP Task Tags Properties page 637 Zend Studio 7 User Guide Validation Properties The Validation Properties page is not applicable for PHP projects The Validation Properties page allows you to specify the validators for your project To access the Validation Properties page right click a PHP project in PHP Explorer view and select Properties Resource or select the project and from the menu bar go to Project Properties Validation Properties 638 Reference PHP Icons The following is a list of icons representing different PHP elements which are displayed in the PHP Explorer view and in Content Assist lists PHP Elements Icon ei e D DR PEE gt 7 ii o N PHP Element PHP Project PHP File included in the Build Path PHP File excluded from the Build Path PHP File containing warnings PHP
264. ences Page available from Window Preferences PHP Navigates up one level This icon will only be active if the Go into the selected element option is selected in the PHP Preferences Page available from Window Preferences PHP a Collapse All Collapses the list of elements Link with If selected elements will immediately be displayed in the editor Editor when selected If unselected elements will be displayed in the editor when they are double clicked PHP Explorer View Menu Commands 478 Reference The view s menu can be accessed SESCH the view menu icon Show Show Select to view your projects grouped by ege Select If Show Projects was selected above Working Set allows you to select a specific Working Set to view See PHP Working Sets for more information Deselect Deselects the Working Set if selected Working Set Edit Active Allows you to edit the selected Working Working Set Set See PHP Working Sets for more information Filters Opens the PHP Elements filters dialog which allows you to select which elements will be excluded from being displayed in the view You select to exclude elements according to name or type Group by Sorts elements by namespaces for namespaces projects using PHP 5 3 only Link With If selected elements will immediately be Editor displayed in the editor when selected If unselected elements will be displayed in the editor when they are dou
265. ences page is accessed from Window Preferences PHP Debug Workbench Options Workbench Options er Allow multiple debug sessions O Always C Never Prompt Switch back to PHP perspective when the debug is terminated Odlways Never Prompt Workbench Options Open in Browser Open PHP Debug views Debug Output Browser Output Restore Defaults Apply The Workbench Options configuration options are Allow multiple debug sessions Select whether to Allow multiple debug sessions to run simultaneously Always Never or Prompt Switch back to PHP perspective when the debug is terminated Select whether the PHP Persepctive will open when the debug is terminated Always Never or Prompt Workbench Options Open in Browser Mark the checkbox for the debugged files to be displayed in a browser during debugging Open PHP Debug Views Mark the checkbox for PHP Debug Views to be displayed when a debug session is launched By default a dialog will appear when a debug session is launched asking whether you want to open the Debug Perspective when a debugging session is run To change this behavior open the Perspectives Preferences dialog by going to Window Preferences Run Debug Perspectives and select Always Never or Prompt in the Open the associated perspective when launching category 577 Zend Studio 7 User Guide Editor Preferences The Editor preferences page allows you to configure smart caret positioning
266. end Studio close the Welcome Page by clicking the X icon E in the Welcome tab in the top left corner Workbench The Workbench is a window that displays Perspectives Views and menu bars through which different operations can be performed See the Workbench topic in the Workbench User Guide for more on using and customizing the Workbench Additional user guides can be accessed from inside Zend Studio by going to Help Help Contents or from the Eclipse Online Documentation site http help eclipse org ganymede index jsp Workspaces Workspaces are the files system location where all your projects are created and stored You can use the default Workspace created by Zend Studio or from the menu bar go to File Switch Workspace Other to select a different Workspace 20 Getting Started Creating a PHP Project A project is a group of files and resources which are displayed in a tree in the PHP Explorer view re To create a new PHP project Go to the Menu Bar and select File New PHP Project Or In the PHP Explorer View right click and select New PHP Project See Creating PHP Projects for more information Creating a PHP File w To create a new PHP file _ Go to the Menu Bar and select File New PHP File Or in PHP Explorer view right click the folder in which you want to create your file and select New PHP File ei Or click the New PHP File icon on the toolbar This creates a file outside o
267. ent Toggle Mark Occurences Code Assist Context Information Open Resource Open Type Open Type Hierarchy Open Type in Hierarchy Open Call Hierarchy Open Task Open Method Open Selection Move Rename Debug as PHP Script Debug as PHP Web Page Run as PHP Script Run as PHP Web Page Ctrl Shift L Shortcut Ctrl Shift Ctrl Ctrl Shift J Alt Shift 0 Ctrl Space Ctrl Shift Space Ctrl Shift R Ctrl Shift T F4 Ctrl Shift H Cr Ah 3 M Ctrl F12 Ctrl Shift M F3 Alt Shift V Alt Shift R Alt Shift D H Alt Shift D W Alt Shift X H Alt Shift X W Action Copy Lines Insert Line Below Current Line Delete Line Quick Fix Format Format Active Elements Open Views List Show View Previous Next View Previous Next Editor Quick Hierarchy Quick Outline Find Text in Workspace Go to Matching Bracket Extract Variable Extract Method Run as PHP Unit Test Terminate Use Step Filters Toggle Breakpoint Shortcut Ctrl Alt Down ShifteEnter Ct 0 Cl A Cut Shift F Cti 1 Ctrh 3 Alt Shift Q Q Ctrl F7 Ctrl Shift F7 Ctrl F6 Ctrl Shift F6 Ctrl T Cri 0 Ctrl Alt G Ctrl Shift P Alt Shift L Alt Shift M Alt Shift XU Ctrl F2 Shift F5 Ctrl Shift B 641 Zend Studio 7 User Guide Useful Links This page includes links to commonly used online reference inf
268. ents within a Pie 83 Working withthe Prowilet aoaaa keane neki didi ATA ia d ea raK AETA IAN 84 Table of Contents Pumos and USAGE EE 84 Profiling re CTT 84 Profiling PHP Web Pages cccssccccecesecceeseeeceeeeeeeceeesaeeaeeneaaaaeeesaaeaeeeeeseaeeesneeaeenseseaeentnees 89 Working with PHPUnit Testing norinciu ea aaa ea EEE ET 91 Pu umose and USage recan a e E E 91 Creating a PHPUnit Test Case nenn nnt 92 Running your PHPUnit Test Case 95 Analyzing CT 97 Creating and Running a PHPUnit Test Gute 98 Generating PHPUnit Test Reports ccccccceeeeeeeneeeseaeeeeeeeseeeeeceaeeesaaeeeeeeeseaeeesaeeeeeeeeenees 99 Working with Zend Server cccccceeesceeeeeeeceaeeeeeeeeeeeeeeeaeeeeeaeeeeeeeseaeeesaaeeseaaeseeeeeseeeeeaeeseneeee 100 Purpose ANC USAGE EE 100 Configuring Zend Server Integration c ccceecceceeeceeeeeceeeeeceeeeeeaeeeeaeeseeeeeseaeeesaeeneeeeeaes 100 Creating a project on a Local Zend Geer 102 Diagnosing and Profiling Performance Issues on Zend Geer 102 Diagnosing and Debugging Errors On Zend Gernver 106 Concepts wai an Wen al i a ieee i ee eee ae ee 110 Updat Manager eege geseet eeEeE deg ec ege ES der See A leaves 111 PHP Version SUpport erensia aaa Wah ave even a eee 112 COMENT ASSIST Tiia aa ai a on ee Eeer E geen 114 Using elements within the same SCOPE sssssssssssssssirsssiiesrirnssinnnstinnssttnnnntinnnntnn unseen nannt 114 Function Parameter li 115 Content Assist for Include
269. epository Exploring In the SVN Repositories view click the Add SVN Repository button A on the views toolbar or right click within the SVN view and select New Repository Location The Add SVN Repository dialog will open Enter the information required to identify and connect to your repository Click Finish Your SVN repository will be added to the SVN Repository view The connection details will be saved and can be easily selected when performing SVN actions on your projects and files See Configuring an SVN Connection for more information 40 Checking out a Module from SVN Zend Studio 5 x Set Subversion to be your Source Control default by following the steps under To define Subversion connectivity above Go to Tools Subversion Checkout Enter the repository details Set the Checkout Options Click OK Getting Started Zend Studio 7 x Create an SVN repository connection by following the steps under To define Subversion connectivity above Go to File Import Projects from SVN and click Next Select your repository and click Next Select the Use the Repository URL as the label option and select the required module project to check out Click Finish See Importing Projects From SVN for more information To perform Subversion commands e g update commit on an SVN module Zend Studio 5 x Zend Studio 7 x Set Subversion to be your Source Control default by following the
270. er Previous Displays a history of previously displayed type human Hierarchy hierarchies Inputs History Clear History Type Hierarchy Member List Pane Toolbar Commands ee a Lock View Only displays the members implementing the selected method and Show When the view is locked the member list pane no longer tracks Members in the selection in the Type Hierarchy Tree Pane Hierarchy Show All Shows or hides all methods and fields inherited by base classes Inherited When this option is enabled the name of the type that defines the Members method is appended to the method name Sort Sorts the members according to the type in which they are Members by defined the Defining Type 489 Zend Studio 7 User Guide Type Hierarchy View Menu Commands The view s menu can be accessed through the view menu icon Description Show the Type Supertype or Selects whether to display the type Subtype Hierarchy supertype or subtype hierarchy in the Type Hierarchy Tree Pane see above Allows you to view only types from within a specific Working Set See PHP Working Sets for more information Allows you to select the display of the panes within the Type Hierarchy view The options are Vertical View Orientation Horizontal View Orientation Automatic View Orientation Hierarchy View Only Show Qualified Type Names Displays only qualified type names Link With Editor If selected elements will immediately be displayed
271. er Information Execution Statistics Execution Flow Code Coverage Summary 501 Zend Studio 7 User Guide Profiling Monitor View The Profiling Monitor view displays a list of previously run Profiling sessions Expanding the list under a Profiling session allows you to select a Profiling view to display Profiling Thu Nov 22 13 32 23 IST 2007 EG Profiler Information EB Execution Statistics Je Execution Flow Ca Code Coverage Summary Da Profiling Thu Nov 22 13 32 38 IST 2007 Profiling Monitor View Toolbar Commands Description Delete Deletes a Profiling session from the list This will be enabled if a profiling Session session is selected Sort Click the arrow next to the Profile Session to sort the Profile Session list Profile by date or time Sessions The Profiling Monitor view is displayed by default as part of the Profiling Perspective To manually open the view go to Window Show View Other PHP Profiler Profiling Monitor 502 Reference Profiler Information View The Profiler Information view provides general information about profiling sessions such as duration date number of files constructing the requested URL and more In addition a Pie Chart is generated that shows the time division of the files in the URL CB Execution Statistics d Execution Flow FR Code Coverage Summary S General Information Tune Division Pie Chart URL Not Available Query
272. er Properties page right click a PHP project in PHP Explorer view and select Properties Resource or select the project and from the menu bar go to Project Properties Code Style Formatter w To configure Formatter Properties for the project 1 Mark the Enable project specific settings checkbox 2 Configure the settings according to your preferences See Formatter Preferences for more information on the settings available 3 Click Apply Default Formatter Properties for all projects can be set in the Formatter Preferences page accessed by going to Window Preferences PHP File Network or by clicking the Configure Workspace Seitings link on the properties page 628 Reference PHP Debug Properties The PHP Debug Properties page allows you to configure default settings used when debugging files in the project To access the PHP Debug Properties page right click a PHP project in PHP Explorer view and select Properties Resource or select the project and from the menu bar go to Project Properties PHP Debug Properties w To configure PHP Debug Properties for the project 1 Mark the Enable project specific settings checkbox 2 Configure the settings according to your preferences See Debug Preferences for more information on the settings available 3 Click OK to apply your settings Default PHP Debug Properties for all projects can be set in the Debug Preferences page accessed by going to Window
273. ere it is stored Exporting a user library will only export a description of the library in xml format and will not include any of the library s content y To export a user library 1 Go to Window Preferences PHP PHP Libraries 2 Inthe PHP Libraries Preferences page select the user library you would like to export and click Export The Export User Libraries dialog will open 3 Select the library you would like to export by clicking the check box beside it You may also use the Select All or the Deselect All buttons 4 To choose where you would like to export your library to fill in the File location text field with the URL or click Browse and select the location 5 To apply changes click OK Your user library has now been exported to the location you specified You may now import the exported user libraries from any location that has access to the location in which it is stored For more information see Importing PHP User Libraries 365 Zend Studio 7 User Guide Editing PHP Library Components or Folders This procedure describes how to edit user library folders Edit a user library folder when you have imported a folder who s original location is different from its content s location on your disk For more information see Importing PHP User Libraries wi To edit a library component 1 Goto Window Preferences PHP PHP Libraries 2 Inthe PHP Libraries Preferences page select the user library folder to edit an
274. erkni ea ea a a aea 24 First Steps for Developing Applications with Zend Gpdio 25 install Zend Studi TEE 25 aunch Zend StudiO tonii betes pete eed act tietara ienas oraaa ace ara aada deuy ara aaa k aKa 26 Install Zend Server optional 27 Cr atera PHP ere Ee 28 Greate Elek een Stebens SE eg 28 Create PAP lernen ee eebe eege eene ege 29 Write Coe EE 30 Rename Elements Refactoring ccccccceesseeeeeeeneeeeeecaeeeeeeeaeeeeeeaeeeeeeaeeeeeenaeeeeeeaeeeeneaa 31 RUM Ree le le BE 32 EE GE 32 Switching from Zend Studio 5 x to Zend Studio 7 X ceccceceeeeeeeeeceeeee cee eeeaeeeeeeeseeeeseaeeseeeteaes 33 Project File Creation vi cin aid ini iiei loch vad Selina odie Oates 33 D bUQGING DEE 35 Profiling ien ioaren a Cielo oa in eal ed eee dnd eit 39 Source Control Subversion GVN 40 FTP COnNGCUVILY reiia EN Alois Moin Eege ENEE din vee Ova 43 Database Connecti Nsitini iinei aia onl alia ta elaratae al 44 TUNERING EE 46 Basic UE 47 Zend Studio 7 User Guide Creating Projects and Files cccccececeeeeeeeceeeee eee eeeeaeeeeaaeseeeeeceaeeeeaaeseeaeeseeeeescaeeesaeeneaeeeeaes 48 Creating a PHP Project 48 Gre ating a le TT 49 Working with Content Aeslst ttnn nenn nnt 50 PUIpOSe ana Usd E oe AA is hcp AEEY 50 Activating Content Assist sense caaeeeeaaeseeeeeseaeeesaaeedeaeesseeeescaeeesnaeeneeees 51 Function Parameter Hints A 52 Making Content Assist Elements Available Within the Same Scope sssseeseeeeeeeeene 52 WE
275. ernatively you can gain access via the main menu 1 Click the file tab on the main menu 2 Click Import 3 Double click the Remote Connections 4 Double click Remote Project and the Import Project dialog will open up 5 Click Select to locate your Project from the Remote Connections folder 6 Double click on your project 7 Click on Finish The project will be created and appear on your workspace 436 Tasks Sharing a Local Project to a Connection This procedure describes how to share a local project to a connection Before sharing a local project to a connection you must have already created a remote server connection Creating a Connection via the Server View w To share a local project to a connection PF oO PM 6 Right click on the un shared project in the workspace Select Team Click on Share Project The Share Project wizard will open select the Remote Server node and click Next Ensure that the correct project has been selected If not Browse for the folder you will be uploading the project to and select it Click Finish Your shared project will now appear on your workspace identified with an icon 437 Zend Studio 7 User Guide Synchronizing a Local Project to a Connection This procedure describes how to synchronize a local project to a connection Before synchronizing a local project to a connection you must have already created a remote server connection y To synchron
276. ers Preferences page 216 Tasks To configure the automatically detected Zend Server In order to access the Zend Server GUI and Zend Server Event List from Zend Studio you will need to configure the Zend Server GUI password for the newly configured Zend Server by performing the following steps 1 6 Open the PHP Servers preferences page by going toWindow Preferences PHP PHP Servers Select the Zend Server from the list by default it will have been named Local Zend Server Click Edit Go to the Zend Server tab In the Authentication category enter the password used to access the Zend Server GUI Click OK and Apply You will now be able to access the Zend Server Event list by selecting the Zend Server from the the drop down list next to the Zend Server icon on the toolbar OR or by clicking the Show Server Event List icon Er in the Servers View Manual Zend Server Configuration w To manually configure a Zend Server Lk Open the PHP Servers Preferences page by going to Window Preferences PHP PHP Servers Click New to create a new server with Server Integration A PHP Server Creation dialog will open Configure the server as described in the PHP Server Preferences page enter the server s name and the URL of your document root If you are unsure of your Zend Server s document root see the Zend Server FAQ to find out what your docunent root is Click Next If necessary define Pat
277. eseeeeeeeeeeeaeees 348 Profilinga PHP Script visio Anti cen rete a ieee eb ene ae ee eee 349 Locally Profiling a PHP Gcrigt iiia iea 350 Remotely Profiling a PHP Geint 352 Profiling a PHP Web Page EE 354 Profiling a URL ic ecient Aa i ae el ieee 356 Profiling Using the Zend Browser Toolbar A 357 Managing PHP Libraries onenen tatnen iea aeea aaea ae aeaaea iin 358 PHP Libranes Ee EE 358 Adding a PHP EiIBrary EE 360 Adding External Folders to PHP Libyares 361 Importing PHP User Bee 364 Exporting PHP User TE TEE 365 Editing PHP Library Components or Folders c cccceeceeeeeceeeee cee eeeeaeeeeeeeceaeeesaeeeeaeeeneees 366 Editing PHP User Libraries ci ccccccccvcdsciccsccccceshias cpeeeccbesvadictenssiceeeebiacceneesesiessaacdveeanieeseebiaeces 367 Removing a PHP Library or Library Folder AA 368 Configuring a Project s PHP Include Path 369 Configuring a Project s PHP Build Path 371 Configuring Inclusion Exclusion Patterns for the Prolect nae 372 Configuring Different Inclusion Exclusion Patterns for Folders Within your Project 373 Adding External Source Folders to the Build Path 375 Adding a Server Location Path Map 377 Table of Contents Using PHP Bil LR le EE 379 Creating a PHPUnit Test Case cccccccccceesceceeeeeeeneeeeeaeeeeaeeceeeeesaaeeeeaaeeseaeeseeeescaeeseaeeeeeeeee 380 Running a PHPUnit Test Case 382 Creating a PHPUnit Test Suite cccccecececeeeeeeeeeeeeeaeeeeeeeseeeeceaeeeeaaesseaeeseeeesaeeseaeeneeeee
278. et the date when you will work on this task Tasks scheduled for today or a date in the past will appear in blue in your task list Tasks scheduled for future days will appear in black If your task list is in focused mode only tasks for the current week will be visible unless they have unread changes Due Set the date when your task must be completed Overdue tasks and tasks due today will appear in red in your task list Estimated Hours Estimate the number of hours it will take to complete this task Active Displays the total time that you have worked on this task Time is only recorded when this task is active and you are actively interacting with the system Notes Record your personal notes about this task Tasks Repository Tasks You can create a new repository task when you would like to share information about the task with your team using a task repository such as Bugzilla or JIRA To create a new repository task click on the New Task button in the Task List s toolbar You can then select the repository where you would like to create a task If you don t see your team s task repository you will need to configure it in the task repositories view Once you have selected a repository click Next If you are connecting to a Bugzilla repository select a Product as a top level category for your task and click Finish A new task editor will appear If you are using Bugzilla you can enter the following required information
279. eter Janine Jonas Susan Zbyszek Roland Julie Kwai Diego Christina Jytte RA mees o LJ 5 Click Save lal i The changes made will be automatically applied to the database For more information on the Data Tools Platform see the Data Tools Platform User Documentation 302 Tasks Creating a MYSQL Driver Definition This procedure describes how to create a driver definition for your database A driver definition maps to the location of your driver files You must have access to MySQL driver files before attempting to create a driver definition w To create a driver definition for MySQL 1 Open the Driver Definitions Preferences page by going to Window Preferences Connectivity Driver Definitions A list of driver definitions will appear in the preferences page Scroll down to the MySQL category and select the required MySQL driver Driver Definitions Gel a Available Driver Definitions 9 3 Ep 9 4 Ak S GR MySQL a G 4 0 E L PostgreSQL AM E 8 x L SQL Server E 2000 E 2005 a Sybase Ch 12 x i Restore Defaults Apply 4 Click Add The New Driver Definition wizard opens 303 Zend Studio 7 User Guide 9 10 11 12 New Driver Definition Specify a Driver Template and Definition Name Available Driver Templates as E MySQL IDB Driver Name MySQL JDBC Driver F Edit New Driver Definition Immediately d
280. ettings Debug 3 Editor Debug Transfer Encoding UTF 8 iv New Project Layout Debug Output Encoding UTF 8 iv PHP Executables PHP Interpreter PHP Libraries Break at First Line PHP Manual PHP Servers PHPUnit Semantic Analysis Prog sy lt 1 7 Gi Restore Defaults Apply 2 Inthe Debug Options section ensure the following default settings are configured The Zend Debugger port number must be 10137 n the Advanced Zend Debugger Options category the Broadcast Port must be set to 20080 Inthe Client Host IP category enter the Client Host IP to which debugging results will be returned Zend Studio for Eclipse will automatically search for and recognize the Client Host IP but entering a specific Host IP will soeed up the debugging process and decrease the likelihood of session time outs The next step in creating a tunneling connection is to Set your Environment to be an Allowed Host 616 Reference Zend Guard Preferences Zend Guard protects your commercial PHP 4 and PHP 5 applications from reverse engineering unauthorized customization unlicensed use and redistribution The Zend Guard Preferences page allows you to set Zend Guard s location so that it can be accessed by Zend Studio The Zend Guard Preferences page is accessed from Window Preferences PHP Zend Guard Zend Guard Cas Zend Guard location Browse wi To configure your Zend Guard s location 1 Click Browse
281. ettings link on the properties page 632 Reference Project References Properties The Project References Properties page allows you to set the projects which are referenced by your project This affects actions such as opening and closing of projects i e if you close a project and re open it you will be prompted to also open the projects which it references To access the Project References Properties page right click a PHP project in PHP Explorer view and select Properties Resource or select the project and from the menu bar go to Project Properties Project References Properties Project References Zei Projects may refer to other projects in the workspace Use this page to specify what other projects are referenced by the project Project references for abc Jl Ef Emal App O S exampleProject C i New Welcome Page O B ZendFrameworkExample g SS zFProject w To set the projects referenced by your project 1 Mark the checkbox of the projects that are referenced within your project 2 Click OK The selected projects are now specified as referenced by your project 633 Zend Studio 7 User Guide Refactoring History The Refactoring History Properties page allows you to view all refactoring operations that have been performed on the project To access the Resource Properties page right click a PHP project in PHP Explorer view and select Properties Refactoring History or select the proje
282. ew string 240 Tasks Applying Quick Fixes Quick Fixes are suggestions for corrections to badly written code provided by the Semantic Analysis mechanism which can be easily applied to code to fix code errors w To apply a quick fix suggestion 1 Open the file containing the problematic code The line s containing code to which a quick fix can be applied will be indicated by a lightbulb icon in the vertical marker bar to the left of the editor window See Real Time Error Detection for more information on how errors are indicated 2 Place the cursor on the problematic code section and press Ctrl 1 or click the lightbulb icon in the marker bar The Quick Fix list suggests options for fixing the code 1 lt php hello Hello World ub 4 echo helio E 2 e Change to hello 3 Select the required fix from the list by clicking on it or by using the arrow keys and pressing Enter 4 The selected fix is applied and the code is changed accordingly 241 Zend Studio 7 User Guide Adding Comments Zend Studio allows you to quickly and easily comment and uncomment code by selecting a line or a block of text and tagging it as a comment Comments can be added to single lines of code Ctrl or blocks of code Ctrl Shift In addition special PHPDocBlock comments can also be added See Adding PHP DocBlock Comments for more information The following procedures describe how to
283. exports and JSDT Global Scope Resolution Order De SLEDS C Stee Lorary ae aL Ts JavaScript file SuperType Every Li file wall inherit the Super Type fields methods Window in ECMA 3 Browser Support Select amp Re order Libraries Cee In addition the Global SuperType tab allows you to select a SuperType class All JavaScript elements which are not defined in their own class will automatically be added to this class This will allow you to select these elements from the Content Assist list according to the SuperType Class name you selected To configure the SuperType class 1 Click the Select amp Re order Libraries button The JavaScript Sourcefile SuperType Selection dialog will open 2 Select the class name for the SuperType class and click OK All elements which are not defined in a class will be added to the selected class Entering the class name will display these elements in the Content Assist list 456 Tasks Source Tab The Source tab allows you to include exclude specific files folders and variables from the JavaScript Build Path JavaScript Libraries Oe BA Libraries o Gobal SuperType Gh Source E gt Projacts Source files and folders in the Global Scope e MyProject d ui H CT DC Excluded None Unk External Folder Add File From Filesystem Add File From Project To add a folder from your Workspace 1 Click Add folder The Source Fo
284. f a project See Creating PHP Files for more information PHP Debugging The Zend Debugger detects and diagnoses errors in PHP code situated on local or remote servers y To debug a PHP script situated on your workspace 1 Set breakpoints at the relevant locations in your script by double clicking the Marker Bar located at the left of the editor area at the relevant line A blue ball appears to indicate that a breakpoint is set 2 From the main menu select Run Open Debug Dialog Or right click the file in PHP Explorer view and select Debug As Open Debug Dialog To create a new configuration double click the PHP Script category Under the Debugger Location category choose whether you want to debug locally using the internal debugger PHP executable or remotely using your server s debugger PHP Web Server 5 Enter all other information and click Apply and Debug 21 Zend Studio 7 User Guide w To debug a PHP Web page situated on a server 1 From the main menu select Run Open Debug Dialog or right click the file in PHP Explorer view and select Debug As Open Debug Dialog To create a new configuration double click the PHP Web Page category 3 Enter the required information and click Apply and Debug Debugging Preferences can be configured from the Debug Preferences page which can be accessed from Window Preferences PHP Debug See Debugging for more information Remote Server Explorer
285. ferences page is accessed from Window Preferences PHP Editor Zend Framework 596 Reference w To configure the Zend Tool Console display settings 1 Configure the following options Zend Tool Consolse Settings Fixed width console Mark the checbox to limit the width of messages displayed in the Zend Tool console Enter the required width in characters The value must be between 1000 and 2 147 483 646 Limit console output Mark the checkbox to limit the amount of characters stored and displayed in the Zend Tool Console Enter the required size in characters The value must be between 80 and 2 147 483 646 Automatically show Zend Tool console when a Zend_Tool command is executed Mark this checkbox for the Zend Tool Console to be automatically displayed whenever a command which utilizes the Zend_Tool e g create new Zend Framework project is executed Console text color settings Edit the colors for text displayed in the Zend Tool Console for the following Command line 7 Messages Errors displayed Zend Tool Floating Window Settings Provide content assist in Zend Tool Floating Window Provides content assist options for Zend_Tool commands in the Zend Tool Floating Window See Using the Zend Tool Floating Window for more information 2 Click Apply to apply your settings 597 Zend Studio 7 User Guide New Project Layout Preferences The New Project Layout Preferences page allows you to configure
286. file Or To create a new project i Click Create New Project The New PHP Project dialog will be displayed ii Enter the Project name and click Finish The new project will be added to the list Select it to save your file within your new project iii Edit the file name iv Click OK Your file will be saved within the selected project and will be available for running debugging and profiling operations Opening an External File These procedures describe how to open external files in Zend Studio External files can be opened in Zend Studio in three ways Dragging and dropping the file into Zend Studio Double clicking the file Windows only Using the Open function in Zend Studio Once external files have been opened in Zend Studio you can perform operations such as running debugging and profiling on them wi To open a file by dragging and dropping 1 Find your file in your external file system 2 Have both Zend Studio and your file system explorer open and visible on your desktop 3 Drag and drop the file into the editor space in Zend Studio The file will be displayed in an editor and will be available for Zend Studio operations such as debugging and profiling 191 Zend Studio 7 User Guide 192 To open a file by double clicking 1 If the file type you are trying to open was associated with Zend Studio during installation simply double clicking it in your external file system will cause it to be opened in Ze
287. fo Chent Host IP 10 1 2 103 127 0 0 1 Broadcast Port 20080 e Dummy Fie Name dummy php C Use SSL Encryption L I To automatically synchronize your Zend Browser Toolbar settings with your Zend Studio settings 1 Ensure Zend Studio is open If your Zend Studio executable is configured in the Zend Toolbar Settings dialog you can launch Zend Studio by clicking the Zend Studio button zend in the toolbar In the Zend Studio Settings category select Auto Detect Settings Enter the Zend Studio Broadcasting Port This must match the Broadcasting Port configured in your Zend Studio debug preferences The default port is 20080 Click Test The Debug Port and Zend Studio IP settings defined in Zend Studio will be automatically updated in your Zend Browser Toolbar and a message will appear confirming that the Auto Detect test was completed successfully To manually enter your settings 1 Select Manual Settings 2 Configure the following settings Zend Studio Debug Port The debug port to be used for the debug session This should match the Debug Port setting configured in your Zend Studio debug preferences Zend Studio IP Address Enter the Client Host IP address of the machine on which your Zend Studio is installed This should be the same machine from Tasks which you are launching your debug session This should match the Client Host IP setting configured in your Zend Studio debug preferences
288. for the project 1 Mark the Enable project specific settings checkbox 2 Configure the settings according to your preferences See Task Tags Preferences for more information on the settings available 3 Click OK to apply your settings Default Code Templates Properties for all projects can be set in the Code Templates Preferences page accessed by going to Window Preferences PHP Code Style Code Templates or by clicking the Configure Workspace Settings link on the properties page 623 Zend Studio 7 User Guide Formatter Properties Zend Studio can auto format scripts to organize them into an easily readable format The Formatter Properties page allows you to customize the way they are formatted for the project To access the Formatter Properties page right click a PHP project in PHP Explorer view and select Properties Resource or select the project and from the menu bar go to Project Properties Code Style Formatter w To configure Formatter Properties for the project 1 Mark the Enable project specific settings checkbox 2 Configure the settings according to your preferences See Formatter Preferences for more information on the settings available 3 Click Apply Default Formatter Properties for all projects can be set in the Formatter Preferences page accessed by going to Window Preferences PHP File Network or by clicking the Configure Workspace Seitings link on the properties page 624 R
289. function call trees arguments and return values function execution duration memory usage and indication for an executed files name and line of code This enables you to capture problems when they occur which eliminates the need to set up environments and reproduce the steps that led up to the failure Zend Studio allows you to import a amf or xml file A amf file is an event file which can be opened without access to Zend Server The event file opens in the Zend Server Code Tracer Perspective and eliminates the need to recreate errors Instead you can locate errors directly in the trace data and then Open the Source of Trace Data You may then edit the source inside of the corresponding local file A xml file is an event file which allows you to recreate an error when you have access to the Zend Server on which the event occurred See Importing Events Into Zend Studio for more information In order to import a Zend Server Event File you must first export a Zend Server Event File from your server For more information see Exporting Trace Information in the Zend Server Online Documentation Having an active connection with a licensed version of Zend Server or Zend Server Cluster Manager allows you to fully integrate the Code Tracing feature For more information see Zend Server 204 Importing a Zend Server Event File 1 2 Event File and click Next Select Import a Zend Server Event file Select an import so
290. function method declarations At beginning of function method body Existing Blank Lines Number of empty lines to preserve New Lines The New Lines tab allows you to select when new lines will be created 1 Edit Profile a H EE Indentation Braces White Space Blank Lines New Lines Line Wrapping Insert new ine Min empty class body Lin empty method body Lin empty block class EmptyBody I Clinsert new line after opening parenthesis of array i geg Example LU reet new ine before closing parenthesis of array function emptyFoo Empty statements function foo l 3 do t v statement ine pn empty ne while false for i zt Array rgiskzerz The New Lines tab contains the following options Insert New Line Select whether to insert a new line in the following conditions In empty class body In empty method body In empty block Array Initializers Select whether to Insert new line after opening parenthesis of array initializer Insert new line before closing parenthesis of array initializer 566 Reference Empty statements Select whether to put empty statements on a new line Control Statements The Control Statements tab allows you to configure the line formatting for Control Statements Show Profile PHP Conventions built in Gereral Preview J Insert new be before else and else in an F st lt php Insert new line before catch in a try statement ds _JIn
291. g Perspective cccceeeeeceeeeeeeneeeeeenaeeeeeenaeeeseenaeeeeeenaeeeeseaaes 494 Breakpoints View PHP Debug Perspechhvel 496 Parameter Stack View PHP Debug Perspechhvel 498 Expressions View PHP Debug Perspective A 499 PHP Profile Perspective cccccescceceeeecceeeeeeeceeeeeeececesneeaeeeeaececesneaeeeeneeeeeesnneaeeesneeaeenennaaes 501 Profiling Monitor EE 502 Profiler Information VION sercon seina T EA E a 503 Execution Statistics View 504 Execution FIOW ViOW cccceesecceeeeeecceeeeeeeeeseeeeneeeeeeeeeese E A E E AAR 506 Code Coverage Summary View 508 Zend Server Code Tracer Perspective ccccccceeceeeeeeeeeeaeeeeeeeceeeesaeeeeaaeseeeeeseaeeeeaeeneneeee 509 Tracor VEN Eege Eege Eege deeg ees Een 510 ee etc IO 511 PHP Functions View 1 0 20ciew leven A ae nt lei del it eleva alee 511 PHP Project Outline View 513 PHP Perspective Mentee ale ENNEN ENNEN EEN 514 el E 516 New SUBMENU ii voted tte vate tee Foe Bel in Heger Sin Feed Sl eel de ed eels 519 ul eege TTT EE 523 Expor TEE 525 EG MOM WEE 527 Source MENU ren sete aaa a aaea eens a raaa ien ee Tee Aaa geet Tee Leer Eise eeue 529 Refactor EE 531 K NT 532 SEACH MON navrae a a ee a ohh deed ENEE Nee eege 534 Project ETH 536 Ep Meng E PNA A E Egeter TE Die T Deg dg E 538 Navigation SubMe EE 540 Window SUBMENU TE 541 Help Monu A aeee aR REN AE An ag Sena EEE E ANd ESER E AEA RAE 543 PHP Perspective Main Toolbar A 545 PHP
292. g Settings Open the PHP Server Preferences page 2 Define the relevant tunneling settings by going to the Menu Bar and selecting 3 Click Connect Window Preferences PHP PHP Servers Click New to define a New Server or Edit if the server has already been defined Enter any relevant settings in the Server Path Mapping and Zend Server Integration tabs In the Tunneling Settings tab check the Enable Tunneling option and enter all necessary information Click Finish or OK You can now use this server configuration to connect to your server using a tunneling connection by clicking the Tunneling icon on the toolbar i See Setting Up a Tunneling Server for more information To configure a tunneling connection between Zend Studio and your server settings also need to be configured on your server See Setting Up Tunneling for full instructions on setting up a Tunneling connection with your server 46 Getting Started Basic Tutorials The Basic Tutorials section contains short tutorials on popular tasks that can be performed with Zend Studio Each tutorial covers workflow issues from A Z describing the processes and workflow that should be followed in order to complete the tasks Get up and running with one of these tutorials Creating Projects and Files Refactoring Working with Content Assist Working with PHPUnit testing Working with the Debugger Working with the Profiler Working with CVS Working with Zend Se
293. g View Here you can control stop pause and resume the debugging process You can also decide whether to step into step over or step return step out off certain functions Variables Will display the various variables in your script Breakpoints Will display the breakpoints you have entered Parameter Stack Will display the parameters through which functions are reached Tasks Editor Window Will display the code at the relevant sections according to which line is selected in the Debug View window Debug Output Will show the textual output of the script This will be updated as the debugging process continues Browser Output Will show the output of the script to a browser This will be updated as the debugging process continues Console View External Link Displays any error and warning messages Tasks View External Link Displays tasks that were added to your script if applicable See PHP Debug Perspective for more on the views that will be displayed during Debugging 335 Zend Studio 7 User Guide Setting Up Remote Debugging Before debugging on a server whether using remote PHP Script or PHP Web Page debugging certain settings need to be configured to ensure that Zend Studio can communicate with your server w To set up communication between Zend Studio and the server on which you are debugging 1 336 Ensure the Zend Debugger is installed on your server The Zend Debugger
294. g the Zend Browser Toolbar This procedure describes how to Profile using the Zend Browser Toolbar S To Profile using the Zend Browser Toolbar 1 Ensure the Zend Browser Toolbar is installed on your browser 2 Open your browser and browse to the page from which you would like to start profiling 3 Ensure Zend Studio is open You can open it by clicking the Zend Studio button Ke Zend in the toolbar 4 Click the inilProfile button on the Zend Browser Toolbar to profile the page currently displayed in the browser The relevant Profile session will be launched in Zend Studio If Zend Studio is not open you will be prompted to open it before the profiling session is launched 357 Zend Studio 7 User Guide Managing PHP Libraries PHP Libraries Preferences The PHP Libraries Preferences page allows you to create and maintain an external code library Enabling PHP Libraries in your project allows libraries to be referenced by the project and makes the elements within these resources available for operations such as Content Assist and Refactoring You may change the order your user libraries are in by using the Up and Down buttons The order in which the libraries are arranged in this page defines the order they are available in Zend Studio s functionality such as content assist The PHP Libraries Preferences page allows you to do the following Add PHP Libraries Add External Folders to PHP Libraries Export PHP User Libraries
295. gger_error Function Arguments 1 This is a user triggered error 2 256 Zend Studio Diagnostics Debug Event Change status to Closed Q Admumustration Jg Page last refreshed 25 Mar 2009 11 10 e G Status Open Severity Warning C Program Files Zendpache2inidocs issues php Source File imore _ Aggregation Hint testing 1235057125 Error Type E_USER_ERROR Error Data Profile Event Show File in Zend Studio v Settings 213 Zend Studio 7 User Guide 4 To select the server on which the debug profile session will be run click the Settings button This gives you access to the following options Originating server This will debug the event on the server from which the event originated Alternate server Allows you to debug the event on a different server this server must also be running the Zend Debugger Enter the IP address of the required server 5 Click the button to save your settings Click the _DebugEvent or _ Profile Event button The relevant debug profile session is launched in Zend Studio If Zend Server cannot connect to Zend Studio see both the see the Setting Up Zend Server Integration topic and the Error Failed to Communicate with Zend Studio topic in the Zend Server Online Help http files zend com help Zend Serverzend server htm for more information 8 See Running and Analyzing Debugger Results for more information on running a debug
296. ging a file is called from location C Documents and Settings MyProject a php lt php echo a php include C Documents and Settings MyProject a php gt The file content for a php will be taken from the a php file located in the MyProject project situated on the Workspace Server Path Maps can be viewed and defined in the Path Mapping tab of the PHP Servers Preferences page 158 Concepts Defining Path Maps Path Maps can be defined in three ways 1 Manually through the PHP Servers Preferences page See Adding a Server Location Path Map for more information Automatically whenever a file is debugged profiled A Path Map is automatically set between the path to the debug target s parent project the parent project of the file from which the debugging process has been launched e g C Workspace MyProject and the debug target s project in the Workspace e g MyProject Through the Path Mapping dialog This is launched during debugging profiling whenever a file defined with an absolute path See Include Paths for more on absolute file locations is called In this scenario a Path Mapping dialog will appear with a list of similar files to the one being called Similar files are files with the same name as the called file that are situated in the following locations Files in the project from which the file was called Files in projects that are in the Include Paths of the project from which th
297. go to Search Search or press Cirl H The PHP Search dialog will open Search E Remote Search HP File Search i Task Search E BSP JavaScript Search Se PHP Search Search string any string any character K C Case sensitive Search For Limit To Type Method O Declarations References O Field O All occurrences E Search the Interpreter system libraries Scope Workspace Jelected resources Enclosing projects O working set PHP Search dialog 2 Enter a search string You have the option of using Wildcards 229 Zend Studio 7 User Guide You can make your search case sensitive by selecting the Case sensitive box 3 Select whether to search for a Type A class This option will search for both methods and fields Method A function Field A constant 4 Select whether to limit your search to Declarations The location where the type method or field are defined References Anywhere the type method or field are referred to All occurrences Anywhere the type method or field are referred to or declared 5 To extend your search to include interpreter system libraries select the Search the Interpreter system libraries box This allows Zend Studio to search in the libraries of the PHP version you have selected in the PHP Interpreter Preferences 6 Select whether to search in Workspace The entire workspace Selected resources
298. graded version of the Remote Systems View that reduces the amount of communication between networks by using less connection nodes RSE also communicates less data by directly transferring information rather than copying all of the files 182 Concepts Remote Server Support RSS Remote Server Support provides transparent access to remote resources including the upload and download of files RSS helps you to create view and manage your connections to remote systems such as FTP and SSH This will allow you to work on projects with local files remotely enabling you to create view and manage your connections to remote systems RSS enables you to perform the following tasks Creating a Connection via the Server View Create different types of connections for creating and managing projects Creating a New Remote Project This procedure describes how to create a new remote project Once the remote server has been set up you can create a new project which will be synchronized with one of the remote servers Downloading a Project from an Existing Connection This procedure describes how to download a project from the server from a connection that already exists Sharing a Local Project to a Connection This procedure describes how to share a project from your local server to a remote connection Synchronizing a Local Project to a Connection This procedure describes how to synchronize download a local project from server and
299. gs 2 Select the required project from the list A Semantic Analysis Properties page will appear 3 Select the required settings and click Apply A prompt dialog will appear stating that a rebuild of the project must occur for the settings to take effect 4 Click Yes to rebuild the project Or click No for a rebuild to be performed only when Zend Studio is restarted Or click Cancel to cancel the operation Semantic Analysis settings can also be configured for an existing project by right clicking the project in PHP Explorer view and selecting Properties Semantic Analysis Properties 615 Zend Studio 7 User Guide Configuring Tunneling Debug Preferences Before initiating a debug session using tunneling you must ensure the correct port numbers are configured in the Debug Preferences page This procedure describes how to configure your Debug preferences to enable tunneling S To configure Debug Settings for Zend Studio 1 Open the PHP Debug Preferences page by going to Window Preferences PHP Debug PHP Debug General a Data Management Confiqure Project Specific Settings Dynamic Languages Field Assist Default Settings Help PHP Debugger Zend Debugger EN Configure Install Update PHP Server Local Zend Server x PHP Servers Appearance Code Coverage PHP Executable PHP 5 2 10 CGI PHP Executables Code Gallery Code Refactor Code Style Encoding S
300. guration settings 1 Click New Enter a name for you profile Select which profile to base your new profile on This will duplicate these settings and allow you to edit them Ensure that the Open the edit dialog now checkbox is marked and click OK The Edit dialog will open with the following tabbed option screens Indentation a Braces 562 White Space Blank Lines New Lines Control Statements Line Wrapping These are described in more detail below Reference 6 Once you have set the required options click OK The new configuration will be added to the list The options available in the various formatter tabs are Indentation The Indentation tab allows you to configure the indentation size and select which elements should be indented 1 Edit Profile e ea Indentation Braces White Space Blank Lines New Lines Line Wrapping General settings Tab policy PM Declarations within class body F Statements within method Function body F Statements within blocks El Statements within switch body Lei Statements within case body D tresk statements C Empty ines Preview lt php class Example var theInt iz function foo fa b switch a case Dr Other gt doFoo OO break default Other gt doBaz y gt L as Ice The Indentation tab contains the following options General Settings Tab Policy Select Tab or Spaces from
301. h Map to a server so that files which are called from a certain location on the server will be searched for in a local location during remote PHP Script debbuging profiling and PHP Web Page debugging profiling This will only apply when the use local copy option is selected in the Advanced tab of the PHP Web Page debugging configuration See Path Mapping for more details y To add a Path Map to a server ds 8 oa fF ON Open the PHP Servers Preferences Page by going to Window Preferences on the Menu Bar and selecting PHP PHP Servers from the Preferences list Select the server on which you would like to create the Path Map and click Edit In the Edit Server dialog select the Path Mapping tab Click Add An Add new Path Mapping dialog appears Enter the Server Path from which you would like to create the Path Map Files called from this location will be searched for in the path specified below Select either the Path in Workspace or Path in File System option and click Browse to specify the location Add new Path Mapping Path on Server C Documents and Settings MyProject Path in Workspace iMyProject O Path in Pie System Click OK Your Path Map will be added to your server list 377 Zend Studio 7 User Guide The next time a file is called from the Path on Server it will be searched for in the local location you have specified Path Mapping can also be set automatica
302. h Mapping See Adding a Server Location Path Map for more information Click Next The Zend Server Configuration dialog is displayed 217 Zend Studio 7 User Guide PHP Server Creation Zend Server Configuration Configure Zend Server integration options Enable Zend Server integration Zend Server URL Cluse Defaut URL Suffix jZendServer Port Number 10081 Authentication Password eese e Zend Server Configuration dialog 7 Mark the Enable Zend Server integration checkbox to enable Zend Server integration functionality 8 Leaving the Use default checkbox marked will create a URL in the format lt server s document root gt ZendServer gt If necessary unmark the checkbox and edit the following URL Suffix The suffix which should be added to the URL of your document root in order to browse to your Zend Server GUI Port number Enter the port number you defined during Zend Server installation See the Zend Server FAQ site for default port number settings 9 Enter the password for your Zend Server GUI 10 Click Next to configure Tunneling settings or Finish to create your server Your Zend Server is added to the Zend Server list and will allow you to use Zend Server integration features Your Zend Server is now available from the arrow next to the Zend Server icon on the toolbar e 0 a a Local Zend Server Default PHP Web Server PHP Web Server Configurations 218 Tasks C
303. h the element highlighted 232 Tasks Opening Types Methods You can open any method or type in your workspace using the Open Type wizard or the Open Method wizard w To open a Type or Method 1 From the Menu Bar go to Navigate Open Type or Open Method Or press Ctrl Shift T for a type or Ctrl Shift M for a method The Open Type Method dialog will appear If a tyoe method was previously selected in the editor or outline views it will be displayed Open Method Select a method to open any character any String TZ TimeZone 4 _ Matching methods doNothing 17_class_interface php default package doSomething Ce 2 Begin typing the string of the required type method to filter the results You may use wild cards or CamelCase notation e g DTB for DateTextBox Select the required type method from the list and click OK You may restrict the results displayed in the Open Type list to a particular Working Set through the wizard s menu accessed by clicking the arrow in the top right corner An editor will open on the selected type method The Open Type dialog maintains a history of recently opened types These are shown when the dialog is opened and stay above a separator line when you start to type a filter expression 233 Zend Studio 7 User Guide Using Smart Goto Source This procedure describes how to use the Smart Goto Source function in order to easily naviga
304. he In place refactoring feature is activated will not display a preview of changes or from the Rename Element dialog 393 Zend Studio 7 User Guide Renaming Elements within the Editor To rename an element within the editor 1 Ensure the Rename in editor without dialog checkbox is marked in the Code Refactor Preferences page accessible from Window Preferences PHP Code Refactor In the editor place your cursor on the element to be renamed 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 function display _workers global db for i 0 Znscount db i lt n i vorker_data fdb i D by print lt tc bgcolor cow color ai i gt p j print lt td gt Sworker n lt f cta gt ns print lt tcd gt worker_address lt td gt n print lt td gt worker_phone lt td gt n print lt tr gt n 4 Type the new element name in the box All occurrences of the element name are automatically updated To preview the changes before applying them click the arrow in the right hand corner of the Refactor popup and select Preview 5 Click Enter to apply the refactoring A dialog is displayed prompting you to save the file before the refactoring is applied 6 Mark the Always save all modified resources automatically prior to r
305. he Preview window scroll through the changes and note that as well as the name of the file itself being changed the reference to the file in RenFile2 will also have been changed 8 Press OK to apply changes The reference to RenFile1 in RenFile2 will have been updated to the following in order to reflect the changes in the file name require RenFile3 php 82 Moving a file Getting Started Moving a file will result in the automatic updating of all instances where that file is referenced within the project to reflect its change of location w This procedure demonstrates how to move a file 1 Create RenFile1 and RenFile2 as described in steps 1 to 3 under Renaming a File above Within the same project create an additional folder called RenFolder In PHP Explorer view right click RenFile1 and select Refactor Move or select it and go to Refactor Move from the Main Menu In the Move dialog select RenFolder Click Preview The Preview windows will display the changes that the move will apply to your script Note that RenFile1 s new location will automatically be updated in the reference to it in RenFile2 6 Click OK to execute the Move Renaming Elements within a File All PHP Elements e g classes interfaces functions methods can also be renamed and refactored from within the editor window S This procedure demonstrates how to use the Rename Elements feature 1 Par won Create 2 files
306. he arrow next to the debug button E on the toolbar and select your launch configuration See Debugging a PHP Web Page for more information 38 Getting Started Profiling In addition to Profiling applications on a server Zend Studio 7 x includes the option to profile PHP Scripts situated on your workspace using the internal debugger or your server debugger See Profiling a PHP Script for more information To profile applications on a server Zend Studio 5 x Zend Studio 7 x Og From the Menu Click the profile URL button on the main toolbar or Bar select Debug Profile URL The Profile URL dialog will appear Enter the URL of the file application from the Menu Bar go to Run Profile URL The Profile URL dialog will appear In the Open Browser at field enter the URL of the page that should be profiled Click Profile which you would like to Profile In Zend Studio 7 x creating a Profiling launch configuration gives Select whether to you access to advanced Profiling options and allows you to easily use the local copy re run past profile sessions using the same settings or server copies Of To create and execute a Profile Launch Configuration for the files profiling applications on a server 4 Click OK Click the arrow next to the Profile button dE on the toolbar and select Profile Configurations amp endash or select Run Profile Configurations A Profile dialog will open Doub
307. he referenced WSDL file into a link by hovering over the file s name and pressing CTRL Clicking the link while CTRL is still pressed will jump to the WSDL file if it is already open in the editor Auto Link to Files exists for every string containing a file name in the editor 428 Tasks Viewing RSS Feeds These procedure describe how to view RSS feeds within Zend Studio s RSS view and how to add additional RSS channels Ky To view RSS feeds E 1 Open the RSS view by going to Window Show View RSS CS 2h Problems 45 Tasks El Consale iS RSS di in OTT bh Zend Developer Zone zend In the Press f Yahoo Acquisition Target Pioneers PHP Framework Use Zend Framework hits 1 0 milestone Zend Will Launch New version of Web Development Program Coming Soon Zend PHP Framework 1 0 Zend Framework 1 0 Ready To Compete d 2 The RSS reader comes pre loaded with the Zend Developer Zone feed and the Zend In the Press feed 3 Click the required heading to expand the list and see all the news items underneath it You can group the items by channels or by time by clicking the view s menu icon ki and selecting the relevant option Group by Channels Group by Time 4 Double click the item you want to view to open it in Zend Studio s internal browser w To add an RSS channel 1 Open the RSS view by going to Window Show View RSS 2 Click the views menu icon and select Subscribe 3 The Add New Channe
308. her copies of the files which are located on the server or the files located locally on your workspace if available Your server must be running the Zend Debugger or XDebug in order for remote debugging and profiling capabilities to function The Zend Debugger comes bundled with Zend Server Zend Core and Zend Platform but can also be downloaded as a separate component from http www zend com en products studio downloads S To run a PHP Web Page 1 Click the arrow next to the Run button oh on the toolbar and select Run Configurations or go to Run Run Configurations A Run dialog will open 2 Double click the PHP Web Page option to create a new run configuration Name Form Server Advanced IT Common Server Server Debugger Zend Debugger PHP Server Defaut PHP Web Server zs new _ Configure Test Debugger File a epee Breakpoint rN URL Z Auto Generate Ir p Si 7 3 Enter a name for the new configuration 4 Select the Server Debugger to be used by default this will be the Zend Debugger supports both the Zend Debugger and XDebug 312 Tasks 5 Select your server from the PHP Server list If you have not yet configured your server click New The PHP Server Creation Wizard will open Configure your server by following the instructions on adding a new server under the PHP Servers Preferences page For more information on configuring the communication between Zend Studio and your remot
309. hether to generate a PHP Docblock for each entry 5 Click OK The relevant getter and setter functions will be generated for the selected functions 403 Zend Studio 7 User Guide lt php class Person private fage private id public name return vupkncwn public function getAge 1 return this gt age Qparam unknown type fage public function setge fage this gt age Sage i 404 Overriding Implementing Methods Tasks The override implement method feature provides a mechanism for overriding implementing methods defined in a class s parent or interface w To override implement methods 1 Place your cursor within the class for which you would like to override implement methods 7php abstract class ParentClass t function doNotImplement l static function funi t echo This a parent method j abstract function fun 7 final function fun3 private function Zong 11 protected funetion funs public funetion fun6 i clase Child 1 extends ParentCiass t mis a selil empty cussed G Undo Text Change i Revert Fle Save Paste Coney Refactor Format Format Active Elements Open Declaration P T Properties eh Gatters and Setters 2 Right click within the class s source code and select Source Override Implement Methods Or Right click the required class in PHP Explorer view and select Source Override Implement Methods The
310. hich you do not want to inspect during debugging This is especially useful if you have included large external resources Such as a framework or library Step Filtering v Step fiters are applied when the Use Step Fiters checkbox is marked M Use Step Fters page sees o z EI index php L Add Fiter _ Lal ci Documents Ce Coma To enable the step filtering feature mark the Use Step Filters checkbox and the add the required resources to the Defined step filters list The Step Filters functionality can be toggled on off during debugging by clicking the Use Step Filters button on the Debug view toolbar To add a file name pattern to exclude 1 Click Add Filter The Add Step Filter dialog is displayed 2 Enter the pattern to filter Wild cards are enabled so entering index php will exclude all resource paths ending in index php 3 Click OK The file exclusion pattern will be added to the step filters list 575 Zend Studio 7 User Guide w To add a resource to exclude 1 Click Add Resource The Select Resource dialog is displayed 2 Select the resources projects folders files which you want to exclude and click OK The selected resources will be added to the step filters list 576 Reference Workbench Options Preferences The Workbench Options preferences dialog allows you to configure the default behavior of the workspace during the debugging process The Workbench Options Prefer
311. hile temp indexOf word gt 0 temp temp substr 0 temp indexOf word replacement temp substr temp indexOf word word length return temp 40 41 All instances where the element is referenced within the file will be highlighted 467 Zend Studio 7 User Guide KY To configure Mark Occurrences settings 468 1 To toggle mark occurrences click the Toggle Mark Occurrences button A on the toolbar or press Alt Shift O To configure further Mark Occurences preferences go to the JavaScript Mark Occurrences preferences page accessed from Window Preferences Web JavaScript Editor Mark Occurrences Mark Occurrences s The appearance can be configured on the Annotations preference page Z Mark occurrences of the selected element in the current file Lite constants M Local variables F Function eats F Targets of break and continue statements V keep marks when the selection changes CSJ Mark the Mark occurrences of the selected element checkbox to enable the Mark Occurrences feature Select which element s occurrences will be marked by marking the checkboxes next to the required elements Mark the Keep marks when the selection changes checkbox for marks to continue to be displayed once the cursor has been moved from the selected element Click Apply to apply your changes The appearance of marked occurrences can be configured in the Annotations preferences page Win
312. hin the Find Next Ctrl Shift J active file Previous To use this feature press Ctrl J and the first few letters of the required string The relevant text will be highlighted in the file While in this mode the up and down cursor keys can be used to navigate between matches The search can be cancelled by pressing left right Enter or Escape Add Inserts a bookmark into your script Bookmark Bookmarks are used to easily navigate to specific sections in your scripts You can attach a descriptive name to each Bookmark which can be later seen in a tooltip next to the Bookmark 527 Zend Studio 7 User Guide en Soret Tome O Bookmarks are indicated by a bookmark icon 2 in the left margin Open the Bookmark view 5 Window Show View Other General Bookmarks to navigate between existing Bookmarks Add Task Inserts a task into your script Tasks are used as reminders to the programmer For maximum effectiveness tasks should be placed next to the section of code on which the action will be implemented Open the tasks view L Window Show View Tasks to navigate between existing tasks Show Tooltip Shows the value of a hover that would appear at the Description current cursor location The dialog shown is scrollable and does not shorten descriptions Word Completes a word being typed Enter the first few letters Completion of the word and press Alt to complete the word Completes a prefix to a word occurring i
313. httod conf where lt installation_directory gt is the location of the directory in which Zend Server is installed Linux f you installed Zend Server from a repository DEB or RPM packages the location of your configuration file is defined by your distribution s Apache packages and will vary depending on your distribution and configuration e Common locations include o Debian Ubuntu etc apache2 apache2 conf o Fedora Core RHEL CentOS etc httpd httpd conf e f you installed Zend Server using the generic Tarball package ust local zend apache2 conft httpd conf e f you changed the location of your Zend Server installation your document root will be located at lt installation_directory gt apache2 conf httpd conf where lt installation_directory gt is the location of the directory in which Zend Server is installed 277 Zend Studio 7 User Guide Creating and Running a Zend Framework Example Project The purpose of the Zend Framework Example Project is to demonstrate the capabilities and best practices of working with the Zend Framework Zend Framework is a high quality open source framework for developing Web Applications and Web Services with PHP The Zend Framework Example Project is a small demo application that shows how Zend Framework can be leveraged in order to streamline writing code by decreasing development time through using prewritten modules and demonstrating how to implement best practices
314. iable name field Mark the checkbox so that all occurrences of the selected expression will be replaced by references to the local variable Click OK to apply your changes or click Preview if you want to see a preview of the changes that this refactoring will create If you clicked preview a preview window will open with a changes tree showing all the changes which will be made to reflect the extracting of the variable Extract Local Variable Changes to be performed CP Extract variable change 5 kl 6 is Extract variable change 7 E Extract variable change 7 E Extract variable change Text Compare ay NO Original Source Refactored Source 1 2 function foo ifunction foo If fa 1 bar bar i 3 b bar 5 If a 1 H 4 else 4 b bar 5 b bar 6 1 5 else b bar 6 7 lt e Jl e 1 ces _ 399 Zend Studio 7 User Guide 7 The changes will be listed according to the context within which they appear You can expand the nodes to see all changes within particular files classes or functions 8 Use the Next Previous Change arrows 2 to scroll through all possible changes Unmarking the checkboxes next to the changes will cause those changes not to take effect 9 Click OK to apply the changes The variable will be extracted and the relevant changes made to the code 400 Tasks Extracting Methods The extract method feature can create a method to
315. ibloadictn ssues List tohen fb63330370 5500937426 1fe787f4e3 1245255620859 v P gt d d Monitor EI Rule Management A Server Setup A Adnunstration Dashboard Events Server Info PHP Info Logs Filter Custom vi Show Filter Detaiis gt Go to event by Id tal 12 ast Severity Count Status First Occ Last Occ 17 Jun 17 32 000014 PHP Error Open 17 Jun 1732 Warning DI 000011 Slow Request Execution Absolute Waming 1 Open 17 Jun 1548 17 Jun 15 48 ht C 000009 Custom Event Waming 1 Open 29 Mar 16 25 29 Mar 1625 C O 200010 PHP Error Waming 1 Open 29 Mar 16 25 29 Mar 16 25 C lt Change status to New updates are now available Click for details 107 Zend Studio 7 User Guide 11 Click the event to see the event details ertamiz aa BS tep focahost Zendserver index phpoadCtrl Monttor UibloadActn Lssues ListBtohen fb6S330370 SS00XI74261fe7E7Mesei2eszs5916296 le d Monitor BI Rute taanagement A Server Sepp A Admimstravon Dashboarg Events Server Info PHP Info Logs z r ed 17 Jun 2009 19 25 ge O 14 PHP Error Occurred once at 17 Jun 2009 17 32 Status Open Severity Warning http MocalhostZendServerProfiting c to t_conver more URL Program Files Zend Apache2intdocs ZendServerPro Source File Shore Function Name convertFTC Error String Division by zero Error Type E_WARNING Last Time Count Function Data Request Server Ba
316. ications w To install and configure Zend Server 1 Download Zend Server from http www zend com en products server downloads The Community Edition of Zend Server can also be downloaded from http www zend com products server downloads all 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 quide 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 i Automatically when Zend Studio is launched A popup balloon will appear in the bottom right corner of the window indicating that a Zend Server installation has been detected and configured 1 Zend Server Found x Zend Server installation has been detected on your local machine and added s your defauk PHP server Click here to earn more E ii By clicking the Auto Detect Zend Server button inthe 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 Zend Studio and Zend Server enables you to easily deploy run debug and profile applications 27 Zend Studio 7 User Guide Create a PHP project
317. ick Apply and then Profile Click Yes if asked whether to open the PHP Profile Perspective If you would like the Profiling Perspective to open by default in the future mark the Remember my decision checkbox The Profiling Perspective will open displaying the Profiling Monitor window with various Profiling views See the PHP Profile Perspective for more on the information that will be displayed once a profile session has been run 355 Zend Studio 7 User Guide Profiling a URL This procedure describes how to profile a URL Your server must be running the Zend Debugger or XDebug in order for remote debugging and profiling capabilities to function The Zend Debugger comes bundled with Zend Server Zend Core and Zend Platform but can also be downloaded as a separate component from http www zend com en products studio downloads w To Profile a URL 1 Click the profile URL button Gi on the main toolbar or go to Run Profile URL 2 The Profile URL dialog will appear Profile URL Please enter a valid URL to profile Open Browser at Cancel 3 Inthe Open Browser at field enter the URL of the page that should be profiled 4 Click Profile The Profile Perspective will open with a number of views detailing information about the profiling process See the PHP Profile Perspective for more on the information that will be displayed once a profile session has been run 356 Tasks Profiling Usin
318. ific settings checkbox 2 Configure the settings according to your preferences See Semantic Analysis Preferences for more information on the settings available 3 Click Apply A prompt dialog will appear stating that a rebuild of the project must occur for the settings to take effect 4 Click Yes to rebuild the project Or click No for a rebuild to be performed only when Zend Studio is restarted Or click Cancel to cancel the operation 625 Zend Studio 7 User Guide Default Semantic Analysis Properties for all projects can be set in the Semantic Analysis Preferences page accessed by going to Window Preferences PHP Semantic Analysis Properties or by clicking the Configure Workspace Settings link on the properties page 626 Reference PHP Build Path Properties The PHP Build Path Properties page allows you to configure the project s PHP Build Path To access the PHP Build Path Properties page right click a PHP project in PHP Explorer view and select Properties PHP Build Path Properties or select the project and from the menu bar go to Project Properties PHP Build Path Properties See Configuring a Project s PHP Build Path for more information 627 Zend Studio 7 User Guide Formatter Properties Zend Studio can auto format scripts to organize them into an easily readable format The Formatter Properties page allows you to customize the way they are formatted for the project To access the Formatt
319. il 2 S can also be written as Sthis gt assertSame 3 this gt Calculator gt add 1 2 You can create more than one test for each function so that your function could appear as the following testes Calepilercor gt eclcl A public function test_add Sthis gt assertEquals S this gt Calculator gt add 1 2 3 Sthis gt assertEquals this gt Calculator gt add 1 3 4 ff nie eene E Birenger Le Siriaas sCalcuilaco cSace 2 Lis Getting Started Analyzing Errors Once a PHPUnit test has been run the results can be viewed and analyzed in order to diagnose and correct problematic sections of code KY The following steps demonstrate how to analyze and correct errors in your code 1 To simulate a failed result change the parameters under the add function so that the expected result is wrong For example Sthis gt assertEquals S this gt Calculator gt add 1 2 4 2 Save the file 3 Run the Unit Test again by clicking the Run Last Test button Se in the PHPUnit view 4 The display in the PHPUnit view will now display that test_add has failed indicated by the blue X icon Hed The error message Failed asserting that lt integer 3 gt is identical to lt integer 4 gt indicates that the test failed as the actual result of the test was 3 but the expected result was 4 5 To only view the failures click the Show failures onl
320. ile Each of the original Templates is bounded by lt template gt lt template gt 593 Zend Studio 7 User Guide Typing Preferences The Typing preferences page allows you to configure the code and language patterns that Zend Studio will automatically complete and whether the tab key will indent the current line The Typing Preferences page is accessed from Window Preferences PHP Editor Typing Typing Lei S Automatically close Y stregs F Parentheses and square brackets Braces E Phpdoc and comment regions H Add Phpdoc tags Close PHP tag gt Di abulators Tab key indents the current line To configure whether tabs or spaces are used to indent lines go to the formatter preference page The current indentation mode uses tabs E Restore Defauts Apply CSJ Automatically Close Zend Studio can be set to automatically complete the following types of patterns J Strings A pair of double quotes will be inserted when a single quotation mark is entered Parentheses and Square brackets A pair of brackets will be inserted when the opening bracket is entered Braces A pair of braces will be inserted when the opening brace is entered PhpDoc and comment regions Automatically creates phpDoc Blocks Add phpDoc tags Adds phpDoc tags within the phpDoc Block comment Close PHP tag A closing PHP tag gt will be inserted when the opening PHP tag lt
321. ile Session Imports a profile session file into the workspace Remote Remote file system Imports resources from a remote file system Run Debug Breakpoints Imports a brakpoint working set mm Launch Configurations Imports a debug launch configurations file SVN Projects from SVN Imports projects by connecting to an SVN repository Once a project has been imported from SVN changes can be made to projects and files which can then be committed to update the SVN repository An SVN repository connection needs to be configured before using this function For more information see Working with SVN 523 Zend Studio 7 User Guide eee Team Project Set Imports a description of the repository and version control information for a set of projects For more on Team Project Sets see Sharing your workspace setup using Project Sets Sharing your workspace setup using Project Sets XML Catalog Imports an XML Catalog file Zend Import from Zend Studio 5 x Imports projects from Zend Studio Imports 5 x Use this function if you have projects in your Zend Studio 5 x which you would like to open and edit in Zend Studio 7 Do not keep Zend Studio 5 x open while importing Zend Studio files See Migrating Projects From Zend Studio 5 X for more information Zend Server Server Preferences Imports server preferences from a server preferences zsc file Zend Server Event File Imports a Zend Server Event File for debuggi
322. iles to CVS 61 Zend Studio 7 User Guide 3 To open the Text Compare view to see the previous version of the file double click the second CVS revision in the list containing the comment I am uploading files to CVS This is the original state the file was in when it was first uploaded To return the file to its previous state select the second revision again right click and select Get Contents Your file will be replaced with the contents of the previous version of the file without the line have made a change Deleting Files from CVS You can delete a file from the CVS repository by first deleting it from your workspace and then committing the deletion S This procedure demonstrates how to delete a file from CVS 1 2 3 4 In PHP Explorer view right click CVSFile2 and select Delete Click Yes when asked to confirm the deletion In PHP Explorer view right click MyCVS Project and select Team Synchronize The Team Synchronizing Perspective will open The file you have deleted will be displayed with a purple arrow with a minus sign pe Right click the file and select Commit A Commit Deletion dialog will open Enter a comment Deleting CVSFile 2 Click OK The file will be deleted from CVS This action will delete the file from the CVS repository and not just from your workspace This file will no longer be accessible by any users 62 Getting Started Working with SVN The purpose
323. in standalone JavaScript files The following tasks describe how to Enable JavaScript Support in PHP Projects Set the JavaScript Build Path View JavaScript Elements in the Outline View Use and Configure JavaScript Content Assist In order for Content Assist options to include elements from JavaScript libraries and referenced files and folders from outside of your project you must first enable JavaScript Support in your project and then set the JavaScript Build Path Use and Configure JavaScript Mark Occurrences Use and Configure JavaScript Syntax Coloring Open JavaScript Types Set Up and Use Dojo Integration 449 Zend Studio 7 User Guide Enabling JavaScript Support in PHP Projects Enabling JavaScript support in PHP projects allows JavaScript libraries and external files to be referenced by the project and makes the elements within these resources available for operations such as Content Assist and Refactoring Once JavaScript support has been enabled for a project you should set the project s JavaScript Build Path in order for the required resources to be made available to the project These procedures describe how to enable JavaScript support for new PHP projects add support to existing projects or disable JavaScript support Enabling JavaScript Support for New PHP Projects S To enable JavaScript support in new PHP Projects 1 Go to File Menu and select New PHP Project Or In PHP Explorer view right
324. in order to get notification about changes in the file system e g files added removed from the project code changes etc and in order to maintain the code database user classes functions variables etc Configuring the project s Build Path allows you to select PHP resources to include exclude from this process Rather than automatically scanning all resources within the project configuring the Build Path allows you to select which resources will be scanned letting you for example exclude folders containing images JavaScript files or other types of files not containing PHP code This can significantly speed up the build process 157 Zend Studio 7 User Guide Path Mapping Zend Studio enables you to map server paths to local paths while Debugging and Profiling on a server Once a Path Map has been defined if a file is called from the defined location on the server during debugging profiling its content will be taken from the set corresponding location on the file system workspace Path Mapping is only activated during Remote PHP Script PHP Server Debugging Profiling or PHP Web Page Debugging Profiling when the Local Copy option is selected under the Source Location category in the Advanced tab Example The server path C Documents and Settings MyProject has been mapped to MyProject on the Workspace Edit Server Path Mapping Configure Server Path Mapping During Remote PHP Script Debug
325. in organizing your project Once the Example Project has been created you will be able to navigate through the tree in PHP Explorer and see the different components of the project The Zend Framework Example provides a model called MVC Model View Controller for programming using the Framework With this model applications are divided into three parts to assist in making the development process more efficient The components are Controller includes all code that handles the logic Model contains data access commands to the raw data View contains the application s front end User Interface Additional information about programming with the Zend Framework can be found in the official Zend Framework Manual at http framework zend com manual For more information about the MVC method see http en wikipedia org wiki Model view controller 278 Tasks Creating the Zend Framework Example Project The following procedure describes how to create a Zend Framework example project To create a Zend Framework Example Project 1 Go to File New Example Zend Framework Example Project J The New Zend Framework Example Project wizard will open Enter aname for your example project 3 You have two options for the contents of your Zend Framework Example Project Create project at existing location Creates the project from an existing location outside of your workspace You may choose your location by writi
326. indow Open Perspective Zend Framework w To create a Zend Module J 282 In PHP Explorer view right click the Zend Framework project in which you want to create the Zend Module and select New Other Zend Framework Zend Module The New Zend Module wizard will open New Zend Module New Zend Module Create a new Zend Module Source Folder fabc application Module name news The folder in which the Zend Module should be created is the project s application folder If necessary click Browse to change the Source Folder In the Module name category enter a name for the new Zend Module Leave the Update front controller module folder checkbox marked to add a line in the bootstrap file that specifies the new module Click Finish Tasks The new Zend Module will be created in your project and will be displayed in the MVC Outline view represented by an orange square Ml The Zend Module will include controller model and view folders in the relevant file hierarchy CG BE outline SS PHP Proj D eS ii 283 Zend Studio 7 User Guide Creating a Zend Controller File This procedure describes how to create a new Zend Controller file A Zend Controller is a class for working with the controller portion of the model view controller pattern The Zend Controller manages the communication between user actions and your application See http framework zend com manual en zend controller html for
327. ined string name bool Description Defines a named constant 3 Use the arrow keys to scroll through the code completion options The window on the right will display descriptions and hints for using the selected code element 4 Select the required option by double clicking it or selecting it and pressing Enter The selected code will be inserted into your script To enable the Content Assist window to open automatically go to the Content Assist Preferences page accessed from Window Preferences PHP Editor Content Assist and mark the Enable auto activation checkbox This is marked by default 223 Zend Studio 7 User Guide Using Templates Templates are shortcuts used to insert a pre defined framework of code into your scripts The purpose is to save time and reduce the potential for errors in standard repetitive code units Once a template is inserted you can complete the code quickly using manual and automated code entry methods Requirements A template must be defined in the Templates list in the Template Preferences page accessed from Windows Preferences Templates before it can be used To learn how to create a new template from the Templates Preferences page see Adding a New Template The i5 edition of Zend Studio includes pre defined templates for using i5 PHP API Toolkit functions See i5 Edition Extras for more information Templates are context sensitive and can be used in HTML PHP PHPDOC Ja
328. information 169 Zend Studio 7 User Guide Refactoring The Refactoring feature in Zend Studio allows you to Rename and move files and elements within those files while maintaining the links between the items Once an element or file has been renamed or moved all instances of that item within the project will be automatically updated to reflect its new name location Extract variables Creates new variables for expressions Creates a new variable assigned to the expression currently selected and replaces the selection with a reference to the new variable Gees Example Implementing an extract method refactoring on the variable my_form in the following code lt php at this gt getRequest gt isPost 4 it my_form gt isValid request gt getPost fmodel new Default Model Guestbook my_form gt gerValues model gt save return this gt _helper gt rcedirector index 1 LA if my_form gt isValid request gt getPosr t i3 model neu Default Model Guestbook fmy form gt getValues 14 mode l gt load Will result in the following code being created the changes have been highlighted lt php 3 f isValid zmg form gt isValid frequest gt getPost ad E x if isValid model new Default_Model Guestbook my_form gt getValues model gt save return this gt _helper gt redirector index 3 J La S
329. ing PHP code Description A short description of the template s code Pattern The pattern is the actual code string that will be inserted into the editor whenever this template is selected Use the Insert Variable button to select from a list of common variables 4 Click OK Your template will be added to the list and will be available from the Content Assist in the relevant context 592 Reference Exporting and I mporting Templates Zend Studio enables you to export and import Templates created within XML files in the following format lt xml version 1 0 encoding UTE 8 gt lt templates gt lt template autoinsert true context php deleted false description description enabled true name for gt oie Soa OF Sea lt ip Sealer P lt template gt S To import a template 1 Click Import to open the Import Template s browser 2 Select the location to import the relevant XML file containing the template information 3 Click Open The templates contained in the template xml file will be imported into the list of Templates wi To export a template 1 Select the template s for export from the Template list 2 Click Export to open the Export Template s dialog 3 Select the location to save the XML file to 4 Click Save An XML file will be created with the template information If you selected more than one template to export all of them will be present in the exported XML f
330. ing to Windows Preferences PHP Debug Installed Debuggers 2 Inthe Installed Debuggers list select the Zend Debugger and click Configure The Zend Debugger Settings dialog will open 3 Inthe Dummy File Name setting ensure dummy php is entered If you changed the name of the dummy file on the server you must change this entry accordingly 4 Click OK 339 Zend Studio 7 User Guide Adding a Server Location Path Map This procedure describes how to add a Path Map to a server so that files which are called from a certain location on the server will be searched for in a local location during remote PHP Script debbuging profiling and PHP Web Page debugging profiling This will only apply when the use local copy option is selected in the Advanced tab of the PHP Web Page debugging configuration See Path Mapping for more details S To add a Path Map to a server 1 Open the PHP Servers Preferences Page by going to Window Preferences on the Menu Bar and selecting PHP PHP Servers from the Preferences list Select the server on which you would like to create the Path Map and click Edit In the Edit Server dialog select the Path Mapping tab Click Add An Add new Path Mapping dialog appears o mr oN Enter the Server Path from which you would like to create the Path Map Files called from this location will be searched for in the path specified below 7 Select either the Path in Workspace or Path in File System op
331. ip alert lt HTML gt e atob attachEvent o back o but btoa captureEvents clearInterval OO clearTimeout amp clientInformation v DE 6 Select the required option to complete your JavaScript code 462 JavaScript Content Assist Configuration JavaScript Content Assist options can be configured from the JavaScript Content Assist preferences page To configure JavaScript Content Assist options Tasks 1 Go to the JavaScript Content Assist preferences page accessed from Window Preferences Web JavaScript Editor Content Assist Content Assist E Insertion Completion inserts O Completion overwrites Press Ctrl to toggle while content assist is active A Insert single proposals automatically Clinsert common prefixes automatically 2 Fil argument names on completion C Guess filed function arguments Sorting and Pitering Sort proposals by relevance E F Hide proposals not visible in the invocation context E Show camel case matches Proposals with access restrictions V Hide forbidden references C Hide discouraged references C Hide deprecated references Auto Activation ElEnabie auto activation Auto activation delay 200 Auto activation triggers for JavaScript Auto activation triggers for Jsdoc ge Ca 2 Configure the following options according to your preferences Insertion code to be overwritten Completion Inserts Completion
332. is useful if you have a number of tests which you would like to unify into one Before creating the PHPUnit Test Suite you must have created all your separate PHPUnit Test Cases y To create a PHPUnit Test Suite 1 In PHP Explorer View right click the project which contains your PHPUnit Test Cases and select New Other PHP PHPUnit PHPUnit Test Suite The New PHPUnit Test Suite dialog appears P Toh aea PHPUnit Test Suite e Project ExampleProject already contains class ExampleProjectSuite E Source folder ExampleProject SuperClass PHPUnit_Framework_TestSuite Browse PHPUnit_Framework_TestSuite Tests to include O yisplay_workersTest display_workersTest php Add Remove Test Class Name ExampleProjectSuite Test File Name ExampleProjectSuite php E Cancel 2 The Tests to include category will show the available test cases within the project Cilck Add to choose the test cases you would like to include in the Test Suite 3 Click Finish A PHPUnit Test Suite will be created integrating all the separate PHPUnit test cases and will be added as a file to your project 386 Tasks Running a PHPUnit Test Suite This procedure describes how to run a PHPUnit Test Suite and how to analyze the results Before running a PHPUnit Test Suite one needs to be created by following the instructions under Creating a PHPUnit Test Suite w To run a PHPUnit Test Suite 1 Open your PHPUnit
333. it enen Loser Reset Resets the perspective to its default view menu bar and en etree S Close Closes the active perspective and reverts back to the last Ee 541 Zend Studio 7 User Guide es eet U Close All Perspectives Navigation Preferences E 542 Closes all perspectives No views or functionality will be available Click the open perspective icon to open a perspective Allows quick access and Navigation between views and perspectives For a list of commands available from this menu option see the Navigation subtopic Opens the working sets dialog allowing you to edit or create Working Sets See PHP Working Sets for more information Opens the preferences dialog to configure all aspects of the workspace See the PHP Preferences section for on PHP Preferences Reference Help Menu The Help menu allows access to the most updated information on all aspects of Zend Studio as well as allowing access to software updates and registration locations so that you can get the most out of the product The options available from the Help menu are Description eee ae Opens the welcome page containing the latest news from Zend as well as access to a range of tutorials for using Zend Studio functionality Help Opens the Online Help page Sg mee E rr Opens a Search view for searching the online Help manual Dynamic Opens Help Topics relevant to the current action in the Help workspace Key Assist
334. ith Zend Studio s editing debugging and profiling features This enables the viewing and debugging profiling of Zend Server events in Zend Studio See Zend Server Integration for more information To find out whether your server is situated behind a firewall contact your System Administrator 162 Concepts To set up a tunneling connection several configuration settings need to be defined both in Zend Studio and on your server s debugger this can be done through Zend Server or your php ini file See Setting Up Tunneling for more information 163 Zend Studio 7 User Guide Zend Server 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 an optimal environment for developing and deploying your PHP applications See Setting Up Remote Debugging for information on how to set up your Zend Server for debugging with Zend Studio See the Zend Server site http www zend com products server to learn more about and download Zend Server Zend Server Integration Integrating Zend Studio with Zend Server allows you to benefit both from Zend Studio s debugging and
335. ith relevant debug information See the Running and Analyzing Debugger results topic for more information on the outcome of a debugging process If the remote debugging session is unsuccessful check that your server s root directory contains a Dummy File This file should match the name of the Dummy File as defined in the Advanced Options section of the PHP Debug preferences page accessible from Window Preferences PHP Debug By default the file will be called dummy php If the file contains include or require calls to files which are not contained within the project you must add them to the project s Include Path in order to simulate your production environment In addition if a file defined with an absolute path to a server location See Include Paths for more on absolute file locations is called a Path Mapping dialog will appear See Path Mapping for more information 322 Tasks Debugging a PHP Web Page This procedure describes how to debug whole applications projects files or collections of files that are already on the server Your server must be running the Zend Debugger or XDebug in order for remote debugging and profiling capabilities to function The Zend Debugger comes bundled with Zend Server Zend Core and Zend Platform but can also be downloaded as a separate component from http www zend com en products studio downloads 323 Zend Studio 7 User Guide 324 To debug a PHP Web Page 1
336. ity of http lt myserver gt 10081 ZendServer as a trusted site See Troubleshooting Platform Integration on an HTTPS Server for more information 202 Tasks Working with Code Tracing Working with Code Tracing Zend Server Code Tracing captures full execution data trace data of PHP applications in real time The execution data includes function call trees arguments and return values function execution duration memory usage and indication for an executed files name and line of code This enables you to capture problems when they occur which eliminates the need to set up environments and reproduce the steps that led up to the failure Integrating Code Tracing into Zend Studio allows you to open the source of the execution data inside of your environment This feature is useful in resolving time performance issues memory performance issues and workflow errors Using Code Tracing you can import a Zend Server event file and view the execution data which it contains in an editor Code Tracing uses the Zend Server Code Tracer Perspective to allow you to view the trace data within your environment The Code Tracing feature allows you to do the following Import a Zend Server Event File Open the Source of Trace Data 203 Zend Studio 7 User Guide Importing a Zend Server Event File Importing Zend Server Event Files allows you to view and analyze trace data execution data from your server The execution data includes
337. ize a local project to a connection 1 Right click on the shared project 2 Select Team 3 Select Synchronize 4 Double click on the shared file in order to automatically open the Compare Editor You will now see your project on your workspace If there are any conflicting files double click on the file and the Compare Editor will appear The synchronized view will reveal any differences there are between the local and shared files by using these icons An incoming addition means that a resource has been added to the repository Updating will transfer the resource to your workspace An incoming change means that the file has changed in the repository Updating will An incoming deletion means that a resource was deleted from the server Updating will e An outgoing addition means that the file was added to your workspace and is not yet in the repository Adding then Committing will transfer the new file to the repository An outgoing change means that the file was change locally Committing the file will transfer the changes to the repository and create a new revision of the file ba An outgoing deletion is a resource that has been deleted locally Committing these resources will cause the remote resource to be deleted Note in CVS directories are never really deleted from the repository Instead files are deleted and empty directories are pruned from your workspace A conflicting additions means that the resource has been added
338. ject allocation arguments Expressions Binary expressions Anay wibaloers Sottinygs for class decke stions Line wrapping policy De nok wrap Indentation policy 568 Reference The Line Wrapping tab contains the following options Line Width and Indentation Levels Maximum Line Width Enter the maximum line width in characters Default indentation for wrapped lines Enter the default indentation for wrapped lines in characters Default indentation for array initializers Enter the default indentation for array initializers in characters Line Wrapping and Indentation Policies To set line wrapping and indentation wrapping policies for a specific element select an element from the collapsible list and select an option from the Line wrapping policy and Indentation policy drop down lists The elements for which the line and indentation policies can be applied are Class Declarations implements clause Method Declarations Parameters Function Calls Arguments Object allocation arguments Expressions Binary expressions Array Initializers To import an existing formatting configuration 1 Click Import 2 Select an XML file with the required configuration settings 3 Click OK The new configuration will be added to the list J To export a configuration file to an XML file 1 Select the required configuration from the drop down list Enter a name and location for the fil
339. k i e disjoint selections use Command key on Mac are also supported and will cause each element clicked to become interesting The first normal click will cause uninteresting elements to disappear Note that Ctrl click elements will become interesting turn from gray to black but only the most recently clicked one will be selected while Alt is held down Focusing Editors Some editors such as the Java editor support focusing Clicking the Focus button in the toolbar will fold all declarations that are not part of the active task context 447 Zend Studio 7 User Guide Task focused Ordering When a task is active elements that are interesting are displayed more prominently For example when you open the Java Open Type dialog Ctrl Shift T types that are interesting for the active task are shown first Similarly when you use ctrl space to autocomplete a method name in a Java source file methods that are in the task context are displayed at the top Working Set Integration When Focus is applied to a navigator view the working sets filter for that navigator view will be disabled This ensures that you see all interesting elements when working on a task that spans working sets To enforce visibility of only elements within one working set do the following Set the view to show working sets as top level elements Use the Go Into action on the popup menu of the working set node in the view to scope the view down to just the working set Open Tas
340. k dialog An Open Type style dialog is available for opening tasks Ctrl F12 and for activating tasks Ctrl F9 The list is initially populated by recently active tasks The active task can also be deactivated via Ctrl Shift F9 This can be used as a keyboard only alternative for multi tasking without the Task List view visible These actions appear in the Navigate menu Task Hyperlinking In the task editor comments that include text of the form bug 123 or task 123 or bug 123 will be hyperlinked Ctrl clicking on this text will open the task or bug in the rich task editor To support hyperlinks within other text editors such as code or txt files the project that contains the file must be associated with a particular task repository This is configured by right clicking on the project and navigating to Properties gt Task Repository and selecting the task repository used when working with this project Reporting Bugs from the Error Log Bugs can created directly from events in the Error Log view This will create a new repository task editor with the summary and description populated with the error event s details If the Connector you are using does not have a rich editor the event details will be placed into the clipboard so that you can paste them into the web based editor that will be opened automatically 448 Tasks Developing with JavaScript A range of JavaScript features are available within PHP files and projects as well as
341. k Apply and Run Your application will be run and displayed in a browser If the file contains include or require calls to files which are not contained within the project you must add them to the project s Include Path in order to simulate your production environment In addition if a file defined with an absolute path to a server location See Include Paths for more on absolute file locations is called a Path Mapping dialog will appear See Path Mapping for more information 314 Tasks Debugging Files and Applications The following Debug functionality is available in Zend Studio Local PHP Script Debugging Debug files on your workspace using Zend Studio s internal debugger Remote PHP Script Debugging Debug files on your workspace using your server s Zend Debugger PHP Web Page Debugging Debug applications situated on a server URL Debugging Enter a URL to debug an application on a server Debugging Using the Zend Debugger Toolbar Debug files and applications directly from your browser Once a debug session has been launched the PHP Debug perspective is used to control the debugging process and to view and analyze the results See the Running and Analyzing Debugger results topic for more information on controlling and monitoring the debugging process 315 Zend Studio 7 User Guide Setting Breakpoints Before you debug your scripts you can set breakpoints in them to specify places in your code
342. l SSH Terminals Work with terminals and commands on remote systems using the Secure Shell SSH protocol To set system checks on any of these options do the following 1 Go to the Available Services box in the dialog and select one of the following options SSH SFTP file services SSH connector service Click on the SSH connector service to expand the node Click on SSH Settings Use the properties table to edit your options 5 Keepalive secs At regular intervals the system checks to see that the connection is alive If so you will then receive a server notification Timeout secs At regular intervals the system checks to see if the connection has timed out and if so you will be sent a server notification Change the scheduled checks in the SSH Settings in the properties table by clicking on the value of the relevant option and inputting how many seconds apart you want your checks to run Click Finish to add your new connection and to set your system checks Now that you have completed creating your connection via the server view you will be able to work remotely on new and existing projects to import export and synchronize projects 432 Tasks Creating a New Remote Project This procedure describes how to create a new remote project Once the remote server has been set up you can create a new project which will be synchronized with one of the remote servers Before creating a new remote p
343. l dialog will be displayed Add New Channel 4 Enter the URL of the site from which the RSS feeds will come and click OK The new RSS feed will be displayed in your RSS view 429 Zend Studio 7 User Guide Working with Remote Server Working with Remote Server Remote Server allows you to set up a remote server connection which will help you to create view and manage your connections to remote systems such as FTP and SSH The following tasks will guide you through the actions that can be done by using the Remote Server functionality Creating a Connection via the Server View Creating a New Remote Project Downloading a Project from an Existing Connection Sharing a Local Project to a Connection Synchronizing a Local Project to a Connection Importing Selected Files from a Folder 430 Tasks Creating a Connection via the Server View The Server View allows you to setup different types of connections for creating and managing projects This procedure describes how to create a connection via the Server view in order to view the current status of connection and establish connection to a remote server w To create a connection via the Servers View 1 Open the Servers View situated at the bottom of the page 2 Right click the Connections node and click New New Connections to open the New Connections dialog box New Connection Select Remote System Type Conmecton for SSH access to remote
344. l of detail using the slider at the top of the Actions section Sliding the control all the way to the left will show you all elements in your task context As you slide it to the right only the elements with a high level of interest will be displayed You can manually remove elements from your task context by doing the following 1 Right Click Remove From Context You may choose to view all elements and exclude irrelevant items in this way before attaching the context to the task so that others can download it Actions Element Detail Slider Adjusts the minimum level of interest required for an element to be displayed in the Elements section Attach Context Attaches the context to the task so that it is available for download from the shared task repository The context consists of the elements shown on the right Retrieve Context Replaces the current task context with one that is attached to the task in the shared task repository Copy Context to Copy the task context to another task That task will then have the same context as the current task Clear Context Removes all context information from the task Planning Use the planning tab to access local information about the task that is private to your workspace You can view the planning tab by selecting it in the lower left of the editor window This tab contains a large area where you can enter personal notes about the task See the local task section for more informa
345. l open with the required class s declaration 469 Zend Studio 7 User Guide Setting Up and Using Dojo Integration Zend Studio s Dojo Integration functionality allows you to add the Dojo toolkit library to your project s Build Path so that its functions classes and elements will be available for operations such as code completion and hover help See http dojotoolkit org for more information on the Dojo toolkit Setting Up Dojo Integration in PHP Projects To enable Dojo integration you must first enable JavaScript Support in your PHP Project You then need to add the Dojo library to your project s Build Path by following the instructions under the Adding Built in Libraries section of Setting the JavaScript Build Path topic and selecting the Dojo library 470 Tasks Setting Up Dojo I ntegration in Zend Framework Projects The Dojo library can also be added to Zend Framework projects through the New Zend Framework Project wizard When creating a Zend Framework project mark the Enable Dojo Support checkbox in the Dojo Support category This will create a link to the external Dojo toolkit library allowing for Dojo development functionality This option will only be available if Zend Framework version 1 6 was selected Zend Framework Project New Zend Framework Project Create a Zend Framework Project Project name Project contents LI Use defaut Framework Version Zend Framework Version 1 6 m Dojo Support
346. lder Selection dialog will display 2 Select the required folders and click OK To add an external folder 1 Click Add External Folder The Link Source dialog is displayed 2 Click Browse to select a folder from your file system and click OK To add a JavaScript file from your filesystem 1 Click Add File from Filesystem 2 Select a JavaScript file and click Open To add JavaScript files from your Workspace 1 Click Add File From Project 2 Select the required file s and click OK Using a Classpath Variable allows you to point to a JavaScript library without having to specify it s local file system location This is important when sharing resources in a team 457 Zend Studio 7 User Guide To add a Variable Classpath Entry 1 Click Add Variable 2 The list of Configured Classpath Variables will be displayed If you have not configured any Classpath Variables i Click the Configure Variables button to open the JavaScript Include Path Variables preferences page also accessible from Window Preferences JavaScript Include Path Include Path Variables ii Click New The New Variable Entry dialog will appear IL Enter the Name and Path of the variable click the File or Folder buttons to browse to the path iv Click OK The Variable will be added to the Include Path Variables list v Click OK to return to the Variable Classpath Entry selection list 4 Select the variable you would like to add to the project s JavaS
347. le Configurations or right click in PHP Explorer view and select Profile Configurations 5 A Profile dialog will appear FHF 5 C Pogan Fiet Zord Zerd Sudo lor Ecipe Bash 6 Double click the PHP Script option to create a new Profile configuration 7 Enter a name for the new configuration 8 To profile the file locally using Zend Studio s internal debugger select the PHP Executable setting under the Debugger Location category and select the required PHP executable PHP 4 or 5 To profile the file remotely on your server using the Zend Debugger installed on your server select the PHP Web Server option and select your server from the drop down list If you have not yet configured a server click the PHP Servers link and follow the instructions under Adding PHP Servers 85 Zend Studio 7 User Guide 9 Under PHP File click Browse and select the TryPerson file 10 Click Apply and then Profile 11 A confirmation dialog will be displayed asking whether you want to open the Profiling Perspective Click Yes If you would like the Profiling Perspective to open by default in the future mark the Remember my decision checkbox The Profiling Perspective will open displaying the Profiling Monitor window with the following information 86 Profiler Information provides general information on the profiling duration and date number of files constructing the requested URL and more In addition it displays a Ti
348. le click the PHP Web Page option to create a new Profile configuration Enter a name for the new configuration Select your server from the PHP Server drop down list Under PHP File click Browse and select your file Select the Advanced tab In the Source Location category select whether to use the local copy or server copies of the files Click Apply and then Profile 39 Zend Studio 7 User Guide Zend Studio 5 x Zend Studio 7 x The next time you want to run this profile session click the arrow next to the profile button db on the toolbar and select your launch configuration See Profiling a PHP Web Page for more information Source Control Subversion SVN See the Subversive User Guide for more information on SVN Additional user guides can be accessed from inside Zend Studio by going to Help Help Contents or from the Eclipse Online Documentation site http help eclipse org ganymede index jsp To define Subversion connectivity Zend Studio 5 x Zend Studio 7 x Open the Preferences window by selecting Tools Preferences from the Menu Bar Select the Source Control tab Select Subversion in the Source Control drop down list This will cause all source control preferences and menu options to enable Subversion rather than CVS operations Configure any required Subversion settings Click Apply and OK Open the SVN perspective by going to Window Open Perspective Other SVN R
349. le system Creates a new file resource Inserts a cascading style sheet into a project HTML Page Creates a new HTML file within a project which allows the utilization of HTML functionality 519 Zend Studio 7 User Guide BE EE Creates a new XML file within a project which allows the utilization of XML functionality Zend Opens a New Zend Framework Item wizard which allows you to Framework launch the Wizards for creating a Zend Controller Zend Model Zend Hem Module Zend View and Zend View Helper Class Inserts a new PHP Class within existing or new files including the required modifiers Superclasses interfaces method stubs comments etc Creates a new PHP Interface within existing or new files The PHP Interface creation wizard allows you to include PHP Doc Blocks in your interface as well as extending other interfaces Remote Creates a new Remote Folder with a remote system connection See Folder Viewing and Editing FTP Files in your Workspace for more information Java Script Creates a new JavaScript file Creates the following example projects in your workspace XML Inserts an XML example project into the workspace Zend Framework Zend Framework is a high quality open source framework for developing Web Applications and Web Services with PHP The Zend Framework is a collection of common PHP classes and infrastructure which sits above the PHP layer It packages classes and code used for common fun
350. lery Created Algorithms Last Update Arrays Conversions Description Passwords 4 Seting Calculates the checkdigt cdv 10 for either a integer or string value Cdv10 are often used in account numbers etc Chack israet Taudat Zehut nun hopsen Preview Coriwert IP string XXX d Wi Convert to base 10 function cdvi0 str A CRC check sum Creating unique ids strings if is string str doman class e e v lt gt The Code Gallery view comes by default with a User Code Gallery to which your own code snippets can be added and the Zend Code Gallery Access to the Zend Code Gallery will require registration to the Zend Network Selecting a code snippet will result in its details description and preview being displayed in the left of the view 174 Concepts Zend Guard Integration Zend Guard is the first Electronic Licensing solution for the PHP marketplace It includes the Encoding solution that pioneered PHP intellectual property protection Unprotected intellectual property in the form of plain text PHP scripts and software without license restrictions can be copied modified and retained by someone else It is available to your competitor to hackers and even to developers at customer sites Zend Guard provides tools that significantly lessen risk to your intellectual property It is designed to prevent your property from being viewed or modified See the Zend Guard product site http www zend com en products guard
351. lick the New Entry 2 icon on the Code Gallery view s toolbar A New code gallery entry dialog will open 4 New code gallery entry Name Example Author Joe Bloggs Description Example Snippet Code This is an example snippet 3 Enter the code snippet s name author and description in the relevant fields 4 Inthe Code box enter the code snippet 5 Click OK Your new code snippet will be added to the list IE Problems 23 Tasks Console PN CodaGalecy i Bir oh d Be Bed type fiter text Details Example 3 User Code Gallery a Author H Goal Zend Code Gallery Last Update 5 Algorithms B Arrays Description H Conversions Passwords Example sreppet Sorting checkdigt modulo 10 Preview Check israel Teudat Zehut nun chopSent This is an example snipper Convert IP string QOX vr M i Convert to base 10 CRC check sum creating Lee ids strings gt 413 Zend Studio 7 User Guide wi To edit an existing snippet 1 Open the Code Gallery View by going to Window Show View Code Gallery 2 Expand the nodes next to the required User Code Gallery in the Code Gallery view or enter a string into the type filter text box to search for the particular category or snippet 3 Select the required code snippet The details of the code snippet including its description and a preview of the code will appear in the right hand pane Right click the snippet and select Edit The New code g
352. llers allowing you to extend Action Controller functionality only when it is needed Zend Studio allows you to easily create and use Action Helpers within your Zend Framework projects For more information on Action Helpers see http devzone zend com article 3350 Action Helpers in Zend Framework w To create a new Zend Action Helper file 1 In PHP Explorer view right click the relevant helpers folder in your Zend Framework Project and select New Zend Framework Item Zend Action Helper 2 The New Zend Action Helper Wizard will be displayed New Zend Action Helper New Zend Action Helper Create a new Zend Action Helper ZFP appication def sult helpers Zend_Controller_Action_Helber MyHelber 3 The default location for the file will be in the application s default helper folder Click Browse next to the Source Folder field to change the location 4 Enter the Helper s name This will be the name of the Helper file The Helper s class name will be automatically created in the format lt Helper s_ Prefix gt _ lt Helper s_ Name gt 5 Click Finish A new Zend Action Helper file will be created with the relevant template This includes phpDoc block comments which help Zend Studio to recognize that the element is a Zend Action Helper 290 Tasks Zend Action Helper phpDoc block comments must be in the format se lt Helper s_Name gt Action Helper uses actionHelper lt Helper s_Prefix gt Y All Zend Ac
353. llery PHP Zend Code Gallery Defined Code Galleries Appearance Code Coverage Code Gallery Code Refactor A Code Style J Debug Editor Code Assist Code Folding Code snippets can be accessed from the Code Gallery view Window Show View Other PHP Tools Code Gallery ey To add a code gallery site 1 Click Add 2 Enter the URL of the required code gallery and click OK The new site will be added to the list and will be available from the Code Gallery view y To edit a code gallery site 1 Select the required gallery from the list 2 Click Edit 3 Change the required information and click OK 556 Reference ew To remove a code gallery site 1 Select the required gallery from the list 2 Click Remove 3 Click OK to apply your settings The gallery will be removed from the list and will not longer be accessible from the Code Gallery view The User Code Gallery cannot be edited or removed 557 Zend Studio 7 User Guide Code Refactor Preferences The Code Refactor Preferences page allows you to enable the in place refactoring option This option allows you to rename elements using the refactoring feature from within the editor rather than through the refactor dialog See the Refactoring topic for more information on refactoring or Renaming Elements The Code Refactor Preferences page is accessed from Window Preferences PHP Code Refactor Preferences Job Co
354. lly 167 Zend Studio 7 User Guide PHPUnit Testing Unit testing is a procedure to test your code to ensure that individual units of source code are working properly and that the right output is being generated Tests can be run on all or some functions within files meaning that tests can be conducted before the file has been fully developed Each test case should be independent of others to ensure that test results can pinpoint the location of the error Running unit tests can ensure that your code is stable and functioning correctly and can help you to diagnose errors PHPUnit Test Cases PHPUnit Test Cases can be created for each class within a file Running a PHPUnit Test allows you to see which functions within the test are working correctly See Creating a PHPUnit Test Case and Running a PHPUnit Test Case for more information PHPUnit Test Suites PHPUnit Test Suites can be created to run several PHPUnit test cases at once See Creating a PHPUnit Test Suite and Running a PHPUnit Test Suite for more information Running PHPUnit Test Cases Suites Running a PHP Unit Test Case Suite will result in the PHPUnit view being displayed showing the results of the tests that were run Debugging PHPUnit Test Cases Suites Debugging a PHPUnit Test Case Suite will result in the PHPUnit view being displayed showing the results of the tests that were run in addition to the normal debug functionality This will also allow you to deb
355. lly during Debugging Profiling See the Path Mapping topic for more details 378 Tasks Using PHPUnit Testing The following tasks will guide you through the process of creating running and reporting on PHPUnit Test Cases and Suites Creating a PHPUnit Test Case Running a PHPUnit Test Case Creating a PHPUnit Test Suite Running a PHPUnit Test Suite Reporting on PHPUnit Test Results 379 Zend Studio 7 User Guide Creating a PHPUnit Test Case This procedure describes how to create a PHP Unit test case Zend Studio will automatically create test case files which can be run in order to check the functionality of your code You must first create a file containing a class with functions which will be tested when the PHPUnit Test case is run w To create a PHPUnit Test Case 1 380 In PHP Explorer view right click the file containing the classes you would like to test and select New Other PHP PHPUnit PHPUnit Test Case The PHPUnit Test Case dialog will open with relevant information already entered into the various fields Note that a new file will be created called FileName Test php ii Ser Jat PHPUnit Test Case Project ExampleProject already contains class display_workersTest E Source Folder ExampleProject SuperClass PHPUnit_Framework_TestCase Browse PHPUnit_Framework_TestCase class Function Element to test display_workers DebugDemo php Test
356. lters from the list to launch the Edit filter dialog which allows you to create or edit your own filter conditions Expand Collapse Expands collapses the list eS Show as Toggles the view to show your times in seconds or TT e Jee R Teeeeme a Group by Sorts the list by function Function The Execution Statistics view is displayed by default as part of the Profiling Perspective To cS manually open the view go to Window Show View Other PHP Profiler Execution Statistics 505 Zend Studio 7 User Guide Execution Flow View The Execution Flow view shows the flow of the execution process and summarizes percentages and times spent on each function The view displays the following information for each function Function Function name File The file in which the function is located Total Execution Time Percent of time taken per function Duration Time Time taken per function In milliseconds IT Profiler Information C Execution Statistics EI UR Code Coverage Summary HH an Function Ale Total Execution Tine Duration Tine ms j main IP tryPerson php 48 8 267 43 man E Person php DD 0 01 zi Person __construct Person php 15 73 65 24 Percon setFirstName iP P erson php 0 01 0 03 Person isetLastName Person php 0 0 0 01 Person setAge Ih Person php 0 0 0 01 Person setGender IF Person php 6 0 0 02 J Person __construct F Person php 0 01 0 06 Pe
357. lusion Exclusion pattern you want to configure and click Edit Or In PHP Explorer view right click the folder whose Inclusion Exclusion pattern you want to configure and select Build Path Configure Inclusion Exclusion Filters The Inclusion and Exclusion patterns dialog is displayed 2 Click Add next to the Inclusion or Exclusion patterns panes The Add Inclusion Exclusion Pattern dialog is displayed 3 Enter or select the required resource s or pattern to include exclude and click OK 4 Click Finish All resources in the project which match an inclusion pattern but do not match an exclusion pattern will be added to the Build Path 372 Tasks Configuring Different Inclusion Exclusion Patterns for Folders Within your Project You can configure different inclusion exclusion rules for child folders within a selected directory However you will need to exclude the selected child folder from the parent directory s Build Path and add it as a separate Build Path source folder This is done to resolve any conflicts which may arise from configuring one pattern for the parent folder and another for the child Source folders can be created and or added from the PHP Build Path properties page or from PHP Explorer view d To add a directory as a separate source folder From the PHP Build Path Properties page 1 Click Add Folder The Source Folder Selection dialog will display If necessary click Create New Folder to create a
358. ly add and configure the driver archive files The following driver types come bundled and preconfigured in Zend Studio DB2 SB2i series Derby MySQL Oracle Postre SQL SQL Server 297 Zend Studio 7 User Guide w To create a connection profile 1 Inthe PHP Perspective toolbar click the Create New SQL Connection icon D Or in the Database Development perspective Window Open Perspective Other Database Development click the Create New SQL Connection icon j in the Data Source Explorer view or on the main Toolbar Or right clickthe Database Connections folder int he Data Source Explorer viee and select New 2 The New Connection Profile wizard opens New Connection Profile Connection Profile Create a Genenc JDBC connection profite Connection Proffe Types type fiter text E oez for 2 05 E te Databases Profile Data Source Prototype Hate GL Horace E postgres E SQ Server t SQLite ER cere aca 3 Select the required connection profile type from the list 4 Enter a name for the connection and a description if required Note The drivers for most of the database connection types are automatically included and configured in Zend Studio However some driver types require you to manually add and configure the driver archive files The following driver types come bundled and preconfigured in Zend Studio DB2 S B2 i series Derby MySQL Oracle 298 Tasks Pos
359. ly review progress and detect unintended side effects w To create and run a PHPUnit Test Case 1 In PHP Explorer view right click the file you want to test and select New PHP Unit Test Case Fill in the required information in the New PHPUnit Test Case dialog Click Finish to create your Test Case file Edit the test functions in your new PHPUnit Test Case file by writing appropriate tests for the relevant functions 5 Run the PHPUnit Test by going to Run Run As PHPUnit from the Menu Bar or right clicking the file in PHP Explorer view and selecting Run As PHPUnit See PHPUnit Testing for more information 23 Zend Studio 7 User Guide Refactoring Refactoring is the process of renaming or moving selected resources in a smart way while maintaining all the relevant links between files and elements Refactoring automatically makes all relevant changes to your code J To move rename a resource 1 Select the required file in PHP Explorer view or select the required element in the editor window 2 Right click and select Refactor Move files only Rename 3 Select the resource s new location name During the refactoring process a preview screen will display showing the changes made See Refactoring for more information Perspectives of Interest To open a perspective go to Window Open Perspective select Other to view a full list of perspectives PHP default This is the perspective
360. matically detected during the Debugging Profiling of Zend Server events S To establish a communication tunnel between Zend Server and Zend Studio 1 Open your Zend Server GUI 2 Go to the Server Setup Monitor tab 3 Inthe Zend Server Settings section configure the following Auto detect the Zend Studio Client Settings Set to Om to inform Zend Server of the method of connection to Zend Studio This allows Zend Server to detect your Zend Studio Debug settings 4 Click Save 343 Zend Studio 7 User Guide Setting Up a Tunneling Server This procedure describes how to configure a server to allow Tunneling in Zend Studio You can configure several servers to allow tunneling S To configure your server for Tunneling with Zend Studio 1 Open the PHP Server Preferences page by going to Window Preferences PHP PHP Servers from the Menu Bar Click New to define a New Server or Edit if the server has already been defined Give the server a unique name and enter the URL of the server to which you would like to create a tunnel Click Next to continue or go to the next Tab 4 You can ignore the Path Mapping option If necessary you will be automatically prompted to define path mapping during debugging and profiling sessions See Path Mapping for more details Click Next to continue or go to the next Tab 5 If you want to enable Zend Server integration mark the Enable Zend Server Integration checkbox See Configuring
361. me Division Pie Chart for the files in the URL The right side displays time division in a pie chart and the left side provides the following information URL The URL analyzed Query The specific query parameters Path The exact location of the first file called Total Request Time Total process time of the entire page Number of Files Number of files composing the page Date Date and time that the profiling took place a deift internet idle tegen gaer d Erection Plow LER Code Coverage Summary gt General Information Time Division Pie Chart URL Not Available Query debug_coverage adebug_port 10137istart_profie 1 Path C Documerts and Settings heren s 2end workspaces Def ata Total Request Time ms 548 06 Number of Fles 2 Date Tue 24 03 13 11 05 IDT 2007 J tryPerson php 180 7 ms 67 6 wW Person php 86 73 ms 32 4 Execution Statistics Displays the list of files constructing the URL and detailed information on functions in the files The window contains statistics relevant to each function Function The name and location of the function Calls Count The number of times that the function was called Getting Started Average Own Time The average duration without internal calls a Own Time s The net process duration without internal calls Others Time s Time spent on calling other files Total Time s The total process duration including internal call
362. me interface name or class methods constants and fields This allows you to view an element s supertypes types higher in the hierarchy or subtypes lower in the hierarchy within a tree structure providing you with an overview of your element s structure A type hierarchy can be displayed in two ways 1 Quick Type Hierarchy view Displays a simple hierarchy view within the editor lt php interface II Type hierarchy of human bd public function setGender gender public function getGender I G person class person implemencs human private gender Peers Ctl T to see the supertype berech 2 Type Hierarchy view A standalone view The Type Hierarchy Tree Displays the type s supertypes and or subtypes Member list pane human working set Window Working Set en Displays the type s members Gel PHP Explorer aT F Lech foedtType oustid 3 tousstomerid _construct fnewFirstName newLastName newsge getCardNumn getcredtTypet getCustid o getPersanCount prikDeta setCardNum newCledum setCredtType gnewCredtType setPersonCount personCount sae a See Type Hierarchy View for more information 133 Zend Studio 7 User Guide PHP Manual Integration Zend Studio can integrate with PHP Manual sites in order to get the most up to date PHP information The PHP Functions view lists all PHP functions contained
363. me of a debugging process If the file contains include or require calls to files which are not contained within the project you must add them to the project s Include Path in order to simulate your production environment In addition if a file defined with an absolute path to a server location See Include Paths for more on absolute file locations is called a Path Mapping dialog will appear See Path Mapping for more information 325 Zend Studio 7 User Guide Debugging a URL This procedure describes how to debug a URL on a server to which you have access Your server must be running the Zend Debugger or XDebug in order for remote debugging and profiling capabilities to function The Zend Debugger comes bundled with Zend Server Zend Core and Zend Platform but can also be downloaded as a separate component from http www zend com en products studio downloads S To debug a URL 1 Click the Debug URL button on the main toolbar or go to Run Debug URL 2 The Debug URL dialog will appear To Debug a remote URL Zend Debugger must be installed on the web server Open Browser at hatp ocalhost DebugDemo php z T Break at Fust Line 3 Inthe Open Browser at field enter the URL of the first page that should be debugged 4 Select whether the Debugger should stop at the first line of code by marking unmarking the Break at First Line checkbox 5 Click Debug The Debug Perspective
364. ment s initials Example param unknow n type personCount x public static function setPersonCount personCount this gt pc personCount e personCount Camel Case matching is case sensitive Namespaces When the PHP executable used for the project is set to version 5 3 content assist is available for namespaces Namespace elements are represented by the Namespace icon OO vase Example Re O Doctrine Common DoctrineException php e 18 Doctrine Common EventManager php Sc t ar Oo Doctrine Common EventArgs php ei Doctrine Common Collections Collection php publi Doctrine DBAL Connection php r 0 Doctrine DBAL Driver php e Doctrine DBAL DriverManager php d O Doctrine DBAL Statement Geo i Doctrine DBAL Configuration php 4 Doctrine 118 Concepts Configuring Content Assist To configure PHP Content Assist options go to the Content Assist Preferences page accessible from Window Preferences PHP Editor Content Assist To configure JavaScript Content Assist options go to the JavaScript Content Assist Preferences page accessible from Window Preferences Web JavaScript Editor Content Assist 119 Zend Studio 7 User Guide Syntax Coloring Zend Studio can automatically apply different colors and font attributes to different PHP syntax elements in order for your scripts to be more easily navigable and to help you
365. ments human private gender Divers Cul T to see the supestype hieracty Pressing Ctrl T while the quick type hierarchy view is shown will toggle between supertype hierarchy and subtype hierarchy Viewing Types in the Type Hierarchy View Types can be viewed in the Type Hierarchy view by searching for them using the Open Type in Hierarchy dialog or by directly selecting the element in the editor or PHP Explorer si To view a type in the Type Hierarchy view Through the Open Type in Hierarchy wizard 1 Press Ctrl Shift H or from the Menu Bar go to Navigate Open Type in Hierarchy The Open Type in Hierarchy dialog is displayed 235 Zend Studio 7 User Guide Open Type in Hierarchy Choose a type 7 any character any string de dh ee Matching types OD human Person php default package People 2 If atype was previously selected in the editor or outline views it will be entered in the type field If a type was not selected begin typing the string of the required type method to filter the results You may use wild cards or CamelCase notation e g DTB for DateTextBox 3 Select the required type and click OK Directly from the editor or PHP Explorer 1 Select a type in the editor or PHP Explorer 2 Press F4 The action will not be activated if the selection is not a resolvable element i e if the selection is not a class name interface name or class method constant or field The
366. ming Open 19 Fed 1725 19 Feb 17 25 CiProgram FilesZendiApache2ihtdocsissues pt 000003 Custom Event Warning Open 19 Feb 17 25 19 Feb 17 25 C Program Files Zend Apache2idocs ssues pt 000002 Severe Siow Request Execution Absolute Critical Open 18 Feb 1453 18 Feb 14 53 _hitpslocalhost8tissues php 000002 PHP Error Warning 18 Feb1453 18 Feb 14 53 C Program Files Zend Apache2inidocsiissues pt 000003 Custom Event Warning 18 Feb 1453 18 Feb 14 53 C Program Files Zend apache2intdocsissues pr H gt Change status to h 4 tout oft E Problems Zi Tasks Console Servers 2 wR Se 7 A5 E servers 2 Defaut PHP Web Server http flocalhost 80 AE Local Zend Server htp flocathost 80 a Zend Server Integration 165 Zend Studio 7 User Guide Importing Events into Zend Studio Zend Server events can be exported from Zend Server as a xml file which can then be imported into Zend Studio and debugged This is useful when the developer using Zend Studio does not have access to the Zend Server on which the event occurred See Importing Events Into Zend Studio for more information Zend Server events can also be imported as amf files using the Code Tracing feature in Zend Studio Integrating Code Tracing into Zend Studio allows you to open the source of the execution data inside of your environment Code Tracing uses the Zend Server Code Tracer Perspective to allow you to view the trace data within your environment This feature is us
367. model new Default Model Guestbook fmy_form gt getValues 15 Smodel gt load Extract Methods Creates a new method to replace all occurences of a selected fragment of code 170 Concepts Martin Fowler the creator of the Refactoring concept defines it as the following Refactoring is a disciplined technique for restructuring an existing body of code altering its internal structure without changing its external behavior Its heart is a series of small behavior preserving transformations Each transformation called a refactoring does little but a sequence of transformations can produce a significant restructuring Since each refactoring is small it s less likely to go wrong The system is also kept fully working after each small refactoring reducing the chances that a system can get seriously broken during the restructuring http Awww refactoring com 171 Zend Studio 7 User Guide JavaScript Support JavaScript is a scripting language designed to add interactivity to HTML pages Zend Studio provides support for JavaScript features in standalone JavaScript files as well as in PHP files and projects Some of the JavaScript features available for PHP projects and files are JavaScript Element Outline JavaScript elements will be displayed in the Outline view JavaScript libraries will be added to the Include Paths of PHP projects for which JavaScript support has been enabled JavaScript Build Paths Se
368. more information on the Zend Controller Zend Studio offers the option to create Zend Controller files based on the Zend Controller Template for projects based on Zend Framework version 1 7 and below and based on the Zend Tool for projects based on Zend Framework version 1 8 and above wi To create a new Zend Controller file 1 In PHP Explorer view right click the controllers folder in your Zend Framework Project and select New Zend Framework Item Zend Controller The New Zend Controller Wizard is displayed New Zend Controller Create a new Zend Controller 2 If you selected to create a Zend Tool based Controller i Enter a name for the Controller The default name for the created controller will be lt Controller Names gt Controller php e g MyNewController The default location for the file will be in the application s default controllers folder ii Select the required containing Zend Framework project from the Project Name 284 Tasks drop down list If you selected to create a Template based Controller i Ensure the required containing source folder is correct It is recommended to create all Zend Controllers in the project s controllers folder ii Enter the Controller name in the File Name field iii Click Next to view and edit the template on which the new Controller will be created 3 Click Finish A new Zend Controller file will be created with the relevant template The new file will be created
369. mpleted can be configured from the Typing Preferences page accessible by going to Window Preferences PHP Editor Typing 121 Zend Studio 7 User Guide Matching Brackets Zend Studio can help you to easily navigate through your script by finding brackets matching pairs To see a bracket s pair click to the right of the bracket Its matching pair will be highlighted To jump to the matching bracket press Ctrl Shift P function Legend s graph LEI this gt fill_color amp this gt legend if is_array this gt fill_co lor j graph gt legend gt Add this gt legend this gt fill_color 0 0 this gt legendcsimta else graph gt legend gt Add this gt legend this gt fill_color O this gt legendcsimtarge 122 Concepts Mark Occurrences The Mark Occurrences feature enables you to see where an element is referenced by simply clicking on the element in the editor When the Mark Occurrences feature is enabled all occurrences of the element within the active file will be highlighted and indicators will be displayed in the annotations bar to the right of the editor In addition hovering over the element will cause a tooltip to be displayed with the location of all references of the element including occurrences of the element in other files tryManager php E tryPerson php P 17_class_interface p 3 4 m 1 lt php 2 class Person public name O function do
370. n Zend Studio 7 2 Code Tracing The following new features are available in Zend Studio 7 1 Remote System Explorer Phar Integration Mylyn Integration The following new features are available in Zend Studio 7 0 PHP 5 3 Support e Ability to create a PHP project based on PHP 5 3 e Syntax Coloring and Validation for PHP 5 3 in the editor e Conent Assist for Namespaces e Content Assist for packages e Namespace grouping in PHP Explorer Zend Framework Enhancements e Zend Framework 1 8 Support including code generation through Zend_Tool e Zend Tool Floating Window e Updated Zend Framework Example Project Enhanced Code Editing e Mark Occurrences e Override Indicators e Type Hierarchy e Open Type Method e Extract Variable e Content Assist Enhancements Camel Case matches Magic Members support Namespaces e PHP Build Path Configuration e In place Refactoring What s New in Zend Studio 7 2 Zend Server Integration e Auto detection of local Zend Server installation e Easy Zend Server Event Debugging Profiling Mac OS X If you are running your Zend Studio on Mac OS X be aware that some Menu items may be labeled differently This difference in labeling does not change the procedure For a list of the alternate labels see the table below Mac OS X Help About Zend Studio Zend Studio About Zend Studio Window Preferences Zend Studio Preferences Getting Started The Getting Started s
371. n a tree structure providing you with an overview of your element s structure See Viewing Types in the Type Hierarchy View for information on how to open a type in the Type Hierarchy view Ke Pr Explorer Weem ade human working set Window Working Set D tums Person o See Employee Manager tal Te E i Customer s hA Lehm foedtType oustid a customerid __construct fnewrirstName newLastName newioe SnewGenw getCardNum getCredtType getCustict getPersanCount printData setCardNum newlardNum setCredtType gnewCredtT ype setPersonCounk personCount gg pg gp D e ee oe ee D L v The Type Hierarchy view consists of two panes The Type Hierarchy Tree Displays the type s supertypes and or subtypes Member list pane Displays the type s members 488 Reference Type Hierarchy Tree Pane Toolbar Commands Pee ee ee Show the Displays the type in its full context Le superclasses Type and subclasses in the Type Hierarchy view Hierarchy Show the Displays the supertypes and the hierarchy of all Supertype implemented interfaces of the type Hierarchy Note The selected type is always at the top level in the upper left corner Show the Displays the subtypes of the selected class and or all Subtype implementors of the interface in the Hierarchy view Hierarchy Note The selected type is always at the top level in the upper left corn
372. n all currently open editors or buffers Ctrl 1 Displays possible quick fix options for problems in the Problems view To use this option first select a problem in the Problems view Note This option will not always be available Set Encoding Changes the file encoding used to read and write the file in the active editor 528 Reference Source Menu The Source menu allows you to organize your scripts by adding or removing comments and formatting the script to make it more easily viewable The options available from the Source menu are Fc i Override Implement Launches the Override implement Method Wizard to Methods override implement methods defined in the selected class s parent or interface See Overriding Implementing Methods for more information eee Generate Getters a Launches the Generate Getters and Setters Wizard to and Getters automatically create getter and setter functions for variables within the selected class See Generating Getters and Setters for more information Toggle Comment Ctrl Comments or uncomments a line by adding or removing characters Comments are used for adding text to your script to explain sections of code Commented text will not be run as part of your code To use this feature select the line and press Ctrl See Commenting Code for more information Add Block Ctrl Shift Comments a block by adding and characters Comment to either side of the code T
373. n external add on to Internet Explorer and Firefox browsers which allows you to initiate debugging or profiling sessions directly from your browser Debugging profiling through the Zend Browser Toolbar will launch a remote debug profile session in Zend Studio Wend Studio Debug P prcie EBextra Stuff Search for PHP information x on Zend com The Zend Browser Toolbar contains the following options Zend Studio Opens Zend Studio Ensure the Zend Studio exe file is configured in the Zend Toolbar Settings Debug Launches a Debugging session in Zend Studio Profile Launches a Profiling session in Zend Studio Extra Stuff Provides access to Zend Browser Toolbar settings and links to useful Zend and PHP Information Search for PHP Information Allows you to quickly and easily search the web for PHP information See Installing and Configuring the Zend Browser Toolbar for information on how to get started with the Zend Browser Toolbar 161 Zend Studio 7 User Guide Tunneling Tunneling provides a means of persistent connection between Zend Studio and a remote server situated behind a Firewall or NAT After creating a Tunnel all communication between Zend Studio and the server can go through that tunnel instead of assigning more communication ports for the Debug Profile Sessions made on the remote server A communication tunnel cannot currently be created to a Windows server This persistent con
374. n the Annotation Bar next to code blocks which can be folded In addition certain elements will be folded by default according to the Folding Preferences settings w To fold a block of code 1 Stand within a class function or PHPDocBlock 2 Click the minus sign on the marker bar to the left of the editor The first line of code will remain visible but the other lines will not be displayed A fold indicator LJ will appear at the end of the line when the code is folded to indicate that there is hidden code To temporarily view folded code hover over the plus sign that denotes a folded block The folded code will be displayed in a floating block H 0 H 1 public Function dividef a b b 17 if b null throw new Exception Division by zero e b 19 return a b w To unfold a block of code 1 Click the plus sign 2 The folded code will become visible again and the fold indicator will disappear To view the scope of a fold 1 Hover over the minus sign 2 A vertical line will be displayed from the first to the last line of the fold indicating its range 227 Zend Studio 7 User Guide 10 10 119 public function divide a b ris public function divide 12 if b null 17 13 throw new Exception Divi 14 15 return a b 16 17 An unfolded function A folded function ew To fold unfold nested functions 1 Click on one of the minus signs of a nested function All level
375. names Show Filter Pools Displays filter pools See Filters filter pools and filter pool references in the RSE User Guide for more information Additional user guides can be accessed from inside Zend Studio by going to Help Help Contents or from the Eclipse Online Documentation site http help eclipse org ganymede index jsp Restore Previous State Select this option to use locally cached information instead of connecting immediately if you are automatically opening the previously expanded connections when starting RSE Opens the Remote Systems Preferences page The Remote Systems View is displayed by default as part of the PHP Perspective To manually open the view go to Window Show View Other Remote Systems Remote Systems See the RSE User Guide for more on FTP SFTP connectivity 484 Reference Additional user guides can be accessed from inside Zend Studio by going to Help Help Contents or from the Eclipse Online Documentation site http help eclipse org ganymede index jsp 485 Zend Studio 7 User Guide Servers View The Servers view displays a list of all servers configured in Zend Studio and allows you to connect to and view any Zend Servers configured on your system 17 Problems 3 Tasks Ed console 28 Ser PA Servers al Default PHP Web Server http flocalhost 80 z E Local Zend Server http lorcalbo EI Zend Server Integration URL Suffix ZendServer Zend Server
376. nces dialog accessed from Window Preferences PHP Zend Guard 537 Zend Studio 7 User Guide Run Menu The Run menu allows you to get maximum efficiency and accuracy from your files and projects through analyzing and testing your code using the Debugging Profiling and Run functions Running a file or application will display the output in the Browser and Debug Output views as well as displaying any error or warning messages in the console view Debugging a file or application allows you to view the output and any error notices as well as information about various elements at various stages while the file is run For more information on Debugging see Debugging Files and Applications Profiling a file or application allows you to detect bottlenecks in scripts by locating problematic sections of code For more information on Profiling see Profiling Files and Applications The options available from the Run menu are Toggle Ctrl Shift B Adds removes breakpoints from your script Breakpoint Breakpoints are used to stop the debugging process at certain key places throughout your code Toggle Line Adds removes line breakpoints from your script Breakpoint Toggle Method Adds removes method breakpoints from your script Breakpoint Method breakpoints are used to add conditions to breakpoints Toggle Adds removes a field watchpoint for the current Watchpoint selected variable in the Expressions View Skip
377. nched programs stepping through your code and examining the contents of variables Debugging should be used at stages where your scripts and applications are formed sufficiently to be tried and tested Zend Studio includes several types of debugging Locally Debugging PHP Scripts Debugging PHP files using Zend Studio s internal PHP Executable debugger Remotely Debugging PHP Scripts Debugging PHP files using your server s debugger Debugging PHP Web Pages Debugging files applications and projects on your server using the local or server copies of your files Debugging URLs Debug applications on your server by entering a URL Toolbar Debugging Debug files and applications directly from your browser using the Zend Studio Toolbar 70 Getting Started Debugging Local PHP Files PHP Scripts PHP files PHP Scripts on your workspace can be debugged using either Zend Studio s internal debugger or your server s debugger Using your server s debugger you can test the execution of the file on your server s environment This is especially relevant if your server s loaded extensions are different to Zend Studio s internal server Your server must be running the Zend Debugger or XDebug in order for remote debugging and profiling capabilities to function The Zend Debugger comes bundled with Zend Server Zend Core and Zend Platform but can also be downloaded as a separate component from http www zend com en products stu
378. nd Studio 2 If the file type was not associated with Zend Studio you can Right click the file and select Open With Choose Program Zend Studio Or Add the file type to the list of file types which will automatically be opened in Zend Studio by doing the following a From Zend Studio s Menu Bar go to Window Preferences General Content Types The Content Types dialog will be displayed b Select Text PHP Content Type from the list A list of file types associated with Zend Studio will be displayed Preferences type fiter text Content Types Contant Types See Fle Assposnons for assoosting editors wth fle types Edtors i Keys Lee i Network Connections Click Add to add your file s type to the list Enter the file type e g php and click OK The file type will be added to the list Open your Windows Explorer op on Tasks g Goto Tools Folder Options File Types h From the File Types list select PHP File i In the Opens with category click Change browse to your Zend Studio exe location and click OK j Click Apply You can now double click the file on your external file system to open it in Zend Studio The file will be displayed in an editor S To open a file using Zend Studio s file open function 1 In Zend Studio go to File Open File 2 Browse for your file in your file system 3 Select the required file and click Open The file will be displayed in an editor 193 Zend S
379. nd Studio communication in Zend Server 1 Open your Zend Server GUI 2 Go to the Server Setup Debugger tab Allowed Zend Studio Clients for Debugging Exact IP address only E Add Current list of allowed hosts 127 0 0 1 Remove ISS Remove 192 168 Remove 172 16 0 0 12 Remove 245 234 234 Remove Denied Zend Studio Clients for Debugging Exact IP address only E Add Use this list to exclude specific hosts from the allowed hosts list 3 Ensure the address of your Zend Studio is included in the Allowed Hosts sections This will ensure you can debug profile Zend Server Events To add an address to the list i Enter the IP address or Net mask of the machine on which your Zend Studio is installed In Order to enter a Net mask enter a range by entering the beginning of an IP address and adding 0 instead of the rest of the number To make sure you are using Wildcards to specify a range of IPs select the pattern you want from the drop down list ii Click Add Your Zend Studio machine s address will be added to the Allowed Hosts list 4 Ensure your Zend Studio s IP address is not in the Denied Hosts list If it is click Remove next to the required address to remove it from the list 5 Inthe Zend ServerGUI go to the Server Setup tab Monitor and configure the following Auto detect theZend Studio Client Settings Set to Om to inform Zend Server of the method of connection to Zend Studio This allows Zend Server to 418 Task
380. nd password you use to connect to SVN Click Finish Your SVN repository will now be added to the SVN Repository view H 63 Zend Studio 7 User Guide Sharing Projects Through SVN projects can be shared and worked on by numerous team members KY The following steps demonstrate how to upload a project to your SVN repository location 1 2 NONA Create a new PHP project called MySVN Project Within the project create a PHP file called SVNFile1 with the following code lt php PP tnis is a new rile ZS In PHP Explorer View right click your project and select Team Share Project A Share Project dialog will open From the repository list select SVN and click Next Select Use existing repository location and select your repository from the list Click Finish Depending on your authentication settings a dialog might appear asking you to provide authentication information Re enter your password and click Next Mark the Save Password checkbox to ensure that this screen does not reappear A Commit dialog will open Enter the comment I am uploading files to SVN and click OK In PHP Explorer View your project will now have a repository icon K indicating that it is in SVN Once you have committed your files other team members will be able to access and change the files The instructions below explain how users can check out import projects from SVN edit them and upload their changes 6
381. nder To define CVS connectivity an editor and right click above From the right click menu select Team Right click the required file project in the and the required action Project tab or open the file in an editor and right click From the right click menu select CVS and the required action See the Making Changes Comparing Changes and Committing Changes section of the Working with CVS tutorial for more information FTP Connectivity To configure an FTP root Zend Studio 5 x Zend Studio 7 x Go to the main menu and select 1 Switch to the Remote Systems view tabbed File Add FTP Server with the PHP Explorer view and click the Or from the File Manager s File Define a connection to remote system button System tab open the right click E PEE E E MENU APA SHIBA AAEE TESNE The New Connection dialog will appear Select FTP and click Next Enter your Remote FTP connection details and The Configure FTP Server dialog will appear Enter your FTP connection details and click OK The new FTP Icon appears in the click Finish Your connection will created and listed in the Remote Systems view file system See Creating an FTP SSH Connection for more information 43 Zend Studio 7 User Guide Database Connection Zend Studio 7 x allows connection to a variety of database types To create an SQL server connection Zend Studio 5 x Zend Studio 7 x From Studio s File Manager click the 1
382. nder the Error Handling and Logging category in Server Setup Directives 4 Restart your Web server after applying changes Once you copy your Zend Framework project files to the server you will be able to run and debug the project as you would a normal PHP project To configure Zend Server to run a Zend Framework application 1 Define a virtual host on Zend Server that will point to the new project s public directory i Find the full path to your project s public directory This is listed in the location field in the project s properties To see it in PHP Explorer view right click the public directory and select Properties Resources ii Open your Apache configuration file in most cases it will be httpd conf and located in your Apache installation directory See Where is my Apache configuration file for more information ii Go to the end of the file and add the following code Listen 10089 275 Zend Studio 7 User Guide lt VirtualHost 10089 gt DocumentRoot DOCUMENT_ROOT lt Directory DOCUMENT_ROOT gt Order allow deny Allow from all AllowOverride all lt Directory gt lt VirtualHost gt 2 Replace DOCUMENT_ROOT with the full path to the public directory enclosed in double quotes DOCUMENT_ROOT Replace the port number with a unique port number dedicated to this Virtual Host The port number 10089 has to be the same value for Listen and VirtualHost 3 Zend Framework s MVC implementation makes
383. nection operates even when separated by a firewall The advantage of this method is that it is possible to use the Zend Studio Integration on several nodes at once For example debugging an entire cluster of machines behind a load balancer over a single debugger connection to Zend Platform s Studio Server component The technology is based on two functional elements The Zend Studio that includes an internal Web server that listens on the local host on a specific Auto Detection port Zend Platform auto evaluates Zend Studio s Auto Detection port by evaluating Zend Studio s settings These are the Tunnel Settings that are defined in Zend Platform The tunnel communication port should be used in the following circumstances 1 When debugging or profiling files on a remote server which is behind a firewall or other security device Your server must be running the Zend Debugger or XDebug in order for remote debugging and profiling capabilities to function The Zend Debugger comes bundled with Zend Server Zend Core and Zend Platform but can also be downloaded as a separate component from http www zend com en products studio downloads 2 Establishing communication between Zend Studio and Zend Server when Zend Server is running on a remote server which is behind a firewall or other security device The communication between Zend Studio and Zend Platform facilitates the integration that combines Zend Server s event reporting capabilities w
384. ng See Importing Events Into Zend Studio for more information 524 Reference Export Submenu The Export submenu is available under File Export from the Menu Bar The options available under the Export submenu are Deseription sisi A sc Archive File Exports files from the Workbench to an archive file in the local file system File System Export files from your workspace to your local file system Preferences Export preferences from the Workbench In the Export Preferences wizard select the preferences to export and the location of the preferences epf file to which you want to ie them PHP Doc Creates a PHPDoc from your aoe S or files aoe S PHPDocs for more information W Profiler HTML Report Create an HTML report from a profile session To use this feature a profile session must first be run on a file by going to Run menu Profile As and selecting the relevant profiling configuration For more on profiling see the Profiling topic Profile Session Creates an xml document from your profile session To use this feature a profile session must first be run on a file by going to Run menu Profile As and selecting the relevant profiling configuration For more on profiling see the Profiling topic Remote Remote file system i nee resources to a remote file system Systems Run Debug M Exports breakpoints from the workbench to a breakpoint file A list of available breakpoints will be displayed in the E
385. ng databases CVS SVN and FTP new Zend Suen releases and other important product information Emai To start using Studio cick the 2 von in the Welcome tab in the top left corer You can always return to the screen by ddang on Help Welcome fram the Menu Bar ay To use the Welcome Page 1 Browse the Welcome Page to learn about Zend Studio features and functionality Click the home button tiy in the top right corner to be taken back to the main Welcome home page 2 You can close the Welcome Page by clicking the 23 icon in the Welcome tab situated in the top left corner of the window Zend Studio 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 26 Getting Started 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 Zend Studio for an optimal environment for developing deploying and debugging your PHP appl
386. ng Zend Framework Elements Once you have created a Zend Framework Project you can add Zend Framework elements through the Zend Framework Item wizards Elements should be placed within a Zend Module which enables you to organize your MVC files When working with Zend Framework files you should open the Zend Framework perspective by going to Window Open Perspective Zend Framework Zend Framework items can be created through the New Zend Framework Item dialog accessible by going to New Zend Framework Item Wizards FY Zend Action Helper m Zend Controller Template Based Zend Controller Zend Tool Based E Zend Module s Zend Table T Zend View OY Zend View Helper Through this dialog you can create the following elements Zend Action Helper Zend Controller Zend Module Zend Table Zend View Zend View Helper 281 Zend Studio 7 User Guide Creating a Zend Module File Zend Framework MVC files should be created within a Zend Module which enables you to easily group your MVC files according to your application s components This will help you organize your Zend Framework Project structure One Zend Module entitled default will be automatically created within the Zend Framework project Further Zend Modules can be created to group your MVC files according to your needs When working with Zend Framework files you should open the Zend Framework perspective by going to W
387. ng it in the Directory text field or by clicking Browse 4 Click Finish An example project will be created and displayed in the PHP Explorer view You can navigate through the application source files to learn more about the source behind the application Create new project in workspace Creates the project in your current workspace 279 Zend Studio 7 User Guide Running the Zend Framework Example Project The following procedure describes how to run the Zend Framework example project In order to run your Zend Framework Example Project you must first create one For more information see Creating the Zend Framework Example Project You must have an established connection with a server to run the Zend Framework Example project For more information see DefiningZend Server in Zend Studio wi To run the Zend Framework example project 1 Expand your Zend Framework Example project in the PHP Explorer View The project s sub folders will be exposed 2 Expand the sub folder called public and right click on the sub file index php From the right click menu select Run as PHP Web Page The Run PHP Web Page dialog will open If the dialog doesn t open you will need to add this directory to the build path by right clicking on the Public folder and selecting Build Path Include You do not need to make any changes in order to run the example project 3 Click OK Your project web page opens 280 Tasks Creati
388. ng the project from your workspace will not delete it from CVS Go to File Import Projects from CVS Click Next Select your repository Click Next Select the Use an existing module option to see all the available projects under that directory Select the MyCVS Project Click Finish The project will now be added to your workspace and will be displayed in the PHP Explorer view Note the repository icon a next to the project in PHP Explorer view indicating that they it is sitting ina CVS repository 58 Getting Started Adding Files to Existing Projects You can add files to existing projects in the CVS repository and commit them so that other users can access them w This procedure demonstrates how to add and commit a file into an existing project 1 In your MyCVSProject create a new PHP file called CVSFile2 with the following code lt php Another new file ZS Save the file In PHP Explorer view select the file right click and select Team Commit A Commit dialog will open Enter a comment Another new file added and click OK 5 The file will be committed to CVS and will be accessible by other users Note the P icon next to the file indicating that it is sitting in a CVS repository 59 Zend Studio 7 User Guide Making Changes Comparing Changes and Committing Changes Once files are stored on CVS you and all other team members can make changes to the files and commit them
389. nnat 300 Viewing and Editing Table Content 302 Creating a MYSQL Driver Definition 2 2 0 0 cecceeceeeeeeeeeeeeeeceeeee eae eeseaeeeeeeeseeeesaeeeeaeeeeneeees 303 Creating and Executing an SQL Ouer 306 Running Files and Applcatons nnn 308 Running PHP Scripts Locally ccccceceeeeeeseeeeeeeeceeeeecaeeeeaaeceeeeecaeeesaaeeseaeeseeeeesaeeeeaeeeeeees 309 Running PHP Scripts Remotely ccccccceeeeeseeceeeeeceaeeeeeeeceeeeesaeeeseaeseeaeeseaeeesaeessaeseenees 310 Zend Studio 7 User Guide Running PHP Web Pages RRE 312 Debugging Files and Applcatons nanena 315 Setting BreakPoint uiti ceeccecesccecesceeeeeeceeeceeneeeecaaeseeaaesaaaessaeeeeaaeseeaaesaeaaesnseeeeaaesseaaeeseeaeens 316 Debugging a PHP Script ccecceeeeceeeneeeeeeeeeeeeceeeeeceaeeeeaaeseneesaaeeeseaesneaeeseeeseaeeeeaeeeenees 318 Locally Debugging a PHP Gert 319 Remotely Debugging a PHP Gert 321 Debugging a PHP Web Page 323 Debugging EN 326 Installing and Configuring the Zend Browser Toolbar nesr nssrnesrnssrnsens 329 Running and Analyzing Debugger ReSults eeececeeeeeneeeeeeeneeeceenaeeeeeeaeeeseenaeeeeeeaeeeeeenaes 334 Setting Up Remote Debuoging 336 Setting your Environment to be an Allowed Host 337 Ensuring the Placement Of CUMMY ph 339 Adding a Server Location Path Map 340 Setting Up Tunneling soc ete iii a i a a a ee 342 Profiling Files and Applications 0 cececcceeeeeeeeeeeeeeeeeeeeeeeeeeeaeeeeeeeaeeeeesaeeeeeseeeeee
390. nning using the Local Copy option This means that when possible file content is taken from the files situated on your Workspace This prevents you from having to upload the latest revisions It s recommended that your local project structure reflect the project structure on your server See Running PHP Web Pages for more information Your server must be running the Zend Debugger or XDebug in order for remote debugging and profiling capabilities to function The Zend Debugger comes bundled with Zend Server Zend Core and Zend Platform but can also be downloaded as a separate component from http www zend com en products studio downloads 145 Zend Studio 7 User Guide Debugging Zend Studio debugging function allows you to test your files and applications and detect errors in your code The debugger allows you to control the execution of your program using a variety of options including setting breakpoints stepping through your code and inspecting your variables and parameters Zend Studio includes several different debugging methods as described below PHP Script Local Debugging Allows you to debug files on your workspace using Zend Studio s internal debugger The Internal Debugger enables developers to locally validate freshly developed code before deploying to a web server The internal option means that files located on your workspace can be debugged When debugging internal files the Zend Studio Internal Debugger u
391. nts in the PHP Script Arguments tab to simulate command line inputs 8 Click Apply and then Run Your script will be run and displayed in a browser If the file contains include or require calls to files which are not contained within the project you must add them to the project s Include Path in order to simulate your production environment 309 Zend Studio 7 User Guide Running PHP Scripts Remotely This procedure describes how to run files in your workspace using your server s Zend debugger Use this function if you want to test the execution of the file in real time on the production server This is especially relevant if your server has loaded extensions Your server must be running the Zend Debugger or XDebug in order for remote debugging and profiling capabilities to function The Zend Debugger comes bundled with Zend Server Zend Core and Zend Platform but can also be downloaded as a separate component from http www zend com en products studio downloads S To remotely run a PHP Script 1 Click the arrow next to the Run button of on the toolbar and select Run Configurations or go to Run Run Configurations A Run dialog will open 2 Double click the PHP Script option to create a new run configuration Name New _configuration 3 D PHP Script _ PHP Script Arguments FIG Environment Common Debugger Location O PHP Executable PHP Debugger PHP Executable PHP Web Server Default P
392. o Rename and move files and elements within those files while maintaining the links between the items Once an element or file has been renamed or moved all instances of that item within the project will be automatically updated to reflect its new name location Organize Includes so that elements from one file can be referenced in another file Refactoring should be used when you are reorganizing your project and changing names and locations of files and elements Refactoring will only work from within PHP Explorer view and not from Navigator view 81 Zend Studio 7 User Guide Renaming Moving Files Renaming a file Renaming a file will result in the automatic renaming of all instances where that file is referenced within the project This procedure demonstrates how to Rename a file 1 Create a PHP file called RenFile1 with the following code CP R 2 Inthe same project create a second PHP file called RenFile2 with the following code lt require RenFilel php a 8 eS Ensure you delete the PHP tags that are inserted by default when creating a new PHP file before pasting in the code 3 Save both files In PHP Explorer view right click RenFile1 and select Refactor Rename amp endash or select it and go to Refactor Rename from the Main Menu A Rename File dialog will appear In the Rename File dialog box rename RenFile1 to RenFile3 Check the Update references box and click Preview In t
393. o Zend Studio 7 x This procedure describes how to apply a Zend Studio 5 X keymap so that Zend Studio 5 X s shortcuts will be available in Zend Studio 7 x wi To apply a Zend Studio 5 X keymap 1 Go to Window Preferences General Keys The Keys preferences page will be displayed Keys SE Scheme Zend Studio E type fiter text Command Gidding When Category User Al Remove Block Comment CtrleShift Editing in Structured Text Eaters Edit BToggle Comment HS C Editing in Structured Text Edtors Edt Activate Editor Fiz In Windows Window Add Block Comment Ctrleshift Editing PHP source Source Add Block Comment CtrleShit Editing leva Source Source Add Bookmark F2 Zend Stucho Edtor Scope Edt o Clinclude unbound commands Restore Command Mare Description Bndng lt in the binding column denotes a key confit Rete etna C ae 2 Select Zend Studio from the Scheme drop down list 3 Click Apply Zend Studio 5 X s key shortcuts will be applied and available in Zend Studio 7 x 200 Tasks Zend Server Integration Zend Server Integration Integrating Zend Studio with Zend Server allows you to benefit both from Zend Studio s debugging and profiling functionality and from Zend Server s PHP Intelligence event monitoring capabilities Zend Server monitors and constantly tests your PHP environment and programs in order to allow you to gain maximum efficiency Instances of problematic scripts and slow execution are captur
394. o create a new PHP file within a project 1 In PHP Explorer view select the Project within which you would like to place the file 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 will be displayed Enter the name of the file and click Next The Use PHP Template checkbox will be marked by default This will create the new PHP file with the lt php gt PHP tags Select the required template or unmark the checkbox to create a blank file 6 Click Finish Your file will open in the editor and will appear within your project in PHP Explorer and Navigator views Creating a PHP File Outside of a Project Single PHP files can be created outside of a project quickly and easily for the purposes of writing short snippets of code which will not later need to be debugged or run and do not need to be associated with other files or projects wi To create a new PHP file not associated with a project 1 From the Menu Bar go to File New Other PHP Untitled PHP Document Ei 2 Anew PHP file by default called PHPDocumentt will open in the editor Or click the new Easy PHP File icon on the toolbar Once the file has been created it can later be saved within a project 190 Tasks w To save the file to a project 1 Click save lal on the toolbar A Save As dialog will open 2 Select the project with which you would like to associate with the
395. o use this feature select the block and press Ctrl Shift See Commenting Code for more information Remove Block Ctrl Shift Removes a block comment Comment To use this feature place the cursor anywhere within the comment and click Ctrl Shift See Commenting Code for more information Format Document Ctrl Shift F Auto formats a script to organize it into an easily readable format To format your code place your cursor anywhere within the editor view and press Ctrl Shift F 529 Zend Studio 7 User Guide Ee Appropriate line breaks and indents will be added You can configure your auto formatting options through the Formatter Preferences page accessible from Window Preferences PHP Formatter See Formatting Code for more information Format Active Ctrl I Only formats selected code Elements To format active elements select the required code to format and press Ctrl I Appropriate line breaks and indents will be added to the active elements You can configure your auto formatting options through the Formatter Preferences page accessible from Window Preferences PHP Formatter See Formatting Code for more information 530 Reference Refactor Menu The Refactor menu allows you to edit names and locations of files and resources For more on refactoring see Using Refactoring The options available from the Refactor menu are Description Alt Shift V Moves a file to a different folder To m
396. of this tutorial is to teach you how to work with the SVN source control system You will learn how to configure your SVN repository upload projects and files to it check out import projects and files from it and commit changes which you have made to files Contents Purpose Adding Files to Existing Projects Adding an SVN Repository Making Changes Comparing Changes and Committing Changes Sharing Projects Replacing Files with Older Versions Checking Out Projects from SVN Deleting Files from SVN Purpose SVN or Subversion is a source control system intended to allow a team or group to work on the same files and projects simultaneously and to be able to revert file and project states back to previous versions Adding an SVN Repository Before you can add projects to or export projects from SVN you must define your SVN repository settings To access a repository make sure that an SVN server is already configured S To add a new SVN repository 1 Open the SVN perspective by going to Window Open Perspective Other SVN Repository Exploring 2 Inthe SVN Repositories view click the Add SVN Repository button amp on the views toolbar or right click within the SVN view and select New Repository Location The Add SVN Repository dialog will open 3 Enter the information required to identify and connect to the repository location URL The URL on which your repository is located Authentication The user name a
397. oject Layout Select the required option Use project as source folder By default all folders created under the project root will be considered source folders and will be scanned during the Build process See Configuring a Project s PHP Build Path to configure the project s PHP Build Path Create separate folders for source files and public resources Two folders will be created under your project root one source folder for resources which will be scanned during the Build process and one public folder which will be skipped during the Build process You can change the default names for these folders by entering the required name in the Default source public folder name fields 599 Zend Studio 7 User Guide PHP Executables Preferences The PHP Executables Preferences page allows you to add edit remove and find PHP Executables The internal debugger in the defined PHP Executable is used for local PHP Script debugging Zend Studio comes with a bundled pre configured PHP Executable and local debugger The PHP Executables Preferences Preferences page is accessed from Window Preferences PHP PHP Executables Preferences a 600 PHP Executables Sr Add remove or edit PHP executables definitions PHP executables Name Debugger Type Location PHP 4 4 7 CGI Zend Debugger C Program Fi PHP 4 4 7 CLI Zend Debugger C Program Fil Edt PHP 5 2 5 CGI Worksp Zend Debugger C Program PHP 5 2 5 CLI
398. oject as separate projects Check out as folder into existing project Imports the project as a folder into an existing project in your workbench Check out as project with the name specified Imports the project as a new project into your workbench with a new name Specify the new name in the box To enable all Zend Studio s PHP functionality for the imported projects select the Check out as a project configured using the New Project Wizard option and ensure you create the new project as a PHP project 8 Click Finish The project will now be imported into your workspace Note that the project will have an SVN repository icon Ef in your PHP explorer view Once you have imported a project from SVN into your workspace you can now add files edit existing files and commit your changes to the SVN repository Projects can also be checked out from SVN through the SVN Repository Exploring perspective accessible from Open Perspective Other SVN Repository Exploring Simply right click the project in SVN Repositories view and select Check Out or Find Check Out As See the Subversive User Guide for more information on SVN Additional user guides can be accessed from inside Zend Studio by going to Help Help Contents or from the Eclipse Online Documentation site http help eclipse org ganymede index jsp 260 Tasks Accessing an Existing SVN Checkout This procedure shows you how to access projects in Zend Studio that
399. on on the Zend View ey To create a new Zend View file 1 In PHP Explorer view right click the views folder in your Zend Framework Project and select New Zend Framework Item Zend View The New Zend View Wizard will be displayed New Zend View New Zend View Create a new Zend View Source Folder 2FProject application default views File Name NewZendView phim Cea 2 The default location for the file will be in the application s default views folder Click Browse next to the Source Folder field to change the location 3 Edit the File Name if required 4 Click Finish A new Zend View file will be created with the relevant template The new file will be displayed in the MVC Oultine view 287 Zend Studio 7 User Guide Creating a Zend View Helper File This procedure describes how to create a new Zend View Helper File Zend View Helpers when attached to a view object can call the helper as if it were a method of the view object itself The View object retains helper instances which means that they retain states between calls See hitp framework zend com manual en zend view helpers html for more on Zend View Helpers KY To create a new Zend View Helper file 1 In PHP Explorer view right click the relevant helpers folder in your Zend Framework Project and select New Zend Framework Item Zend View Helper The New Zend View Helper Wizard will be displayed 2 Ensure the source folder is correct or click Brow
400. on to i5 server Enables connecting to the i5 server 1 Connects to i5 server 2 Closes connection to i5 server Creates the data area 1 Connects to i5 server 2 Creates data area of given size 3 Closes connection to i5 server Enables deleting the data area 1 Connects to i5 server 2 Deletes data area 3 Closes connection to i5 server Enables reading from a data area 1 Connects to i5 server 2 Reads from data area 3 Closes connection to i5 server Enables reading from a data area 1 Connects to i5 server 2 Reads from the data area 3 Closes connection to i5 server Enables reading data from the data queue without key 1 Connects to i5 server 2 Reads data from the data queue without key 3 Closes connection to i5 server Enables reading data from the data queue with key 1 Connects to i5 server 2 Reads data from the data queue with key 179 Zend Studio 7 User Guide IBM i Template Explanation re eee all 3 Closes connection to i5 server is5DtaqSend Enables putting data to the data queue without key 1 Connects to i5 server 2 Puts data to the data queue without key 3 Closes connection to i5 server isDtaqSendKey Enables putting data into the data queue without a key it 1 Connects to i5 server 2 Puts data to the data queue without key 3 Closes connection to i5 server i5JobLogs Enables retrieving job log entries 1 Connects to i5 server 2 Opens job log 3 Gets array for a job log entry 4 Closes handl
401. on will debug the last executed launch configuration Getting Started Debugging a PHP File Remotely Files can also be debugged remotely using the Debugger situated on your server Use this function if you want to test the execution of the file on your production environment This is especially relevant if your server s loaded extensions are different than the local environment Your server must be running the Zend Debugger or XDebug in order for remote debugging and profiling capabilities to function The Zend Debugger comes bundled with Zend Server Zend Core and Zend Platform but can also be downloaded as a separate component from http www zend com en products studio downloads w This procedure demonstrates how to debug a file remotely If you have already created the file following steps 1 3 under Debugging a PHP File Locally above skip to step 4 1 Inside a PHP project create a PHP file called debug and copy paste the example code into it 2 Seta breakpoint at line 103 by double clicking the marker bar to the left of the editor window A blue ball will appear 3 Save the file 4 Click the arrow next to the debug button E on the toolbar and select Debug Configurations or right click the file in PHP explorer or within the file s editor window and select Debug As Open Debug Dialog A Debug dialog will appear Double click the PHP Script option to create a new debug configuration Enter
402. onfiguring Zend Studio in Zend Server In order for you to be able to debug applications situated on Zend Server your Zend Studio must be configured as an Allowed Host for initiating debugging settings To configure Zend Studio communication in Zend Server 1 Open your Zend Server GUI This can be done from within Zend Studio through the Servers view or by selecting the server on which you have configured your Zend Server integration from the drop down list next to the Zend Server icon on the toolbar OR 2 Go to the Server Setup Debugger tab db Monitor Ruste Management A Server Setup Q aaministrauon Components Exiensions Directives Debugger Monitor Allowed Zend Studio Clients for Debugging ES R r Exact IP address only Current list of allowed hosts 127 0 0 1 d 192 188 172 16 0 0 12 13313 Denied Zend Studio Clients for Debugging Exact IP address only Use this list to exclude specific hosts from the allowed hosts list 3 Ensure the IP address of your Zend Studio is included in the Allowed Hosts sections To add an address to the list i Under the Allowed Zend Studio Clients for Debugging category enter the IP of the machine on which your Zend Studio is installed ii Click Add The IP Address is added to the Allowed Hosts list 4 Ensure your Studio s IP address is not in the Denied Hosts list If it is click Remove next to the required address to remove it from the list 5 Click the Restart P
403. ons View Menu Commands Su e v7 The view s menu can be accessed through the view menu icon Description PHP Version Allows you to choose between PHP4 and PHP5 selection functions The PHP Functions View is displayed by default as part of the PHP Perspective To manually open the view go to Window Show View Other PHP Tools PHP Functions 512 Reference PHP Project Outline View The PHP Project Outline view displays a list of Soap Clients Namespaces PHP 5 3 only Constants Classes and Functions for all files within the selected project Selecting an element in the PHP Project Outline view will open the relevant file in the editor To access the view go to Window Show View Other PHP Tools PHP Project Outline ESA Graderi ing FiledRectanglelf4 ft fe Syb fon color to_color style 1 GetCoMbnay irom_cole He Con Zen ae fcolos Syumecols 100 Bait GroupBePiot Ewends BaPiot GroupB aPiot fplots Legend graph Mind Mall Det GiMaeaal Strokel ing scale tyscale AccBaPiot a Extends BaPtot nbeplots numponts o D 9 W W E 2 PHP Project Outline View Toolbar commands Collapse Collapses the list of elements All Link with If selected elements will immediately be displayed in the editor when Editor they are single clicked If unselected elements will be displayed in the editor when they are double clicked 513
404. or Displays the current active file in the Navigator view Outline Displays an element in the Outline view Quick Type Displays a selected Type in a Quick Type Hierarchy a l See Viewing Type Hierarchies for more information Next Ctrl Goes to the next previous annotation in the script Previous Ctrl Possible annotations are Bookmarks Diff additions Diff Annotation changes Errors Info Search Results Spelling Errors Tasks and Warnings Click the arrow next to the next previous annotation icon on the toolbar to configure which types of annotations should be included Possible annotation types are Bookmarks Diff Additions Diff Changes Errors Info Search Results Spelling Errors Tasks and Warnings Show Zend Opens the Zend Server Event List Server This is only applicable if a Zend Server has been configured in Event List the PHP Servers Preferences page See Zend Server Integration for full information on the Zend Server Last Edit Ctrl Q Jumps to the last location that was edited Se a T Go to Ctrl L Allows you to go to a specific line in the active editor zoe p Back Alt Left Scrolls through last viewed sections in active and previously 533 Zend Studio 7 User Guide Search Menu Allows you to Search for text or PHP elements in your workspace The options available from the Search menu are Description P a Ctrl H Opens the PHP Search dialog PHP Search enables you to locate declarations
405. or unexpected ApacheRequ Demo2 php A Syntax Error unexpected count Demo2 php ke Warnings 1 item Unresolved include a pbp for projects E jpgraph_ba Path Demo Project Demo Project Demo Project Demo Project Demo Project Demo Project Demo Project Demo Project Location line 10 line 12 line 13 line 6 line 3 line 4 line 6 line 2 Double clicking on an error in the Problems view will take you to the relevant location in the Editor If the Problems view is not displayed go to Window Show View Problems 136 Concepts Semantic Analysis Zend Studio s Semantic Analysis mechanisms can detect problems beyond the regular parsing warnings and errors This helps developers to analyze static source code to enforce good coding practices and scan PHP code The Semantic Analysis feature achieves this functionality by attempting to reconcile problematic code and locating unreachable code code that has been defined but is not used or with empty variables Semantic Analysis warning messages help to ensure that your code is written and formatted in a way that will result in optimal performance for your script In addition it supplies you with practical suggestions for improving the code Semantic Analysis problems will be displayed in the Problems view and be indicated in the code with warning and error icons see Real Time Error Detection for more information Quick Fix The Semantic Analysis Quick
406. oring topic in the Zend Studio Online Documentation or User Guide for more information ei To rename an element within the editor 1 Inthe 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 function display workers DH global db for 1 0 n count db i lt n i uorker_data db i gt shorker name vorker_data 0 pe des del e d Stu Enter new name press Enter to refactor e by print lt tr bacolor cow_color 3 Ta ot ns p print metd gt worker namel lt td gt n print lt td gt worker_address lt td gt n print lt cd gt vorker_phone lt td gt n print lt tr gt n 4 Type the new element name in the box All occurrences of the element name are automatically updated To preview the changes before applying them click the arrow in the right hand corner of the Refactor popup and select Preview 5 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 31 Zend Studio 7 User Guide Run your application In order to preview the execution of your application on a server you can easily run it in Zend Studio s intern
407. ormation This page can be used as a bookmarks area for web links If you have a resource that you would like to see in this area send a mail to documentation zend com and the link will be added for the next version PHP Manual English http Awww php net Zend Framework http framework zend com Zend Dev Zone http devzone zend com public view Zend Forums http www zend com en forums PHP Certification http Awww zend com en services certification PHP Yellow Pages http www zend com en store education certification yellow pages php Support Center http www zend com en support center Knowledge Base Search http www zend com en support knowledgebase php Refactoring Information http Avww refactoring com HTML Tutorials http www w3schools com html 642 Reference Support Zend Technologies provides a wide range of resources for obtaining additional information and support such as the Zend Support Center the Zend Newsletter and the Zend Developer Zone Zend Support Center The Zend Support Center is a portal for information on all Zend Product related issues From the Zend Support Center http www zend com en support center you can access Zend Forums Hosted user forums for the Zend product user community See what other users have to say and get answers directly from the Zend Support team Visit http www zend com en forums Zend Support Knowledge Base The Zend Knowl
408. ou to edit upon opening click to use the first available port or explicitly set the port number 5 Click OK to save all changes The port number for your FTP SSH connection has been edited To change the FTP SSH connection port number back to the default port or the first available port click 2 See the RSE User Guide for more on FTP SSH connectivity Additional user guides can be accessed from inside Zend Studio by going to Help Help Contents or from the Eclipse Online Documentation site http help eclipse org ganymede index jsp 266 Tasks Viewing and Editing Files on an FTP SSH Server Files located on an FTP SSH server can be opened and edited in Zend Studio without having to save them to your Workspace This procedure describes how to view and edit files which are situated on your FTP SFTP server To view and edit files located on an FTP SSH server 1 Create an FTP SSH connection by following the steps under the Creating an FTP SSH Connection topic 2 Open the Remote Systems view by going to Window Show View Remote Systems J Remote Systems 3 Expand the tree under your FTP SSH connection Remote Systems E2 L ZIR Si g BS D ES Local Fy LOCALHOST Gy 10 1 2 241 H h MyConnection h Files KE My Home ea eb amp db amp file types ao v J _aznadinbo 0 H 4 Some files and folders might require you to enter your FTP SSH login User ID and Password
409. ough which the function was reached In the editor window place and hold the cursor over worker_name worker_address and worker_phone A tooltip appears displaying the variable values H global db for i 0 n count db i lt n i worker data db i Guorker data null worker name worker_data Q worker address worker data 1 E The cursor returns to line 103 The Debug Output view will display the HTML output created up until the breakpoint while the Browser Output view will show the current output to a browser 18 In the Debug view click Resume SS until the debugging process is terminated 73 Zend Studio 7 User Guide 74 Notice that as the debugging process progresses the Debug Output and Browser Output displays are updated E Debug Output iF Browser pk ii Ss Debug Demo E 10th St NYC NY 23742 ges 312 Beethoven St Frankfint Germany mg 127 Mame St San Francisco CA 90298 P P kb 19 The console view will display any errors or warnings about your script In this case it will display a Notice about an undefined variable on line 105 20 Click on the PHP Perspective icon to return to normal editing mode 21 To run the debugging process again click the arrow next to the debug icon ER on the toolbar and select your configuration or select Debug Configurations and double click your configuration from the Debug dialog Clicking the debug ic
410. ould be independent of others to ensure that test results can pinpoint the location of the error Running unit tests can ensure that your code is stable and functioning correctly and can help you to diagnose errors 91 Zend Studio 7 User Guide Creating a PHPUnit Test Case Zend Studio will automatically create test case files which can be run in order to check the functionality of your code y The following steps demonstrate how to create a PHPUnit Test Case 1 Create a new PHP file called Calculator and copy paste the following code into it lt php class Calerlacor A pablie function exclel Sa Slo 3 return Sa Sb stet rvunecticn milcioly Sa Slo 1 return Sa Sb tree Ate Seene Glivskela Sai Sle A aie Slo mull 4 throw new Exception Division by zero pecuri Sal Slo tte ten ent nl Suen Sa Siet return Sa Er 2 gt 2 Save the file 3 In PHP Explorer view right click the calculator file and select New Other PHP PHPUnit PHPUnit Test Case The PHPUnit Test Case dialog will open 92 Getting Started PHPUnit Test Case E Project ExampleProject already contains class display_workersTest KE Source Folder ExampleProject Superclass PHPUnit_Framework_TestCase Browse PHPUnit_Framework_TestCase class Function Element to test display_workers l Browse DebugDemo php Test Class Name display_workersTest
411. ould like to replace the revision Click Yes Your project will be reverted to the old one and the line have made a change will be removed from SVNFile1 Deleting Files from SVN You can delete a file from the SVN repository so that the file will no longer be available to any users wi This procedure demonstrates how to delete a file from SVN Open the SVN Repositories view Expand the nodes to find your project Right click the file you would like to delete and select Delete PON A Commit Deletion dialog will open Enter a comment if required 5 Click OK The file project will be deleted from your SVN repository This action will delete the file from the SVN repository and not just from your workspace This file will no longer be accessible by any users See the Subversive User Guide for more information on the SVN plugin 69 Zend Studio 7 User Guide Working with the Debugger The purpose of this tutorial is to teach you how to debug files and applications both remotely and locally in order to gain maximum efficiency and accuracy from your files and projects Contents Purpose and Usage Debugging Local PHP Files PHP Scripts Debugging PHP Applications PHP Web Pages Purpose and Usage Zend Studio s Debugging feature can detect and diagnose errors in PHP code situated locally or on remote servers The debugger allows you to control the execution of your program by setting breakpoints suspending lau
412. ound ess PHPDoc Cipa String Task Tag Ohtake Variable Cl Srrke theough Junderine Restore Defaut Sample text lt php A text lt lt lt HEREDOC Hello Vorid HEREDOC Samy Je LupCt Lot Othrows Exception function foo if func_num_args 1 throw new Exception Illegal number of e ai lt A etre ofa Les Izeg 587 Zend Studio 7 User Guide w To configure the colors and fonts for an item 1 Select the required item from the Syntax element list Click on Foreground or Background to select a colour 3 Select what formatting if any you would like to apply to the text Bold Italic Strikethrough Underline 4 Click Apply to apply your settings The Sample text box displays a preview of the different elements More color and font options can be configured by opening the preferences page accessed from Window Preferences and selecting General Appearance Colors and Fonts General Editors Text Editors Annotation General Editors Text Editors Quick Diff Run Debug Run Debug Console Team CVS Console 588 Reference Task Tags Preferences The Task Tags preferences page allows you to add new task tags and edit existing ones Tasks are used as reminders of actions work to do or any other action required by the programmer Task tags are strings used by Zend Studio to recognize when tasks are added in your script Anything after these strings inside a comment will be re
413. oval of whitespace after every save 2 Select whether All whitespace lines will be removed by marking All lines or whether empty lines will be ignored by marking Ignore empty lines 3 Click Apply to Apply your settings Every time you save a file whitespace will be removed according to the configured settings wi To apply Save Actions settings to a specific project only 1 Click the link labelled Configure Project Specific Settings 2 Select the required project from the list A Save Actions Properties page will appear 3 Select the required settings and click Apply Save Action settings can also be configured for an existing project by right clicking the project in PHP Explorer view and selecting Properties Save Actions 586 Reference Syntax Coloring Preferences The Syntax Coloring preferences page allows you to set the foreground color background color and font type for different icons in order to make your script manageable and easier to read The Syntax Coloring Preferences page is accessed from Window Preferences PHP Editor Syntax Coloring Syntax Coloring dt v Customize the syntax highlighting by selecting the type of text whose style you want to customize from either the kt or the example text aen Default colors and font can be configured on the Text Editors and on the Colors and Fonts preference page Syntax Element Comment st Heredoc Keyword Foreground Normal Backgr
414. ove a file select it from the PHP Explorer view A Move dialog will open Select the required folder and click Preview to see all changes that will be made as a result of the Move Click OK to implement your changes and move the file All references to the file will be automatically updated to reflect its new location Rename Alt Shift R Renames a file or element To rename a file select it from the PHP Explorer view To rename an element within a file select it from the PHP Explorer view or highlight it in the editor view A rename dialog will open Enter the new name and click Preview to see all changes that will be made as a result of the rename Click OK to implement your changes All references to the file element will be automatically updated to reflect the change Extract Alt Shiftt M Extracts methods from selected code Method Extract Alt Shift L Extracts variables from selected code Local See Extracting Variables for more information Variable Refactoring options will only be available from within PHP Explorer view and not from Navigator view Using the Navigator view s move rename functions will not update any referenced instances of the file element 531 Zend Studio 7 User Guide Navigate Menu The Navigate menu allows you to navigate through your scripts in order to find information and text The options available from the Navigate menu are Goes into a selected folder so that only that folder s con
415. package name Default category name Custom tags if required Ignore tags if required Examples directories path if required 8 To save these settings so that they can be reused when creating new PHPDocs Tasks mark the Save the settings of this PHPDoc export in an ini file checkbox and specify where the ini file should be saved 9 Ensure the Open generated documentation in browser checkbox is marked to view your PHPDoc once created 10 Click Finish A Running PHPDocumentor dialog will appear Your PHPDoc will be automatically created and will be opened in a browser By default your phpdoc is created as an index html file in a folder entitled docs in the root of you Workspace e g C Documents and Settings bob Zend workspaces DefaultWorkspace docs index html 409 Zend Studio 7 User Guide Creating HTML files These procedures describe how to create new HTML files allowing implementation of Zend Studio s full HTML editing functionality S To create a new HTML file 1 In PHP Explorer view select the folder into which you would like to create the file and from the Menu Bar go to File New HTML Page or right click the folder and select File New HTML Page The new HTML Page dialog will appear 2 Enter the file s name and click Next 3 Select which HTML template to use for the new file and click Finish The new HTML file will be created and will open in a standard HTML editor If you are interested in
416. profiling functionality and from Zend Server s Event Monitoring capabilities Zend Server monitors and constantly tests your PHP environment and programs in order to allow you to gain maximum efficiency Instances of problematic scripts and slow execution are captured by Zend Server as events Zend Server s integration with Zend Studio means that the problems identified by Zend Server can then be viewed tested debugged and profiled in Zend Studio This can be done through the Zend Server user interface or by importing Zend Server Events into Zend Studio 164 Concepts Viewing Events from Inside Zend Studio Zend Server s events can be viewed and debugged directly from within Zend Studio using the internal browser which displays the Zend Server User Interface See Debugging Profiling Events from Zend Server for more information O Q 8 Ae As alre Sp 1 E ttp flocahast 81 ZendServer index php7ioadCtrl Monitor LNeloadActn ssues Listat oken d 0495263924dc1 SbdSa6Sc3cb73dk7d 1237207009015 gt RH j at Monitor EI Rute Management Dashboard Events Server info PHP Info Logs Eer All Open Events Shaw Filter Details gt Go to event by Id tal 6 Last refresh time 16 Mar 2009 14 36 a D Rule Name Severity Count Status First Occ LastOcc Occurred at C 000005 Severe Siow Request Execution Absolute Critical 1 Open 19 Feb 17 25 19 Feb 17 25 hitpocaihost8tissuesphp O 200005 PHP Eror Wa
417. projects or collections of files that are already on the server Your server must be running the Zend Debugger or XDebug in order for remote debugging and profiling capabilities to function The Zend Debugger comes bundled with Zend Server Zend Core and Zend Platform but can also be downloaded as a separate component from http www zend com en products studio downloads wi The following steps demonstrate how to profile a file on an external server 1 o ON o 10 11 Create a file called Person and copy paste the example code into it See the Working with the Profiler Tutorial in Zend Studio s Online Help for the example code Create a second file called tryPerson and copy paste the example code into it See the Working with the Profiler Tutorial in Zend Studio s Online Help for the example code Save both files Copy them to your server Click the arrow next to the Profile button sl on the toolbar and select Profile Configurations or right click the file in PHP explorer or within the file s editor window and select Profile As Open Debug dialog A Profile dialog will appear Double click on the PHP Web Page option to create a new profile configuration Enter a name for the new configuration Select the Zend Debugger to from the Server Debugger drop down list Ensure that your server is selected from the list If you have not configured a server click New and enter i Your server s name ii The
418. pse org ganymede index jsp 299 Zend Studio 7 User Guide Connecting to a Database Once you have established your connection profile you can connect to your database from the Data Source Explorer view This procedure describes how to connect to your database S To connect to your database 1 Open the Database Development perspective by going to Window Open Perspective Other Database Development 2 Inthe Data Source Explorer view expand the SQL Databases node and right click your connection profile To edit the properties of the Connection Profile right click it and select Properties 3 Click Connect Once the connection has been established you can expand the tree underneath your Connection Profile to view the contents of the database asourceEspren 7 7 DS Isi ec amp Databases j C Schemas EI SE database L Dependencies L Stored Procedures C Tables H E customerst E customers2 E FS customers3 E employees H E offices E orderdetails sn FA orders payments productlines a E products LI User Defined Functions D Views H L ODA Data Sources To see a sample of the data in the tables right click one and select Data Sample Contents The SQL Results view will open with a sample list of the data from your table 300 Tasks FERED OO papasasa ofheetode H D 3 a s 6 pry rrarrhs 1 z LU 4 s 6 For more information on the Data Tool
419. pt Libraries QO S E Libraries amp Global SuperType Source ki Projects Referenced Projects S ZendFremeworiexanpl To add a project to the JavaScript Build Path 1 Click the Add button The Required Project Selection dialog is displayed 2 Select the required projects and click OK The selected projects will be added to the JavaScript Build Path During the Build process the referenced projects will be built before the project itself 459 Zend Studio 7 User Guide Saving your changes Once you have made all necessary changes to your JavaScript Build Path click OK Your project will be rebuilt to reflect the changes according to the settings you configured 1 Setting include path 460 Tasks Viewing JavaScript Elements in the Outline View This procedure describes how to view JavaScript objects and elements in the Outline view S To view your JavaScript objects in the Outline view 1 Go to the Outline view If it is not displayed go to Window Show View Outline 2 If your JavaScript objects are contained within a PHP file click the Menu arrow S on the Outline view s toolbar and select html HTML and JavaScript objects contained within the file will be displayed in a tree view Quin 3 EPH P oner 1 SI html v Link with Editor gt head v Show Attnbutes gt Script php _ O ae hm body r 4 y gt script lt gt Pre 3 Double Clicking the l
420. r Faces JSF Library JPA JPA Project PHP PHP Class PHP File PHP Interface PHP Project Untitled PHP Document Zend Controller Zend Framework Project Zend Model Zend Module Zend View PHP Unit PHPUnit Test Case PHPUnit Test Suite Remote System Explorer Connection SQL Development SQL File SVN Projects from SVN Repository Location Web CSS HTML JavaScript Static Web Project 521 Zend Studio 7 User Guide Web Services WSDL XML DTD XML XML Schema Examples GEF Graphical Editing Framework Plug ins XML Zend Framework 522 Reference Import Submenu The Import submenu is available under File Import from the Menu Bar The options available under the Import submenu are Existing Projects into Workspace Projects from the local file system File System Files from the local file system Browse to the folder in which the file is sitting and click OK A list of files within that folder will be displayed to allow you to choose the required Preferences Import preferences from a preferences file on the local file system into the workbench Projects from CVS Imports projects by connecting to a CVS repository Once a project has been imported from CVS changes can be made to projects and files which can then be committed to update the CVS repository A CVS repository connection needs to be configured before using this function For more information see Using CVS PHP Profiler Prof
421. r allow_hosts and zend_debugger allow_tunnel if necessary parameters to include the IP address of the machine on which your Zend Studio is installed e g zend_debugger allow_hosts 127 0 0 1 32 zend_debugger allow_tunnel 127 0 0 1 32 Ensure the address is not in your zend_debugger deny_hosts parameter list Set the Debug Server to expose itself to remote clients by setting the zend_debugger expose_remotely parameter to Always e g zend_debugger expose_remotely always Save the file Restart your Web server for the settings to take effect Tasks Ensuring the Placement of dummy php In order for the remote server s debugger to communicate with Zend Studio a file called dummy php must be located in your server s document root With the default Zend Server installation a dummy php file will have been automatically placed in your server s document root folder If you installed the standalone Zend Debugger you must copy the dummy php file from the Zend Debugger archive to your server s document root If you have set up a virtual host and it s document root is not pointed at the remote server s default document root you will have to copy the dummy php to the virtual host s document root in order to be able to debug on that virtual host You must also ensure that the Dummy File name is set to dummy php in Zend Studio S To check your dummy file configuration in Zend Studio 1 Open the Installed Debugger Preferences page by go
422. r library Select the Add to environment checkbox if you would like this library to be added to your entire environment instead of a specific project 5 To apply changes click OK A new empty library will be added to the list Next to the name in brackets indicates if it is shared by the environment or only related to a project Adding a PHP library creates a place folder in which you can place external files that contain pre written code For more information see Adding External Folders to PHP Libraries Once you have added a user library in the PHP preferences page you must also add it to your PHP Include Path of the project in which you would like to have it available For more information see Configuring a Project s PHP Include Path 360 Tasks Adding External Folders to PHP Libraries This procedure describes how to add external folders to a user library This allows you to compile a user library using folders from varying places on your computer In order to add an external folder you must have already created a user library For more information see Adding a PHP Library If you are interested in using compressed files click the Add ZIPs button and select a file instead of following the procedure below w To add an external folder to your user library 1 Goto Window Preferences PHP PHP Libraries 2 Inthe PHP Libraries Preferences page click Add External folder The External folder Selection dialog will open
423. rameters through which functions are reached Editor Window will display the code at the relevant sections according to which line is selected in the Debug View window Debug Output Will show the textual output of the script This will be updated as the debugging process continues Browser output Will show the output of the script to a browser This will be updated as the debugging process continues Debug Output Browser Output Se Debug Demo John E 10th St NYC NY 23742 Klaus 312 Beethoven St Frankfurt Germany Gu 127 Mane St San Francisco CA 90298 Getting Started Console View Will display any error and warning messages Tasks If you had added any tasks to your script these would be displayed here 18 Click on the PHP Perspective icon to return to normal editing mode 19 To run the debugging process again click the arrow next to the debug icon E on the toolbar and select your configuration or select Debug and double click your configuration from the Debug dialog 77 Zend Studio 7 User Guide Debugging PHP Applications PHP Web Pages Zend Studio also allows you to debug applications projects or files that are already on the server You can debug either the local Workspace copy of files or the server copy of files Your server must be running the Zend Debugger or XDebug in order for remote debugging and profiling capabilities to function The Zend Debugger comes b
424. rates how to format your scripts To format your whole script 1 Open the required file 2 Go to Source Format Document or press Ctrl Shift F Your code will be automatically formatted Example lt php lt php class Calculator class Calculator public function addifa b return a b public function addifa b public function multiply a b i return fa return fa b public function divide a fb LU if b U throw ney Exception Division by zero r public function multiply a b i public function subtract fa b return fa return a Zb HE public funcrion divide a fiib H it b null t throw new Exception Divisi return Za Zb public function subtracti sa b return a b Unformatted Code Formatted Code S To format only selected lines within the script 1 Select the relevant lines 2 Go to Source Format Active Elements or press Ctrl l Only the selected lines will be formatted Code Formatting will also be available in JavaScript editors JavaScript Formatting preferences can be configured from Window Preferences Web JavaScript Code Style Formatter 226 Tasks Using Code Folding Code Folding collapses or folds the display of a block of code To enable code folding go to the Folding Preferences page accessible from Window Preferences PHP Editor Using Code Folding If Code Folding is enabled minus signs will appear i
425. ration Reference Installed Debuggers The Installed Debuggers preferences page allows you to configure your Debugger settings The Installed Debuggers Preferences page is accessed from Window Preferences PHP Debug Installed Debuggers LG Ce l EES pe Her text 7 Installed Debuggers General A Data Management Installed Debuggers Dynami Languages Debugger Type Port g Field Assist Zend Debugger 10137 amp Help xDebug 9000 Install Update E PHP Appearance Code Coverage Code Gallery Code Refactor amp Code Style Debug Installed Debugge ira f SS I x Restore Defaults Apply OK Cancel wi To configure your Zend Debugger settings 1 Select the Zend Debugger 2 Click Configure The Zend Debugger Settings dialog will open Zend Debugger Settings Zend Debugger Debug Port 10137 F Run with Debug Info Chent Host IP 10 1 2 103 127 0 0 1 Broadcast Port 200680 Dummy File Name dummy php _ Use SSL Encryption 573 Zend Studio 7 User Guide 574 3 Configure the following Debug Port The port which the Zend Debugger will use The default port is 10137 Run with Debug info Mark the checkbox for Debug info such as the Console view and the Browser Output to be displayed when a Run configuration is executed Client Host IP Enter the Client Host IP to which debugging results will be returned Zend Studio will automa
426. re generated code and comments i Comments or dp Code Export All Pattern Automatically add comments for new methods and types Restore Defaults Apply y To edit the pattern for a comment or code element 1 Expand the list and select the required element 2 Click Edit The Edit Template dialog is displayed 3 Edit the pattern as required and click OK If required mark the Automatically add comments for new methods and types box for comments to be automatically generated when new methods and types are created 559 Zend Studio 7 User Guide 5 Click Apply to apply your changes Exporting and Importing Code Templates Zend Studio enables you to export and import code templates which are created within XML files in the following format lt xml version 1 0 encoding UTF 8 standalone no gt lt templates gt lt template autoinsert true context php deleted false description description enabled true id org eclipse php ui editor templates php codetemplates xxxcomment name name gt kK S tags lt template gt lt templates gt w To import a code template 1 Click Import to open the Import Templates browser 2 Select the relevant XML file containing the template information 3 Click Open The templates contained in the template xml file will be imported into the list of Templates KY To export a code template 1 S
427. references The PHP Libraries Preferences page allows you to create and maintain an external code library Enabling PHP Libraries in your project allows libraries to be referenced by the project and makes the elements within these resources available for operations such as Content Assist and Refactoring You may change the order your user libraries are in by using the Up and Down buttons The order in which the libraries are arranged in this page defines the order they are available in Zend Studio s functionality such as content assist The PHP Libraries Preferences page allows you to do the following Add PHP Libraries Add External Folders to PHP Libraries Export PHP User Libraries Import PHP User Libraries Edit PHP User Libraries Edit PHP Library Components or Folders Remove a PHP Library or Library Folder The PHP Libraries Preferences page is accessed from Window Preferences PHP PHP Libraries SD Preferences filter i PHP Libraries General pr Data Management amp Dynamic Languages Field Assist Help Install Update PHP Appearance Code Coverage Code Gallery Code Refactor Code Style Debug Editor New Project Layout PHP Executables PHP Interpreter PHP Libraries PHP Manual User libraries can be added to a DLTK Build path Defined user libraries 604 Reference Once you have added a user library in the PHP preferences page you must al
428. replace all occurrences of a given code fragment wi To create a new method from an expression 1 9 In the editor select the the code fragement which you would like to replace with a method Right click and select Refactor Extract Method or click Alt Shift M The Extract Method dialog is launched 3 Extract Method Method name Access modifier O pubic O protected Odefaut private E Generate method comment Method signature preview function extracted Enter the name of the new method in the Method name field Select the Access modifier for your method If multiple occurrences of the code fragement appear in your code mark the replace all occurrences of statements with method checkbox for all occurrences to be replaced with the new method Mark the Generate method comments checkbox for comments to be created for your method Click OK to apply your changes or click Preview if you want to see a preview of the changes that this refactoring will create If you clicked preview a preview window will open with a changes tree showing all the changes which will be made to reflect the extracting of the method The changes will be listed according to the context within which they appear You can expand the nodes to see all changes within particular files classes or functions Use the Next Previous Change arrows to scroll through all possible changes Unmarking the checkboxes next to the changes will ca
429. ressing the configured key while hovering over the element in the editor will display the relevant information or take the relevant action For example applying the settings displayed in the screenshot above Source key preference Ctrl and pressing Ctrl while hovering over an element in the editor will take you to that element s source You can configure key preferences for the following elements Combined Hover Tries the hover in the sequence listed in the table and uses the one which fits best for the selected element and the current context Variable Values Zend Debugger Shows the value of the selected variable while debugging with the Zend Debugger 582 Reference Variable Values XDebug Shows the value of the selected variable while debugging with XDebug Documentation Shows the documentation of the selected element Problem Description Shows the description of the selected problem Source Shows the source of the selected element Annotation Description Shows the description of the selected annotation To configure the key preferences 1 Mark the checkbox next to the required preference 2 Enter the required key in the pressed key modifier while hovering box 3 Click Apply to apply your settings 583 Zend Studio 7 User Guide Mark Occurrences Preferences The Mark Occurrences Preferences page allows you to configure for which types of elements the Mark Occurrences feature will be enabled
430. rk Elements for more information 273 Zend Studio 7 User Guide Running and Debugging Zend Framework Projects In order to run and debug Zend Framework projects on your server you will need to set up your server to be able to execute Zend Framework applications Setting Up Your Server Environment Prerequisites Apache 2 2 or later PHP 5 a Zend Framework Note The Zend Framework version installed on your server should match the Zend Framework version in which you developed your application These components can be installed together by installing Zend Server The following instructions will guide you through the process of setting up your Zend Server in order to be able to run Zend Framework based applications Zend Server is the recommended environment but Zend Framework projects can be run on other servers Different configuration information might apply To set up your server in order to run debug Zend Framework Projects 1 274 If you do not have a server running a PHP distribution already installed you can install Zend Server downloadable from http www zend com en products server Ensure you install with the following settings i lf you do not have a Web server install the Apache bundled with Zend Server ii lf you do not have the Zend Framework files already installed on your machine install Zend Server in Complete mode or ensure that Zend Framework is selected in the list of additional
431. rl Shift F7 Hold down the Ctrl key and press F7 Shift 7 to scroll between the views This command is similar to the Alt Tab functionality on Windows Next Ctrl F8 Switches to the last next open Perspective Perspective Ctrl Shift F8 Previous Perspective 540 Reference Window Submenu The Window menu allows you to customize your workbench display The options available from the Window menu are EEN Opens the workspace in a new window Clicking on the window s X icon will close only that window and not the whole EES meee O e Open Opens a selected perspective containing a selection of Perspective views See the Workbench User Guide for more on Perspectives Additional user guides can be accessed from inside Zend Studio by going to Help Help Contents or from the Eclipse Online Documentation site http help eclipse org ganymede index jsp Show View Displays a selected view See the Workbench User Guide for more on Views Additional user guides can be accessed from inside Zend Studio by going to Help Help Contents or from the Eclipse Online Documentation site http help eclipse org ganymede index jsp Customize Configures settings for the active perspective including Perspective settings for The quickly accessed settings on the New Open Perspective and Show View submenus Which options appear in the menu and toolbar Save After configuring the perspective you can select to save
432. rmation you need at your fingertips and improves productivity by reducing searching scrolling and navigation By making task context explicit Mylyn also facilitates multitasking planning reusing past efforts and sharing expertise The Task List allows you to view and manage your tasks The Task List contains both Local Tasks and shared Repository Tasks that are stored in a task repository such as Bugzilla or Jira Local tasks are typically contained in categories Repository tasks are contained in special categories that represent queries Mylyn features the following Task List Presentation s Icon Legend and Color Coding Creating New Tasks Using Local Tasks Repository Tasks Task Focused Interface Task Focused Ordering Task Hyperlinking For more information see the Mylyn User Guide 185 Zend Studio 7 User Guide Phar Integration Phar Integration will enable you to integrate with phar archives Phar is an archive system that enables you to group numerous files into a single file for easy distribution and installation A phar archive provides a way to distribute a complete PHP application in a single file and run it from that file without needing to even use a disk Using a Phar archive library is identical to using any other PHP library Phar Integration contains the following features Export to phar Import to phar Add phar to your project Please click here for more information on Phar extern
433. roject make sure that you have already created a Creating a Connection via the Server View wi To create a new remote project 1 2 3 4 4 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 Go to the Remote Server section New PHP Project Create a PHP Project Create a PIP project n the workspace or in an external location Project name Contents Create new project in workspace O Create project from existing source Remote Server E Enable Remote Web Ske new eren pc Local C Documents and Settings mor g Desitop PHP Version O Use def adt PHP settings Use project specic settings PHP Version PHPS 1 PHPS 2 4 Project Layout Use project as source folder Create separate folders for source files and public resources JavaScrot Support C Enable JavaScript support for this project Tick the box entitled Enable the Remote Web Site Browse for your location 433 Zend Studio 7 User Guide 6 Enter the following information Project name The required project name Contents There are three options Choose the one relevant to your needs Create a new project in the workspace Creates a new PHP project in the workspace directory Create a project from an existing source Creates a PHP project pointing to files situated outside of the workspace Click Browse to select
434. rol 42 50 125 249 SOUICE DD See setececscesaeaienetavacseandeatee 202 SQL Connection sses 301 SQL Databases seese eeen 301 304 SOL OU eege beneit eege ebe 312 SQL Results view aseene 304 SQL ecrapbook 312 e TEE 106 Stack trae ken 512 SUNOS yee ene eee 106 Gubverslon 50 126 SUDVEMSIVE E 257 GAN ENEE a 50 126 SVN CONNECTION ceeeeeeeteeeeteeteeeeeeeee 257 SVN repoeitonm seses 258 260 265 SVN Repository Exploring s eesseeseeee 258 SVN Repository Exploring Perspective 126 SVN Gebuer ees EES EAR 258 652 Syntax Colortmg 105 Syntax Coloring Javatcrgt 467 Syntax Coloring preferences 612 syntax element 105 T NEISTE 304 table content aarete 306 Task Tags preferences ceeeeeeeee 614 TeaM nai EEN 256 265 Team Environment 125 Templates nca aa 224 Templates Preterences ee 616 Re 77 155 Test Reports ccceceeeceeeseceeeeeeneeeeeseneeees 77 Test Suite iiuair retena 77 155 tooli oea e eae 114 Total Execution Time eee 70 Total Request Tme 70 Total Time e a a a ENN 70 UE 636 trace data 154 198 199 trace data source open 202 WAGE isinisisi aiiai piaia 636 tracer listener sseesieesrrssrrreerrrnnsenn 636 tracer Drelerences 636 iracmg Code orris ieiet 636 Tunneling ooeec 149 352 354 356 tunneling ICON ee eeeeeeeeeeeeteeeeeenaeeeeeenee 356 Tunneling server 352 Type Hierarchie 118 235 Type Hierarchy view 507 types Jav
435. rson construct F Person php 0 01 0 06 Person printData P Person php 0 05 0 28 H Person printDate IE Person php 0 01 0 04 Person printData 181 Person php 0 01 DO Right clicking a function in the list gives you the option to View Function Call Opens the selected function call in the editor View Function Declaration Opens the selected function declaration in the editor Open Function Invocation statistics Opens a view with statistics about the selected function the functions which the selected function was invoked by and the functions invoked by the selected function 506 Reference Execution Flow view Toolbar Commands e Wane Beseipfon e Expand Collapse Expands collapses the list all Show as Toggles the view to show your times in seconds or Percentage percentages or by Duration Time 13 Sort Profile Click the arrow next to the Profile Session to sort the Profile Sessions Session list by the Order in which the functions were executed The Execution Flow view is displayed by default as part of the Profiling Perspective To manually open the view go to Window Show View Other PHP Profiler Execution Flow 507 Zend Studio 7 User Guide Code Coverage Summary View The Code Coverage Summary view displays a summary of the lines of code that were covered during the Profiling process It contains the following columns Element The file project that was calle
436. running a file using external tools Organize Favorites Opens a dialog allowing you to organize your external SS Ls tools See the External ToolsExternal Tools topic in the Workbench User Guide for more information Launches a Debug session for a specified URL Launches a Profile session for a specified URL Debug URL Profile URL 539 Zend Studio 7 User Guide Navigation Submenu The Navigation submenu is available under Window Navigation from the Menu Bar The options available under the Navigation submenu are Description Show System Shows the system menu for the active view This contains Menu options on how the view is displayed Fast View Detached Restore Move Size Minimize Maximize Close Show View Ctrl F10 Shows the active view s menus containing functionality for Menu each view Quick Access Oe D o Gives you quick access to a range of Eclipse options Maximize Toggles between full screen and minimal views Minimize Active View or Editor Activate F12 Switches to the editor view Editor Next Ctrl F 6 Switches to the next previous open editor Previous Ctrl Shift F6 Hold down the Ctrl key and press F6 to scroll between the Editor editors This command is similar to the Alt Tab functionality in Windows Switch to Ctrl Shift E Opens a dialog displaying all the open editors Allows you es omens re o Next Ctrl F7 Switches to the next open view Previous View Cit
437. rver Working with SVN 47 Zend Studio 7 User Guide Creating Projects and Files The purpose of this tutorial is to guide you through the steps involved in creating PHP Projects and files Contents Creating a PHP Project Creating a PHP File Creating a PHP Project S To create a new PHP Project CC 1 Go to File Menu and select New PHP Project Or In PHP Explorer view right click and select New PHP Project 2 The New Project wizard will open Enter a name for your new project into the Project Name field 3 Click Finish to complete the creation of your project The new project will be listed in PHP Explorer view 48 Getting Started Creating a PHP File Creating a PHP file within Zend Studio will automatically add PHP tags to the script and allow you to fully utilize Zend Studio s PHP functionality w To create a new PHP file within a project 1 In PHP Explorer view right click your project and select New PHP File or select your project and go to File Menu New PHP File Enter the File Name and click Finish An editor window will appear with the following basic PHP code 1 lt php 7 gt Add your code to the new file Save the file by clicking the Save button Li on the toolbar To complete your project create more PHP files by repeating steps 1 7 y To create a new PHP file outside of a project 1 3 4 E An editor window will appear with the following basic
438. rver is installed 1 Open your Zend Server GUI This can be done from within Zend Studio by selecting the server on which you have configured your Zend Server integration from the drop down list next to the Zend Server icon on the toolbar gi 2 Go to the Server Setup Debugger tab dt Monitor EI Ruste Management A Server Setup amp Administraton Components Extensions Directives Debugger Monitor Allowed Zend Studio Clients for Debugging xi Exact IP address only Current list of allowed hosts 127 0 0 1 wm CM 172 16 0 0 12 LLLI Denied Zend Studio Clients tor Debugging Exact IP address only Use this list to exclude specific hosts from the allowed hosts list 3 Ensure the address of your Zend Studio is included in the Allowed Hosts sections To add an address to the list i Under the Allowed Zend Studio Clients for Debugging category enter the IP of the machine on which your Zend Studio is installed 337 Zend Studio 7 User Guide ii Click Add The IP Address is added to the Allowed Hosts list iii Ensure your Studio s IP address is not in the Denied Hosts list If it is click Remove next to the required address to remove it from the list iv Click the Restart PHP button to apply your settings If only the standalone Zend Debugger is installed on your server 3 338 To configure your debugger to allow your Zend Studio to debug 1 2 Open your php ini file Edit the zend_debugge
439. s TR Profiter Information 3 Execution Statistics Z Execution Flow IS Code Coverage Summary ZS GE JE ei EE 3 ee epee Function Cals Count Average Own Time Own feel Others Time s Total time s Si P tryPerson php 0 180701 map 1 0 180701 0 180791 0 036728 0 267429 z F Person php 0 086728 D Person 0 086722 _corstruct 3 0 028747 0 086240 0 000116 0 086356 geid 3 0 000004 0 000013 0 000000 0 000013 setFirstName 3 0 000016 0 000047 0 000000 0 000047 getirsthiome 3 0 000003 0 000009 0 000000 0 000009 setlatName 3 0 000005 0 000016 0 000000 0 000016 getLasthiame 3 0 000003 0 000010 0 000000 0 000010 stag 3 0 000006 0 000017 5 000000 0 000017 M ntina 3 N ANNAS nN AA nanan GO Si Click the Show as percentage button on the toolbar to see the statistics as percentages rather than times Execution Flow Shows the flow of the execution process and summarizes percentages and times spent on each function Function Function name File The file in which the function is located Total Execution Time Percent of time taken per function Duration Time Time taken per function In milliseconds re erop T7 exec Statisties Remi e T3 Code Coverage geen 8 5 e n Fle Function Total Execution Time Duration Time ms man IP tryPerson php 48 8 267 43 man F Person php 0 0 0 01 S Person __construct F Person php 15 73 65 24 o PersoniisetFirstName F
440. s Field Assist Help Install Update PHP Appearance Code Coverage Code Gallery Code Refactor 4 Code Style Debug Editor New Project Layout PHP Executables PHP Interpreter PHP Libraries PHP Manual PHP Servers PHPUnit Semantic Analysis Propert Zend Guard Remote Systems RSS Atom Channels Run Debug Server Tasks Team Validation Web Web Services e iv Semantic Analysis Properties Snftosre Porec Soene Settings Enable Semantic Analysis Select the severity level For the Following Semantic Analysis warnings Compile Errors Duplicate PHP element declaration in same file Duplicate PHP element declaration in file hierarchy Class element visibility reduce Unimplemented abstract methods e Potential Programmer Problems Undefined local variable Undefined Function Undefined Field slaw check Undefined method slow check Undefined class or interface Assignment in condition e g if a b Assignment has no effect e g a a Bad escape sequence in string Restore Defaults Apply Error el Ignore ei Error W Error po v warning i a ei Warning y Ignore Je warning x Warning e 613 Zend Studio 7 User Guide my To enable and configure Semantic Analysis for all projects 1 Mark the Enable Semantic Analysis checkbox 2 Select the severity level displayed in error messages warning ignore or
441. s Hover Support Hovering over an element will cause a tooltip to appear with information about that element containing the location of its declaration and any additional information description parameters etc contained in the element s relevant PHPdoc comment i This function mutliplies public function multi lyi a b return a Location Demo Project Calculator php i Class public function Calculator if b nul throw ne Description This Function mutliplies Press F2 for focus return a ees i by zero Holding down Ctrl while hovering over an element will also show you everything contained within that element public function eddi a b return Set b public function multiply a b return fat Jpupiic function multiply a b return a b public function if b n throw ne return Sai Press F2 For focus When hovering press F2 for the Hover tooltip to come into focus This ensures that it is displayed even when not hovering and enables you to select the text from within it Clicking on an element while hovering will take you to that element s declaration See Using Smart Goto Source for more information 129 Zend Studio 7 User Guide Configuring Hover Preferences To configure your hover settings go to the Hover Preferences page accessible by going to Window Preferences PHP Editor Hovers Hovering will also be enable
442. s automatically detect your Zend Studio Debug settings 6 Click Save 7 Restart your Web server for the settings to take effect 419 Zend Studio 7 User Guide Defining Zend Server in Studio Integration of Zend Server with Zend Studio allows the appliance of Zend Studio functionality Profiling Debugging etc to Server Events as well as allowing access to Zend Server s Event list Before configuring Zend Server in Zend Studio Zend Server must be installed and running S To define Zend Server di 9 Open the PHP Servers Preferences page by going to Window Preferences PHP Editor PHP Servers Click New to create a new server with Zend Server Integration or select an existing server and click Edit to add Zend Server integration to a previously configured server A PHP Server Creation dialog will open Configure the server as described in the PHP Server Preferences page enter the Server s name and document root s URL Click Next If necessary define Path Mapping See Adding a Server Location Path Map for more information Click Next A Zend Server Integration dialog will appear Mark the Enable Zend Server Integration checkbox to enable Zend Server Integration features tInsert the desired Zend Server GUI URL suffix and Port Number Leaving the Use default checkbox marked will create a URL in the format lt server s document root gt ZendServer gt If necessary unmark the checkbox to edit the suffix
443. s Options launched Configure Code Assist preferences Mark Configured the Mark Occurences settings Occurrences Configures the behavior of whitespaces after saving Syntax Coloring Set the font color for different elements Task Tags Add and edit tasks tags Define and create templates for content assist yping Configure which items should be automatically completed Zend Framework Configure display settings for the Zend Tool Floating Window and Console 550 Reference New Project Configure the default project layout for new PHP projects ayou r L t PHP Executables Add remove or edit PHP executables definitions PHP Interprete Select the PHP version PHP Libraries Add remove or edit PHP user libraries PHP Manual Add PHP Manual sites PHP Servers Add and edit PHP servers PHPUnit Configure PHPUnit s Library path and port Semantic Configure the severity for error and warning messages in Analysis different cases Zend Guard Set Zend Guard s location 551 Zend Studio 7 User Guide PHP Preferences Page The PHP Preferences page allows you to configure the hierarchy display in PHP Explorer view and set double click behavior The PHP Preferences page is accessed from Window Preferences PHP PHP P General settings for PHP development Action on double click in the PHP Explorer Go into the selected element Expand the selected element wi To configure PHP Preferences 1 Selec
444. s classes and methods in your code This helps both the developer and others who might look at the code to understand its purpose Comments can be either single line or multi lined Single lined comments will have the following format This is a single line comment Multi lined comments will have the following format This is a comment on multiple lines a Code Commenting will also be available for JavaScript elements if JavaScript support was enabled for the project See Enabling JavaScript Support in PHP Projects for more information 126 Concepts phpDoc Block Comments Zend Studio offers a preset means for adding phpDoc comments to files by providing an input line when including statements classes class variables and constants to the code Developers are prompted to immediately add a description ensuring that the added elements are documented in their context and in real time phpDoc blocks are descriptive comments that are part of the application code They are used to describe the PHP element in the exact location in the code where the element appears The block consists of a short description long description and phpDoc tags Example When creating a phpDoc Block commen for the following function function add Sa b cerura Sel Slop the following comment will be created kk Enter description here param unknown_type a param unknown_type b return unknown
445. s 467 471 JavaScript library jQuery ee 467 JavaScript library Prototype 010010aan 467 JavaScript Mark Occurrences 467 487 JavaScript Open Type seese 489 JavaScript support enable 05 467 JavaScript support PHP project 467 JavaScript Syntax Coloring 467 485 JavaScript Ivpes 467 JDBC connection profile eee 301 jQuery JavaScript Ibrary 467 JSDOG writen Gein ie irene 467 K KOYMADS serosa E AA A 194 L ler 143 library JavaScript e eee eeeeeeeeeeeeeeeees 467 listener trace oe eee eeeeeeeeeteeeeeeeteeeeeeteeeeee 636 loading time eee eee eee eeteeeeeeteeeeeenaeeeeeenes 70 Local Copy 132 Local Debugoomg 132 Local History 0ceeeee 124 245 246 649 Zend Studio 7 User Guide Locally Debugging PHP Scripts 57 M MANAGE EE 199 636 Manage DO 636 EINEN 120 Mark Occurrences s e 108 239 Mark Occurrences JavaScript 467 Matching Brackets AA 107 MatChing pair 107 MEMOTLY iSSUC 0 00 ee eeeeeeeeeeeeeeteteeeeeeeeeeeeees 154 memory performance iSSUC eee 154 MINUS sign 227 e RE 127 276 Move nsssasssesseessreesreesreesn 67 157 401 408 Moving Eileen 408 MVO esi sia Rie 127 MVC Outline view ssassn 127 N INA Tis E 149 New PHP ie 35 181 182 New PHP Prolect A 35 news feed 164 Number of Files AA 70 o DEE e E E T 198 202 Open Debug dialog 57 Open JavaScript Types
446. s Platform please see the Data Tools Platform User Documentation Additional user guides can be accessed from inside Zend Studio by going to Help Help Contents or from the Eclipse Online Documentation site http help eclipse org ganymede index jsp 301 Zend Studio 7 User Guide Viewing and Editing Table Content This procedure describes how to view data from a table located in your database and edit its contents To view and edit table content 1 Open the Database Development perspective by going to Window Open Perspective Other Database Development 2 Connect to your Database by following the steps in the Connecting to a Database topic 3 In Data Source Explorer view double click the required table or right click it and select Data Edit The table will open in a database editor displaying all the data within the table E getToc php GE 2 customers X customerNumber customerName contactLastName V contactFirstName VARCH Atelier graphique Signal Gift Stores Mi La Rochelle Gifts Baane Mini Imports Mini Gifts Distrib Havel amp Zbyszek Blauer See Auto Mini Wheels Co Land of Toys Inc Euro Shopping volvo Model Rep Danish Wholesal meee dae A liemu 4 Select a cell to edit its contents Schmitt King Ferguson Labrune Bergulfsen Nelson Piestrzeniewic2 Keitel Murphy Lee Freyre Berglund Petersen Par rnlaes Carine Jean P
447. s accessed from Window Preferences PHP PHPUnit 7 PHPUnit or ne PHPUnit Library Path I Communication port 7478 Collect Code Coverage statistics Create XML File Transformed XML Output C Documents and Settings Zend workspaces Default Restore Defaults The PHPUnit Library Path displays the location of your PHPUnit Library These settings cannot be changed w To configure your PHPUnit settings 1 Set the communication port which will be used when PHPUnit Tests are run The default port number is 7478 Ensure that the selected port is not already in use 2 Mark the Collect Code Coverage statistics checkbox to enable code coverage while running unit tests 3 Mark the Create XML File checkbox to enable XML file generation and click Browse in the Report Location option to select the location in which they will be created XML files can later be generated into reports from the PHPUnit Test results view by clicking See Reporting on PHPUnit Test Results for more information 4 Click OK to apply your settings 612 Semantic Analysis Preferences The Semantic Analysis feature enables warning and error messages to be displayed when Zend Studio detects possible errors or problems in your script Reference The Semantic Analysis Preferences page is accessed from Window Preferences PHP Editor Semantic Analysis Properties DW Preferences a General Data Management Dynamic Language
448. s all user defined Classes Functions and Constants Content Assist will also be available for JavaScript elements if JavaScript support was enabled for the project See Enabling JavaScript Support in PHP Projects for more information Using elements within the same scope Elements within the same active project file or function will be available for use with Content Assist Examples a Variables within a function will be added to the Content Assist list when the cursor is within that function Elements defined within one file will be available in the Content Assist menu in other files within the same project 114 Concepts Function Parameter Hints When entering a function call a Function Parameter Hint box will be displayed detailing the types of parameters which should be entered within the parentheses of the function call Example lt php striing name mixed value bool optional case_insensitive null define gt If the Function Parameter Hint box is not displayed automatically place your cursor between the parentheses and press Ctrl Shift Space Content Assist for Include Statements Content Assist can be activated for require and include calls to call files contained within the same project Inserting quotation marks between the parentheses of an include require call will cause the Content Assist window to display the files available for the function Selecting a file will complete the
449. s below this level will be folded into it You can continue to fold until all levels have been folded into the topmost level 2 To unfold nested functions click on the plus sign The folded code will open in the same order that it was folded 1 lt php 2 function abe II 39 function def ii d function ghi 5 6 E 5 2 gt Nested Function Folding Line numbers are folded together with the code Folding and unfolding does not change line numbers it can only hide display them If the folded code contains an error the displayed window will be syntax highlighted on both the left and right Annotation bars Tasks Searching for PHP Elements Searching for PHP elements is a functionality that allows you to search for PHP elements with your defined specifications PHP elements are classes functions and constants that are used in your code Use this option if you want to locate one of these elements in your workspace project or in a single file For information about the Search tab in the Search dialog read below To learn more about the additional tabs in the Search dialog see File Search in the Workbench User Guide If you are using the Remote Search option be aware that it does not search all of the resources of the remote server This procedure describes how to search for PHP elements classes functions and constants within your files and projects si To search for a PHP element 1 From the Menu Bar
450. s displayed New PHP Class Source Folder MyProject My Folder create New Fle Gewfile php O Add in existing File Class Name Modifiers none Ofna O abstract Superdiass Interfaces Which methods stubs would you like to create Constructor D Destructor Clinherted abstract methods Which comments would you like to create Generate PHPDoc Blocks Cl Generate T0005 29 Zend Studio 7 User Guide 2 Enter the required details and click Finish The new class interface will be created with the required code Write Code Manually type code in your files As you type content 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 Content Assist window does not pop up automatically press Ctrl Space lt php det gt a default oF DEFAULT_INCLUDE_PATH CF detinelstiing name mixed value boolloptior detine_systog_vatiables void detined string name bool 30 Getting Started Rename Elements Refactoring 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 The refactoring feature also gives access to a range of other functions such as move file and extract variable See the Refact
451. s in the Connecting to a Database topic 3 Click the Open Scrapbook icon on the toolbar A new SQL scrapbook will open a A gt Connection profie Type MySqi_5 0 n Name DefaultConnection 1 w Database Status Connected Write your query in the scrapbook e g select from mytablename To execute your query right click anywhere in the editor and select Execute All or press Ctrl Alt X To execute only specified queries highlight the relevant lines right click and select Execute Selected Text The query will be run and the results will be displayed in the Result1 tab in the SQL Results view The left pane displays the execution history For each statement that you execute including stored procedures an execution history entry is added to this pane This allows you to quickly retest the execution using slightly different values and settings You can rename or delete the launch configurations as needed Osaren ii xk AoD D type query expresson here Sens Pea t Ras Opas Oste Corredo astomahimba customerNene cokadia contectfestiieme phon A v Zeeche DOT 2 MyConnection ge at 4 2 112 Sol Gt Sores rg Jan JO 3 i eh Ferman Peter oa 4 ns a ertai Gis lave lwee Ka lt gt gt tota 50 records shown 306 Tasks For more information on the Data Tools Platform please see the Data Tools Platform User Documentation 307 Zend Studio 7 User Guide Running Files and Applications The follo
452. s will be listed first in the launch configuration list Clicking the External Tools Button opens the External Tools Configuration dialog Clicking the arrow next to the icon gives access to the following options Run As If applicable allows you to run the file using External tools External Tools Configurations Opens the configuration dialog for running a file using external tools Organize Favorites Opens a dialog allowing you to organize your external tools See the External Tools topic in the Workbench User Guide for information on configuring your Builder Additional user guides can be accessed from 547 Zend Studio 7 User Guide Shortcut Description Keys inside Zend Studio by going to Help Help Contents or from the Eclipse Online Documentation site http help eclipse org ganymede index jsp Gel Debug URL Launches the Debug URL dialog LL Profile URL Launches the Profile URL dialog i E Launches the Search dialog j v K Ctrl Next Previous Navigates to the next previous annotation in Ctrl Annotation the script Possible annotations are Bookmarks Diff additions Diff changes Errors Info Search Results Spelling Errors Tasks and Warnings Click the arrow next to the next previous annotation icon on the toolbar to configure which types of annotations should be included LS Ctrl Q Last Edit Jumps to the last location that was edited Location Alt Left Back forward to S
453. se reliability and comprehensive performance features organizations need for business critical applications See Zend Server Integration for more information About Zend Opens the About dialog displaying information about the Studio current version of Zend Studio 544 Reference PHP Perspective Main Toolbar The PHP Perspective s Main Toolbar offers shortcuts to frequently used functionality Cie Mol yS O B Q BA law s Eirmor a Shortcut Description Keys Opens the New Wizard dialog Clicking the arrow next to the icon lets you select to create a new Zend Framework Project PHP Project Project Zend Module Zend Controller Zend Model Zend View PHPUnit Test Case PHPUnit Test Suite PHP Class PHP Interface Remote Folder PHP File Folder CSS HTML XML Example Project or Other resource eo an len Saves the active file poe Cl foe l the active file ee ae Untitled Ee a new untitled PHP Document PHP Document Create New Opens the New SQL Connection dialog SQL Connection Ti lee PHPDoc Zend Server Displays the Event List for the configured Event List Zend Servers Clicking the arrow next to the icon allows you to select the required Zend Server See Zend Server Integration for more information 545 Zend Studio 7 User Guide Shortcut ee Keys the Debug Button executes the last run configuration Clicking the arrow next to the icon gives access to the following options
454. se elements C classes C Functions PHPDoc w To configure your code folding preferences 1 Mark the Enable folding checkbox to enable code to be folded 2 Select which off the following elements should be folded by default by marking the relevant checkboxes Classes Functions PHPDocs 3 Click Apply to apply your settings 581 Zend Studio 7 User Guide Hovers Preferences The Hover functionality will display information about an item when the mouse is placed on it The Hovers preferences page allows you to configure the settings and shortcuts for the Hover functionality The Hovers Preferences Preferences page is accessed from Window Preferences PHP Editor Hovers Preferences g Preferences r Hovers A General a siia aS Text Hover key modifier preferences Field Assist Text Hover Name Pressed Key Modifier While Hovering Help M Combined Hover Install Update C variable values Zend Debu PHP C Variable values xDebug Appearance m Problem Description Code Coverage 4 age Code Gallery ource r Code Refactor o Annotation Description Code Style Debug Editor Paha Pressed key modifier while hovering Code Folding CS Hovers Description Mark Occurrences Save Actions N prai c ei mene oad Restore Defaults Apply The Text Hover key modifier preferences table allows you to modify hover key preferences for certain elements P
455. se to change 3 Enter the Helper s Prefix 4 Enter the Helper s name This will be the name of the Helper file The Helper s class name will be automatically created in the format lt Helper s Prefix gt _ lt Helper s Name gt Click Next In the Select PHP Template dialog ensure the New Zend View Helper template is selected 7 Click Finish A new Zend View Helper file will be created with the relevant template This includes phpDoc block comments which help Zend Studio to recognize that the element is a Zend View Helper Zend View Helper phpDoc block comments must be in the format kk lt Helper s_Name gt helper Ka uses viewHelper lt Helper s_Prefix gt y All Zend View Helpers in your project which are correctly commented will be available in the Content Assist list in a Zend View file This includes the default Zend View Helpers included in Zend Framework s libraries 288 Tasks In addition pressing Ctrl and clicking on a Zend View Helper defined in a View file will take you to the Zend View Helper s declaration E login php i 2 3 lt php TP MyHelper1 pho this gt myHelver gt publ a function myHelper i f TODO Auto generated Zend Viev_ Helper MyHelper myHelper helper return null 289 Zend Studio 7 User Guide Creating a Zend Action Helper Zend Action Helpers provide an easy way of extending the capabilities of Action Contro
456. see Working with Remote Server Uploading a Project to a Remote Server This procedure describes how to upload a project to a remote server This allows you to share your project through your remote server Before you can share your project to a remote server you must have already created a remote server connection Once you have defined a connection you can share your local project to a connection w Uploading a project to a Remote Server 1 Right click on the shared project in the PHP Explorer view 2 From the right click menu select Team Upload to Server Your project will be uploaded to the remote server Once you have uploaded a project to the remote server other users have the option to download the project from the server and edit it 441 Zend Studio 7 User Guide Importing Actions This procedure describes how to import resources from another location Before importing you must have already created a remote server connection and synchronized the project that contains the resource s To import resources w i 1 Select the resource s in the Synchronize View 2 Right click on the resource and from the right click menu select Import The resource s will appear in your workspace You can also import resources via PHP Explorer 1 Select the resource s in PHP Explorer 2 Right click on the resource and from the right click menu select Import The resource s will appear in your workspace 442
457. select Debug As PHPUnit Test Lor from the Main Menu go to Run and select Debug As PHPUnit Test w The unit test will be run and a PHP Unit view will open As the test is run the parameters you have configured will be entered into the relevant functions in the Calculator file to test whether the correct result is outputted according to the expected results you specified Four tests will be displayed one for each calculator function which should have passed successfully as indicated by the green tick icon val Note that the other three functions divide multiply and subtract will have passed 95 Zend Studio 7 User Guide 96 ile but will have a note indicating that they have not been implemented This is because you have not yet specified the testing parameters 10 Repeat steps 1 6 above for the remaining functions entering suitable parameters in the format Sthis gt assertEquals this gt Calculator gt subtract divide multiply x wi zi Select each required operation subtract divide or multiply and enter variables where x and y are the two parameters which will be entered into the calculator and z is the expected result 11 Run the Unit Test again by clicking the Run Last Test button H in the PHPUnit ch view and check that all the tests have passed successfully Tests can be written in alternate ways So for example Sthis gt gt asserthquals Sthis gt Caleulator gt add
458. ser Toolbar in order to be able to debug profile Configuring the Zend Browser Toolbar In order to be able to debug files and applications through the Zend Browser Toolbar you must configure the toolbar to communicate with Zend Studio Toolbar debugging is a form of remote debugging and so remote debugging to the server on which your files are located must also be configured in Zend Studio and the Zend Debugger See Setting Up Remote Debugging for more details This procedure describes how to configure the Zend Browser Toolbar to be able to communicate with Zend Studio S To configure connectivity with Zend Studio 1 From the Toolbar go to Extra Stuff Settings The Zend Toolbar Settings dialog will be displayed Zend Toolbar Settings General Enable Search Toolbar Debug Session Settings I7 Detect Zend Debugger Debug Local Copy H avaiable 4 Break on the First Line Zend Studo Settings Zend Studo Executable C PiogamFiesZend Zer Browse G Auto Detect Settings Je Zend Studio Broadcasting Pat 20080 F Manual Settings Zend Studio Debug Pott pe Zend Studio IP Address rage ri 331 Zend Studio 7 User Guide 332 2 Inthe Zend Studio Settings category configure the Zend Studio Debug Port and Zend Studio IP Address These settings should match the settings defined for the Zend Debugger in the Installed Debuggers Preferences page Zend Debugger Settings Zend Debugger Debug Port 10137 Run with Debug In
459. sert new line before while in a do statement si F b class Example ay function bert C keep then statement on same line do Cl Keep simple F on one line while true else stat try Leg else on sate ine catch Exception Ze 2 Keep else P on one line C Keep return or throw clause on one ine function foo if true return if true return 7 This is a buit in profite yo ame after dosing this dialog e B2B 567 Zend Studio 7 User Guide The Control Statements tab contains the following options General Insert new line before else and elseif in an if statement Insert new line before catch in a try statement a Insert new line before while in a do statement if else Keep then statement on same line Keep simple if on one line Keep else statement on same line Keep else if on one line Keep return or throw clause on one line Line Wrapping The Line Wrapping tab allows you to configure Line Wrapping properties Edit Profile a EE Inderkation Braces White Space Blank Lines New Lines Line Wrapping Lre wadh and indentation bevels Maxmam ine wath 300 2 Dei ah indentation foe wrapped ines Dei ah indertation for array nRiakrers class Example implements Ii I2 13 eplements clause Method Declarations Parameters Function Cals Arguments Ob
460. server It allows you to profile whole applications and projects The PHP Web Page Profile setting has an option to give the files you are working on first priority when profiling using the Local Copy option This means that when possible file content is taken from the files situated on your Workspace This prevents you from having to upload the latest revisions It s recommended that your local project structure reflect the project structure on your server See Profiling a PHP Web Page for more information Your server must be running the Zend Debugger or XDebug in order for remote debugging and profiling capabilities to function The Zend Debugger comes bundled with Zend Server Zend Core and Zend Platform but can also be downloaded as a separate component from http www zend com en products studio downloads URL Profiling Allows you to enter a URL to profile an application on a server Only server files will be profiled so the files do not need to exist locally in your Workspace See Profiling a URL for more information Once a Profile session has been executed see Using the Profiler for more information on how to execute a profiling session various views in the Profiling Perspective provide information on the performance of your script See PHP Profile Perspective for more information on the various views Toolbar Profiling Profile files and applications directly from your browser See Profiling U
461. ses its own PHP executable that was installed together with Zend Studio See Locally Debugging a PHP Script for more information PHP Script Remote Debugging Allows you to debug files on your workspace using your server s Zend Debugger This allows you to debug local files using the Zend Debugger situated on your server This allows you to test your files with the production environment and allows you to utilize the extensions installed on your server See Remotely Debugging a PHP Script for more information Your server must be running the Zend Debugger or XDebug in order for remote debugging and profiling capabilities to function The Zend Debugger comes bundled with Zend Server Zend Core and Zend Platform but can also be downloaded as a separate component from http www zend com en products studio downloads 146 Concepts PHP Web Page Debugging Allows you to debug applications situated on a server It allows you to debug whole applications including any required interactive user input The PHP Web Page Debug has an option to give the files you are working on first priority when debugging using the Local Copy option This means that when possible file content is taken from the files situated on your Workspace This prevents you from having to upload the latest revisions It s recommended that your local project structure reflect the project structure on your server See Debugging a PHP Web Page for more
462. session or the PHP Profile Perspective topic for more on the information displayed once a Profile session has been run 214 Tasks Setting Up Zend Server Integration In order to debug events through Zend Server the integration between the Zend Server and your Zend Studio needs to be configured in both products See Configuring Zend Server Settings in Zend Studio and Configuring Zend Studio Settings in Zend Server for more information If you do not have access to the Zend Server on which the events were created you can use the Import Zend Server Event function to import and debug a pre created Zend Server event file Configuring Zend Server Settings in Studio Zend Server settings can be configured in Zend Studio in order to allow the appliance of Zend Studio functionality Profiling Debugging etc to Zend Server Events as well as allowing access to Zend Server s Event list Zend Server configuration can be done either automatically if the Zend Server is installed on the same machine on which Zend Studio is running or manually through the PHP Servers Preferences page Automatic Zend Server configuration Zend Servers installed on the same machine as Zend Studio are automatically detected and configured in Zend Studio To automatically configure a Zend Server The auto detection is triggered when Zend Studio is launched or when the Auto Detect Zend Server button is clicked For auto detection when Zend Studio is launched
463. sing the Zend Debugger Toolbar for more information Concepts Profiler Views Profiler Information view Provides general information on the profiling duration and date number of files constructing the requested URL and more In addition it displays a Time Division Pie Chart for the files in the URL The right side displays time division in a pie chart and the left side provides the following information URL The URL analyzed if applicable Query The specific query parameters Path The location of the first file called Total Request Time Total processing time for the entire page Number of Files Number of files processed Date Date and time that the profiling took place General Information v Tune Division Pie Chart URL Not Available Query debug_coverage adetug port 10137 Bstart_profie 1 Path C Documerts and Settings Aeren s Zend workspacesiDef auth Total Request Time ms 546 06 Number of Fles 2 Date Tue 24 03 13 11 05 IDT 2007 BD tryPerson php 180 7 ms 67 6 HI Person php 86 73 ms 32 4 151 Zend Studio 7 User Guide Execution Statistics view Displays the list of files that were called during the profiling process and detailed information on processing times for elements within the files The window contains statistics relevant to each element as follows Function The name and location of the function Calls Count The number of times that the function was calle
464. sitory enter the information required to connect to your CVS Repository See Configuring a CVS Connection for more information Click Finish Depending on your authentication settings a dialog might appear asking you to provide authentication information Re enter your password and click Next Mark the Save Password checkbox to ensure that this screen does not reappear A Commit dialog will open 6 Enter a comment if required and click OK Your project will be uploaded to the CVS repository Your project will now have a repository icon K next to it in PHP Explorer View indicating that it is linked to an CVS repository Once the project has been committed other team members will be able to access and edit it See Sharing a new project using CVS in the Workbench User Guide for more information 255 Zend Studio 7 User Guide Using SVN SVN or Subversion is a Source control system intended to allow a team or group to work on the same files and projects simultaneously and to be able to revert file and project states back to previous versions The following tasks describe some of the actions that can be done using Zend Studio s SVN functionality Configuring an SVN connection Importing a project from SVN Accessing an Existing SVN Checkout Uploading projects to SVN See the Subversive User Guide for more information on SVN Additional user guides can be accessed from inside Zend Studio by going to Help Help Con
465. sk Tags Properties Validation Properties HTML Syntax XSLT Validation WikiText Properties pages are configured for a specific project only To configure settings for all PHP projects go to the PHP preferences pages Window Preferences PHP 618 Reference Resource Properties The Resource Properties page displays information about your project and allows you to set the project s text file encoding and line delimeters To access the Resource Properties page right click a PHP project in PHP Explorer view and select Properties Resource or select the project and from the menu bar go to Project Properties Resource Resource gt Path MyProject Type Project Location C Documents and Settings keren s Zend Workspaces Def aut Workspace MyProject Last modified May 12 2008 6 10 24 PM Text fla encoding inherited from container Cp1252 Other New text file ine delimiter G Inherited from contamer Other Restore Defauks Apply Les Ice The following information is displayed in the Resource Properties page Path For PHP Projects this will be the project s name If a file inside a project was selected this would display the file s location within the project Type For PHP Projects this will be Project Location The project s location on the file system To configure PHP project resource properties 1 Select options for Text File encoding By d
466. sked whether to open the Team Synchronizing perspective Check the Remember my decision box to prevent this prompt from appearing in the future A Text Compare dialog will open showing the local file you have just made changes to in the left hand window as compared to the file in the repository in the right hand window The change you have made will be highlighted 66 Getting Started P Text Compare I fa Ps Remote File 106 Los lt php In addition the Synchronize view will have opened in the left hand side displaying the file to D which you have made changes The file will have a grey arrow icon e indicating that changes have been made which need to be synchronized with the repository Committing Changes Once you have edited your file and compared it to the one in the repository to ensure that the changes are correct you can commit your changes w To commit your changes to the repository 1 From the Synchronize view click the Commit All Outgoing Changes 3 button Or In PHP Explorer View right click your file and select Team Commit 2 A Commit dialog will open Enter the comment I have made changes to SVNFile and click Finish Your changes will now be committed to SVN and all users will be able to access the file 67 Zend Studio 7 User Guide Replacing Files with Older Versions Using SVN s version control system you can revert back to older versions of files if incorrect
467. so add it to your PHP Include Path of the project in which you would like to have it available For more information see Configuring a Project s PHP Include Path 605 Zend Studio 7 User Guide PHP Manual Preferences The PHP Manual preferences page sets the location of sites which allow you to access and view the PHP Manual and allows you to add edit or remove sites The PHP Manual contains an explanation of PHP functions PHP Manuals can be accessed online or locally from within Zend Studio in order to provide an immediate explanation of the functionality and proper use of all PHP functions The PHP Manual Preferences Preferences page is accessed from Window Preferences PHP PHP Manual Preferences PHP Manual Sei PHP Manual Sites Site Name URL File Extension Local file C Program Files Zend Zend html PHP net http www php net manual en php Edit Zend site http fwww zend org manual php Default Open PHP Manual in new browser window S To add additional sites to the list 1 Click New 2 Enter the Name of a site allowing access to the PHP Manual and its URL Local Directory location or Windows CHM File location 3 Choose whether its file extension is php htm or html 4 Click OK Your new site will be added to the list See the PHP Manual Integration topic for more information Mark the Open PHP Manual in new browser window checkbox to select that each request to open the manual
468. st D 66 gt function printMessage fmessage EK echo lt hr gt lt strong gt lt em gt message lt em gt lt strong gt lt hre gt 70 if isset GET degrees ss isset _GET convecsion 72 73 gt lt body gt lt html gt Now that the root cause of the problem has been detected you can debug or browse your code to diagnose and fix the error 105 Zend Studio 7 User Guide Diagnosing and Debugging Errors On Zend Server Zend Server detects PHP errors in your code during run time and stores the information as events These events can then be debugged to diagnose the cause of the error re This procedure creates a purposeful PHP error event in order to demonstrates how i to debug and diagnose the cause of the error 1 106 In the same project as was created above create a new PHP file by right clicking the project in PHP Explorer view and selecting New PHP File Name the c to f_convert2 php and click Finish Copy paste the example code into the file See the Working with Zend Server Tutorial in Zend Studio s Online Help for the example code Save the file Run the application you created by right clicking the c to f_convert2 php file in PHP Explorer view and selecting Run As PHP Web Page The Run PHP Web Page dialog is displayed Ensure the URL in the Launch URL field points to the location of your file on Zend Server and click OK The applic
469. st Case you will now need to customize it by entering relevant parameters to be checked before being able to run your test w To configure and run your test case Te 2 In the CalculatorTest file expand public function test_add node Note that a function has been created but no parameters have been inserted You will have to manually enter the relevant parameters to be tested and the predicted results Delete the following code TODO Auto generated CalculatorTest gt test_add Sthis gt markTestIncomplete add test not implemented Sthis gt Calculator gt add parameters This is the default test which will return a test not implemented result if the test case is run Replace the above code with the following Sthis gt asserthgquals Sthis gt Calculator gt Sadd 1 2 3 The numbers 1 and 2 indicate that when the test case is run the parameters 1 and 2 will be entered into the add function in your Calculator file i e the test will try to add 1 2 The last number 3 indicates that the expected result is 3 If the result is something other than 3 the test will report a failure for this function Save the file To run the unit test click the arrow next to the Run button off on the toolbar and select Run As PHPUnit Test amp or go to Run Menu and select Run As PHPUnit Test Or to debug the PHPUnit Test Case click the arrow next to the debug button E on the toolbar and
470. st ensure the correct communication settings are configured in your Zend Server K To configure Zend Studio communication in Zend Server 1 Open your Zend Server GUI 2 Go to the Server Setup Debugger tab Allowed Zend Studio Clients for Debugging Exact IP address only Ge Current list of allowed hosts 127 0 0 1 10447 192 168 172 16 0 0 12 245 234 234 Remove Remove Remove Remove Remove Denied Zend Studio Clients for Debugging Exact IP address only ud Use this listto exclude specific hosts from the allowed hosts list 3 Ensure the address of your Zend Studio is included in the Allowed Hosts sections This will ensure you can debug profile Zend Server Events To add an address to the list i Enter the IP address or Net mask of the machine on which your Zend Studio is installed In Order to enter a Net mask enter a range by entering the beginning of an IP address and adding 0 instead of the rest of the number To make sure you are using Wildcards to specify a range of IPs select the pattern you want from the drop down list ii Click Add Your Zend Studio machine s address will be added to the Allowed Hosts list 4 Ensure your Zend Studio s IP address is not in the Denied Hosts list If it is click Remove next to the required address to remove it from the list 5 Inthe Zend ServerGUI go to the Server Setup tab Monitor and configure the following Auto detect the Zend Studio Client Settings Set to Om to
471. st that a code snippet you have created be added to a Code Gallery site 1 Open the Code Gallery view by going to Window Show View Code Gallery 2 Expand the User Code Gallery node and right click the code snippet you have created 3 Click suggest The Suggest to Code Gallery dialog will appear Sugeest to Code Gallery Code Gallery Zend Code Gallery ze Category Algorithms o 416 Tasks 4 Select the Code Gallery to which you would like to suggest your snippet from the Code Gallery drop down list Select the category to which you would like to associate it Click OK Your code snippet will be sent to the chosen site for consideration y To rate a snippet which you have downloaded from a Code Gallery 1 Open the Code Gallery view by going to Window Show View Code Gallery 2 Expand the relevant Code Gallery node and right click the required code snippet 3 Select Hate The Send your rating dialog will appear 1 Send your rating Rating 1 v 4 Select your rating for the snippet 1 being the lowest and 5 being the highest 5 Press OK Your rating will be sent to the relevant Code Gallery site 417 Zend Studio 7 User Guide Configuring Studio Communication Settings in Zend Server In order for you to be able to view debug and profile Zend Server Events in Zend Studio you must ensure the correct communication settings are configured in your Zend Server S To configure Ze
472. ster Your Zend Code Gallery list will be updated with all the code snippets from the Zend Code Gallery site divided into categories 415 Zend Studio 7 User Guide E Problems Z Tasks E Console Code Gallery ii S ag F STP type fiker text Details checkdigit modulo 10 User Code Gallery A Author 5 Zend Code Gallery Created Algorthms Last Update Anays Conversions Description Passwords 4 Serting Calculates the checkadigt cdv 10 for Greg either a integer or string value lt Cdv10 are often used in account numbers etc Chackisraet Teudat Zehut nun chopSenk Preview Corivert IP string XK YYY WA Convert to base 10 function cdv10 str SH CRC check sum Creating unique ids strings domain class v lt gt if is_string str S To add a Code Gallery site to the Code Gallery list 1 Open the Code Gallery preferences page by going to Window Preferences PHP Code Gallery or clicking the E Configure Code Gallery button on the Code Gallery view s toolbar 2 Follow the instructions under Adding a Code Gallery in the Code Gallery preferences help page To update your Code Gallery 1 Open the Code Gallery view by going to Window Show View Code Gallery 2 Select the Code Gallery which you would like to update fadi 3 Click the synchronize with site button _ Your code gallery list will be updated with all the latest changes from the Code Gallery site S To sugge
473. sting source Create project on a local server PHP Version Use default PHP settings O Use project specific settings Project Layout Use project as source folder O Create separate folders for source files and public resources JavaScript Support C Enable JavaScript support for this project S 2 2 Enter the following information Project name The required project name Contents Select whether to workspace directory By default a workspace will have been created in Confioure dofauk Create a new project in the workspace Creates a new PHP project in the Tasks user home Zend workspaces DefaultWorkspace7 when you first launched Zend Studio Create a project from existing source Creates a PHP project pointing to files situatued outside of the workspace Click Browse to select the required source content Create project on a local server Creates the project on a local server This option will only be available if a local Zend Server has been configured in the PHP Servers Preferences page PHP Version Select whether to e Use default PHP settings Uses the default PHP Interpreter settings e Use project specific settings Select the PHP version to be used for the project and whether ASP tags are used as PHP tags See PHP Version Support for more information Project Layout Select whether to e Use project as source folder All resources within the project will be added to th
474. superclass props dojc e delegate obj props TMP dojo e delegate obj props TMP dojo e deprecated behaviour extra removal voir deprecated void dojo wi lt il gt Dojo elements will also be displayed in the Outline view 472 SE Outline x IS R v Q Goba console dojo 0 dijk dojox JoadNotifying Boolean _postLosd Boolean Joaders Array uri scheme authority path query fragment im bD Bai bp ge IEI D Be 8s as Tasks Dojo requireModule The dojo view helper is intended to simplify setting up the Dojo environment and can be accessed from within Zend View files One of the methods available from the Dojo view helper is requireModule which sets up a require method Within Zend View files content assist options will be available to this method Example this gt dojo gt requireModule dojo of dojo data apl Identity dojo data api Notification dojo data api Read dojo data apt Request dojo data api Write dojo data ItemFaeReadStore dono data ItemFaeWriteStore dojo DeferredList dojo dnd Avatar dojo dnd Container doe dng Manager dote dd move boxConstrainedMoveable ei a Sn he em I 13 See hitp framework zend com manual en zend dojo view html for more information 473 Reference PHP Perspectives and Views Keymap PHP Perspective Menus Useful Links PHP Perspective Main
475. sword and click Next Mark the Save Password checkbox to ensure that this screen does not reappear A Commit dialog will open 9 Enter a comment if required and click OK Your project will be uploaded to the SVN repository Your project will have a repository icon K next to it in PHP Explorer view indicating that it is linked to an SVN repository Your can now perform all SVN functions commit update etc on this project See the Subversive User Guide for more information on SVN Additional user guides can be accessed from inside Zend Studio by going to Help Help Contents or from the Eclipse Online Documentation site http help eclipse org ganymede index jsp 262 Tasks Uploading Projects to SVN Using SVN you can upload projects and files for other team members to access and edit This procedure describes how to upload a project to your SVN repository location Prerequisites You should have an SVN repository configured before you follow this procedure See Configuring an SVN Connection for instructions KY To upload a project to an SVN repository 1 In PHP Explorer View right click your project and select Team Share Project A Share Project dialog will open From the repository list select SVN and click Next If you have not yet configured an SVN repository you will need to enter your SVN repository details See Configuring an SVN Connection for more information If you have already configured an SVN connection
476. systems System type be fiter text 3 Geer Eh FTP Only E toca Tk SSH Only 3 Use the New Connection dialog to choose the connection type by clicking on the location or use the Type Filter Text box The connection options are FTP Only Connect to the FTP access to remote systems Local Connect to your local file system on your computer SSH Only Connect to an SSH to access remote server 4 Click Next to define the system connection and enter the following details Parent Profile Your computer profile Host Name Host Name or IP address of the target system Connection Name A unique name that is attached to the profile Description Connection description that will help you to remember what this connection is 431 Zend Studio 7 User Guide Tick the Verify Host Name box if you want to validate your connection now Zend Server will attempt to connect to the remote server If the connection fails this can mean that the server is not available or the information entered is incorrect retry or Click Next to continue For FTP or Local connection types Click Finish to add your new connection For SSH connection types you will now have the option to set one of the following system checks SFTP Files Work with files on remote systems using the secure Shell SSH protocol SSH Shells Work with shells and commands on remote systems using the Secure Shell SSH protoco
477. t Document and Format Active Elements Refactor Edits names and locations of files and resources while maintaining the links between the files The Refactor menu options are Organize Imports Rename and Move Navigate Navigates through your scripts in order to find relevant resources information and text The Navigate menu options are 514 Reference Menu Description Option Go Into Go To Open Declaration Open PHP Element Open Resource Show In Next Annotation Previous Annotation Last Edit Location Go to Line Back and Forward Searches for text or PHP elements in your workspace The Search menu options are Search File and Text Carries out different functions on your projects The Project menu options are Open Project Close Project Build All Build Project Build Working Set Clean Build Automatically Generate PHPDoc Encode Project and Properties Gets maximum efficiency and accuracy from your files and projects through analyzing and testing your code using the Debugging Profiling and Run functionality The Run menu options are Toggle Breakpoint Toggle Line Breakpoint Toggle Method Breakpoint Toggle Watchpoint Skip All Breakpoints Remove All Breakpoints Run History Run As Open Run Dialog Debug History Debug As Open Debug Dialog Run Debug Profile Profile History Profile As Profile External Tools Debug URL and Profile URL Customizes your workspace display The Window menu options
478. t Script gt node in the outline view will select the entire lt script gt element in the Editor 461 Zend Studio 7 User Guide Using JavaScript Content Assist These procedures describe how to enable and configure JavaScript Content Assist options In order for JavaScript elements from libraries and files outside of the project to be made available for use in the Content Assist list you must enable JavaScript Support for the project and Set the JavaScript Build Path To access Dojo toolkit content assist options you must set up Dojo integration in the project while configuring the Build Path To access JavaScript Content Assist options 1 Type the relevant HTML and JavaScript tags lt HTML gt lt script type text javascript gt lt script gt lt HTML gt JavaScript Content Assist options will now be available Type the first few letters of the required element The Content Assist list will be displayed if the Content Assist list is not automatically displayed press Ctrl Space or go to your JavaScript Content Assist preferences page to configure your auto activation preferences 4 Select the relevant option from the Content Assist window by double clicking or pressing Enter 5 If you selected a JavaScript class type a period after the name of the class to display a Content Assist window with the classes relevant functions and methods lt HTML gt lt script type text javascript gt window lt scr
479. t are essential to optimizing the overall performance of your application Zend Studio includes five different profiling methods PHP Script Local Profiling Allows you to profile files on your workspace using Zend Studio s internal debugger The Internal Debugger enables developers to locally validate freshly developed code before deploying to a web server The internal option means that only files located in local directories can be profiled When profiling internal files the Zend Studio Internal Debugger uses its own PHP executable that was installed together with Zend Studio See Locally Profiling a PHP Script for more information PHP Script Remote Profiling Allows you to profile files on your workspace using your server s Zend Debugger This allows you to profile local files using the Zend Debugger situated on your server This allows you to test your files in the production environment and allows you to utilize the extensions installed on your server See Remotely Profiling a PHP Script for more information Your server must be running the Zend Debugger or XDebug in order for remote debugging and profiling capabilities to function The Zend Debugger comes bundled with Zend Server Zend Core and Zend Platform but can also be downloaded as a separate component from http www zend com en products studio downloads 149 Zend Studio 7 User Guide PHP Web Page Profiling Allows you to profile applications situated on a
480. t the required option Go into the selected element PHP Explorer view will display only a folder s contents once it is double clicked Expand the selected element PHP Explorer view will expand a folder once it is double clicked leaving the other projects and folders visible in a tree diagram 2 Click Apply to apply your settings 552 Reference Appearance Preferences The Appearance preferences page allows you to select whether to show PHP Elements method return types in the Outline and PHP Project Outline views These will be displayed in brackets next to the element Outine S PHP Project Outine 33 PHP Functions Sep Outline PHP Project Outline 52 PHP Functions So Zend_View_Helper_PrintDepartmentTree a S Zend_View_Helper_PrintDepartmentTree a printDepartmentTree array tree primDepartmentTree array tree string Zeta Department Zets_Department w getChidDepts getchiddepts array getDepartmertByName string name getDepartmentByNome string name Zets_Department e getDepartmentTreeRoot F getDepartmantTreeRoot array PHP Project Outline view without the method return types PHP Project Outline view with the method return display types display The Appearance Preferences page is accessed from Window Preferences PHP Appearance Preferences Appearance General amp Data Management Dynamic Languages E Show method return types Field Assist H
481. te to an element s declaration To use the Smart Goto Source function 1 Hover over the element whose source declaration you want to navigate to A tooltip will be displayed showing the element s original location lt php multiply Require Calculator H Location 22 Demo Project Calculator php Press F2 for Focus nb Go P Re Element with its source location 2 Hold down the Ctrl key and move the cursor until the element is underlined 3 Click the element You will be automatically taken to the element s source code If the declaration is in a different file this file will be opened Smart Goto Source will also be available for JavaScript elements if JavaScript support was enabled for the project See Enabling JavaScript Support in PHP Projects for more information 234 Tasks Viewing Type Hierarchies Type hierarchies can be viewed in either a Quick Type Hierarchy view or in the Type Hierarchy view Viewing Types in the Quick Type Hierarchy View To view a type in a Quick Type Hierarchy view 1 Select the type name in the PHP editor or PHP Explorer or outline views 2 Press Ctrl T Or from the Menu Bar go to Navigate Quick Type Hierarchy The Quick Type Hierarchy view will be displayed in the editor with the selected type lt php interface BE Type hierarchy of human public function setGender fgender public function getGender e eer K person class person imple
482. ted to save the file before closing Closes all open editor windows If there are unsaved changes in the file you will be prompted to save them before closing Saves changes made to the active file Allows you to specify the file name location when saving the active file Save Al Ctrl Shift S 516 Saves all open files all open files E the state of the active file back to its last saved version Moves the currently selected file to a different folder project Marking the Update References check box in the Move dialog will apply the refactoring feature which will automatically updates all references to the file in other files Click Preview to see all changes that will be made as a result of the move Click OK to implement your changes and move the file Reference Ca references to the file will be automatically updated to reflect its new location For more on moving files using the refactoring feature see Moving Files Rename Renames the currently selected file Marking the Update References check box in the Move dialog will apply the refactoring feature which will automatically update all references to the file in other files Click Preview to see all changes that will be made as a result of the rename Click OK to implement your changes All references to the file will be automatically updated to reflect the change For more on renaming files using the rename feature see Renaming a file
483. ted O private final Generate method comments i 5of8 selected 402 Tasks 4 Select Which variables getter and setter functions should be created for Expand the list under each function by clicking the icon in order to select to generate only a getter or a setter for each variable If your cursor was originally placed on a certain variable this will automatically be selected Insertion Point Select the location in the class where you want the entries to be added from the drop down list Options are First method Getters and setters will be placed as the first methods within the class Last method Getters and setters will be placed as the last methods within the class Cursor position Getters and setters will be placed at the cursor position only available if cursor was placed in a valid position After function Getters and setters will be placed after the selected function depending on the functions available within the class Sort by Determine the order in which the entries are entered The options are First getters then setters All the getters will be grouped together followed by the setters Fields in getter setter pairs Pairs of getters and setters relating to the same variable will be generated together Access modifier Not available in PHP 4 projects Selects whether the functions will be public protected private or final Generate method comments Select w
484. tent assist The PHP Interpreter Preferences page is accessed from Window Preferences PHP PHP Interpreter 602 PHP Interpreter Sei Configure Project Specific Settings PHP Version PHP 5 or greater e Use ASP tags as PHP tags To configure your PHP version 1 Select the PHP Version to use The default options are PHP 4 or PHP 5 or greater See PHP Support for more on effects the PHP version settings have 2 Mark the Use ASP tags as PHP tags checkbox in order for Code Completion to respond to ASP tags in the same way as it responds to PHP tags 3 Click OK to apply your settings To use a different PHP Interpreter for a specific project 1 Select the link labelled Configure Project Specific Settings 2 Select the specific project from the list 3 Another PHP Interpreter preferences page will open Properties for Menus Filtered PHP Interpreter SP interpreter C Enable project specific settings Restore Defaults Apply Cl Sr Hr 2 Reference Mark the Enable project specific settings checkbox Choose your PHP version Click Apply A prompt dialog will appear stating that a rebuild of the project must occur for the settings to take effect Click Yes to rebuild the project Error parsing will be performed according to the PHP version chosen If you click No the rebuild will be performed the next time Zend Studio is restarted 603 Zend Studio 7 User Guide PHP Libraries P
485. tents or from the Eclipse Online Documentation site http help eclipse org ganymede index jsp 256 Tasks Configuring an SVN Connection This procedure describes how to configure a connection to an SVN repository Before you can add projects to or export projects from SVN you must define your SVN repository settings Prerequisite To access a repository make sure that an SVN server is already configured y To add a new SVN repository 1 Open the SVN perspective by going to Window Open Perspective Other SVN Repository Exploring In the SVN Repositories view click the Add SVN Repository button amp on the views toolbar or right click within the SVN view and select New Repository Location The Add SVN Repository dialog will open 1 New Repository Location Enter Repository Location Information Define the SVN repository location information You can specify additional settings for proxy and svn ssh https connections _ gt General Advanced SSH Settings 55L Settings Proxy URL l Label Use the repository URL as the label Use a custom label Authentication User Password C Save password jj Saved secret data are stored on your computer in a file that s difficult but not impossible for an intruder to read Show Credentials For Keposiory Lu atioy x Validate Repository Location on finish Reset Changes 2 Finist Canc
486. tents will be displayed in the Navigator view Note This will not work in PHP Explorer view Forward Returns to the display from which the back button was pressed in the Navigator view Up one level Will go up one level in the hierarchy in the Navigator view Resource Goes to a resource within the files and folders displayed in the Navigator view Enter the first few letters of the a resource in the Go To Resource dialog and select the required one from the list Note This functionality will not work in the PHP Explorer view Ctrl Shift P Matching Bracket Jumps to a bracket s pair Clicking to the right of a bracket will highlight its matching pair To jump to the matching bracket press Ctrl Shift P Open F3 Goes to the declaration of an item selected in the editor ee SS Open Opens a Method in the workspace Open Type Opens a Type in the workspace geg See Opening Types Methods for more information Open Type Displays a selected Type in a hierarchy in See Viewing Type Hierarchies for more information Hierarchy 532 Reference Description Open Ctrl Shift R Opens files within the same project as the active file Resource An Open Resource dialog will appear Enter the first few letters of the required file to see a list of matching files Select the required file and click OK to open it in an editor window Alt Shift W PHP Explorer Displays the current active file in the PHP Explorer view Navigat
487. that this refactoring will create If you clicked preview a preview window will open with a changes tree showing all the changes which will be made to reflect the rename of the element The changes will be listed according to the context within which they appear You can therefore expand the nodes to see all changes within particular files classes or functions Use the Next Previous Change arrows to scroll through all possible changes Unmarking the checkboxes next to the changes will cause those changes not to take effect 395 Zend Studio 7 User Guide 1 Rename Global Variable fm unction php Refactor Projec me ki e heloWorld a lo MyClass Ile Rename global variable F1 Function php Original Source Refactored Source global SuserName global myName 11 echo Hello Vorld userName echo Hello World myNan e 1 12 15 function boot 15 function boo k 17 at 16 19 class MyClass 19 class MyClass function hello 23 function hello ninhal SnaarNama minhal Swuttame x Cen Note that if changes will be made in other files which reference the element being refactored the changes will also be listed here under the file name 7 The changes to be applied will be displayed in the bottom pane You can scroll through the different changes using the scrolling arrows SE as A Next Previous Difference scrolling arrows Scroll through changes to be
488. the drop down list to set the indentation size for a tab Indentation size If you select spaces enter the number of spaces to be created 563 Zend Studio 7 User Guide Indent Select the elements to be indented by marking the relevant checkbox from the following options Declarations within class body Statements within method function body Statements within blocks Statements within switch body Statements within Casel body break statements Empty lines Braces The Braces tab allows you to configure brace positions 1 Edit Profile a Indentation Braces white Space Blank Lines New Lines Line Wrapping Brace postions Class or interface declaration Method dedaration Blocks interface EmptyInterface class Example function bar fp t for i Gz 1 lt 10 switch p case O C j Choose the brace positions Same line Next line or Next line indented for the following Class or interface declaration Method declaration Blocks switch statement White Space The White Space tab allows you to configure where spaces should be entered for declarations control statements expressions and arrays 564 Blank Lines The Blank Lines tab allows you to set the number of blank lines to be created in various Edit Profile a Indentation Braces White Spete Blank Lines New Lines Line Wrapping Insert space a Dedarations E Control statements
489. the following places PHP Executables can be added and edited from the PHP Executables Preferences page The default PHP executable used for new projects can be set in the PHP Interpreter Preferences page Through this page you can also set the PHP version for specific projects In addition you can select which PHP Version should be used when creating a new PHP project by marking the Enable Project Settings checkbox in the New PHP Project dialog PHP Project New PHP Project Create a PHP Project Project name Contents Creake new project in workspace O Create project From existing source PHP Version O Ulise default PHP settings Use project specific settings C Use ASP tags as PHP tags Project Layout Use project as source folder Create separate folders for source files and public resources Configure defag a JavaScrigt Support C Enable JavaScript support for this project 112 Concepts The default PHP executable used with the debugger can be set in the Debugging Preferences page accessed from Window Preferences PHP Debug Through this page you can also set the PHP executable used to debug specific projects In addition you can also configure the PHP executable used for each Debug and Profile session in the Debug Profile configuration screens In order to perform local debugging for PHP 4 x projects you must manually add the relevant PHP executable to the PHP Executables Preferences page
490. this action should have been detected by Zend Server and saved as a performance event Open the Zend Server Event list by right clicking your Zend Server configuration in the Servers view and selecting Show Server Event List Or by clicking the arrow next to the Zend Server icon on the toolbar OR and selecting your Zend Server configuration from the drop down list If you have not yet configured your Zend Server password i A message will appear asking whether you want to configure this now ii Click Yes to be taken to the Zend Server preferences tab PHP Server Creation Zend Server Configuration Configure Zend Server integration options V Enable Zend Server integration Zend Server URL luse Defaut URL Suffix _ ZendServer Port Number 10081 Authentication Password eese 103 Zend Studio 7 User Guide 104 iii In the Authentication field enter your Zend Server Ul password and click Finish iv Reopen the Zend Server Event List as described in Step 8 above 9 The Zend Server Event list is displayed The last event displayed should be a Slow Request Execution Absolute Event created by our code slow down 10 Click the event to see the event details The event run time was higher than the one defined in the monitoring rules threshold To change this threshold go to the Rule Management tab and click Edit for the Severe Slow Request Execution Absolute rule amp Monitor Kl Rule Management
491. tically search for and recognize the Client Host IP but entering a specific Host IP will speed up the debugging process and decrease the likelihood of session timeouts If the field contains too many host IPs the session could timeout before a debugging connection is established Entering a non existent host IP could cause the session to terminate Broadcast Port The Broadcast Port allows your Zend Browser Toolbar or your Zend Server to detect your debugging preferences The Broadcast Port number entered here must match the Broadcast Port entered in your Zend Browser Toolbar Zend Platform The default port is 20080 Dummy File This is the file which the PHP Script debugger uses in order to start a PHP script debugging session on a specified server The name should be left as the default dummy php However if this is changed ensure the change has also been made on your server See Ensuring the Placement of dummy php for more information Use SSL Encryption Mark this checkbox to Encrypt Communication using SSL Your server must support this option in order for it to be applicable 4 Click OK to return to the Installed Debuggers Preferences page 5 Click Apply to apply your settings Reference Step Filtering Preferences The Step Filtering Preferences page allows you to select certain resources file patterns which will not be stepped into displayed during debugging This feature should be used when there are files w
492. tion Helpers in your project which are correctly commented will be available in the Code Assist list in Zend Controller files This includes both the default Zend Action Helpers included in Zend Framework s libraries and the Actions Helpers you created class NeyZendController extends Zend_Controller_ Action 1 public function indexAction TODO Auto generated NeyiendControllert indexaction default action this gt view gt events this gt events gt fetchall this gt _helper gt my L o myHelper The Helper broker for the Helper s members and methods are also available for Content Assist class NewZendControlier extends Zend Controller Action The Iefeault ation show the hore page public function indexAction TOD AUCO Genersted Neurendcontrol ser s andexaction G4Tsulit sect n this gt view gt events fthis gt events gt fetch ll this gt _h lper gt js0n gt Grect mixed data boolean cendNow true a Location encodeJson mixed data boolean Been ac H getActionController Zend_Controller_Action gt getFrontController Zend_Controller_Frort o getName string getRequest Zend_Cortrofler_Request_Abst getResponse Zend_Controller_Response_Al ink void Description postDispatch void m Strategy pattern call helper as helper broker t a gt DD 291 Zend Studio 7 User Guide In addition pressing Ctrl and clicking on a Zend Action Helper in a Controller
493. tion about fields in the Personal Planning section 446 Tasks Task Focused Interface The task focused interface is oriented around tasks and offers several ways to focus the interface on only what is relevant for the currently active task You can focus navigator views e g Package Explorer Project Explorer Navigator by toggling the Focus on Active Task button in the toolbar When focused the view will show only the resources that are interesting for the currently active task Alt Click Navigation To navigate to a new resource that is not a part of the active task s context you can toggle Focus on Active Task off browse to the resource and then click Focus on Active Task again to see only relevant resources A more efficient way to add new resources is to use Alt Click navigation Clicking the mouse while holding the Alt key When a view is in Focused mode you can Alt Click a node to temporarily show all of its children Once an element that was previously not interesting is selected with the mouse it becomes interesting the other child elements will disappear The clicked element is now a part of the task s context Alt can be held down while clicking to drill down from a top level element to a deeply nested element that is to be added to the task context Multiple Alt Click are supported so that you can add several elements to the task context As soon as a normal click is made uninteresting elements will disappear Ctrl Clic
494. tion and click Browse to specify the location Add new Path Mapping Path on Server C Documents and Settings MyProject Path in Workspace iMyProject Path in Eile System 8 Click OK Your Path Map will be added to your server list 340 Tasks gt Edit Server The next time a file is called from the Path on Server it will be searched for in the local location you have specified topic for more details 341 Zend Studio 7 User Guide Setting Up Tunneling To establish a tunneling connection for remote debugging and Zend Server integration the following tasks need to be performed Note If you have followed the instructions under Setting Up Remote Debugging you will have already performed some of these tasks 1 Ensure you have a dummy php file in your remote server s document root 2 Ensure your Zend Studio is an allowed host for your server debugger This can be done through Zend Server Zend Core or Zend Platform if installed or through your php ini file 3 Configuring you Tunneling Connection in Zend Studio From the PHP Servers Preferences page Window Preferences PHP PHP Servers 4 Activate the tunnel By selecting your Tunneling server from the list next to the Tunneling icon on the toolbar 342 Tasks Configuring Zend Server to Auto Detect Studio Settings This procedure describes how to configure Zend Server so that Zend Studio s settings are auto
495. tions Templates Classes Interfaces ch Constants o Variables public Content Assist works with the following elements PHP Classes Functions Variables Constants Keywords Interfaces Attributes Values Nested Functions Names and Syntax as well as all user defined Classes Functions and Constants Content Assist works with both PHP and HTML 50 Getting Started Activating Content Assist By default the Content Assist options will be automatically displayed once the first few characters of the code have been entered Ky The following procedure demonstrates using Content Assist 1 Create a new PHP File called File1 2 On the line beneath the opening PHP tag type def 3 Click Ctrl Space The Content Assist window will be displayed with a list of suitable code completion options lt php det 7 gt A default vd DEFAULT_INCLUDE_PATH LB defineisting name mired value e define_syslog_variables void defined string name bool 4 Double click the first define function from the Code Completion window or select it and press Enter define appears on the edit line If the Content Assist window does not open automatically place your cursor at the required location and press Ctrl Space To enable the Content Assist window to open automatically go to the Content Assist Preferences page accessed from Window Preferences PHP Editor Content Assist and mark the Enabl
496. tnn ttnn nenun ennet 584 Save Actions Preferences inia ii wa a i a ia ene 586 Syntax Coloring Preference cccccecesecsenceceeeeeceaeeeeeaeseeneeceaeeeeaaeseeaaesseeeeseeeeesaesteaeeesaes 587 Task Tags Preferences 2 sii chi igen eege SE deeded 589 Templates Preferences cccccescccceeeeccceeeeeeceeeeeeeaeeeeaeeaaeesaeeaeeesaaaaeeesneeaeaeseeeaeeeseeeaeeeenees 591 Typing PreterenCes ci acini eege EENS EENS eege 594 Zend Framework Preference AA 596 New Project Layout Preferences AA 598 PHP Executables Preferences inspeti inean EN ARAE e AEE e RAA AE AEEA N EER 600 PHP Interpreter Preferences S aapear iena n ea EES A E ESEN 602 PHP Libraries Ee 604 PHP Manual Preferences EE 606 HHP Servere Preferences iinn ainat ea anan aoaea Eaa Ara Re eege ERa 607 Reder 610 Editing the Tracer Listener Settings A 610 PHP Unit EE 612 Semantic Analysis Preferences ccccccsscceeceeceeeeeeaeeeeeeeceeeeeceaeeeeaaeseeneeseeeesiaeeseaaeeseneeee 613 Configuring Tunneling Debug Preference cccccceeceeseeceeeeeeeeeeeeaeeeeaeeseeeesaeeetaeeeeneeees 616 Zend Guard Preterences A 617 PHP Project Propentles TE 618 PHP Geer Oe TEE 618 Elesotee HroperH g eriari Taea AI RA AAR AE ATA Seege NAA N des 619 Builders Prop orio E 621 Cod Style Properties ssri orindi dansat daea nian adenine nad anesthe ies 623 xiv Table of Contents Code Templates Properties ccccccccceceeneeeeeeeeceaeeeeaaeeeeeeeseaeeesaaesesaeeseee
497. to point to your Zend Server GUI URL Enter your Password 10 Click Next to configure Tunneling settings or Finish to create your server Zend Server will be added to the Server list and will allow you to use Zend Server integration features Zend Server will also now be available from the toolbar and the Zend Server Events view 420 iz OSG deeg 2 Default PHP Web Server PHP Web Server Configurations Tasks Integrating with Zend Guard Zend Guard s Integration with Zend Studio allows you to Encode your Zend Studio projects using Zend Guard Open and edit Zend Guard projects in Zend Studio See the Zend Guard product site http www zend com en products guard or the Zend Guard Online Documentation http files zend com help Zend Guard zend guard htm for more information on Zend Guard 421 Zend Studio 7 User Guide Encoding Projects Using Zend Guard This procedure describes how to open your Zend Studio Projects in Zend Guard in order to encode them Zend Guard must be configured in Zend Studio before Zend Guard integration is accessible This can be configured through the Zend Guard preferences page accessible from Window Preferences PHP Zend Guard wi To open a project in Zend Guard 1 In PHP Explorer view right click the required project and select Encode Project or select the required project and from the Menu Bar go to Project Encode Project or click the Encode Proj
498. to be debugged will have been automatically created based on the file Tasks name and your server address If the URL does not point to your debug target s location unmark the Auto Generate checkbox and modify the URL 10 For further Debug options select the Advanced tab which has the following options New Debug Configuration Advanced Open in Browser Mark if you would like the application to be displayed in Zend Studio s internal browser while it is debugged Choose whether to Debug All Pages The specified page and all the pages linked to it are debugged The browser waits for the debug of each page before displaying it Debug First Page Only Only the first page is debugged Start Debug from Select the URL from which you would like the Debugging process to start Continue Debug from this Page Selecting this option will result in all the pages linked to the URL being debugged Source Location Choose whether the source files used during this session will be taken from the server or from a local copy If a local copy is not available files will be taken from the server Selecting the Local Copy option will result in the Path Mapping mechanism being applied when files are called See the Path Mapping topic for more details 10 Click Apply and then Debug 11 Click Yes if asked whether to open the PHP Debug Perspective See the Running and Analyzing Debugger results topic for more information on the outco
499. tre SQL SQL Server 5 Click Next Select a driver from the drop down list If the required database driver has not been configured click the New Driver Definition button g to the right of the drop down list and perform the following steps i In the Name Type tab select the required driver type and version ii Select the Jar List tab iii Click Add JAR Zip iv Browse to the JAR Zip file containing the required driver files and click Open v Click OK The new driver is added to the driver definition list vi The properties for the selected driver are displayed These will vary depending on the database type vii Click the Test Connection button to ensure all the details have been entered correctly viii Click Next to see a Summary of your Connection Profile s details ix Click Finish Your new connection profile will be added to your databases list in the Data Source Explorer view You can now use this Connection Profile to connect to your database See the Connecting to a Database topic for more on how to connect to your database To change the properties of your connection profile right click it in the Data Source Explorer view and select Properties For more information on the Data Tools Platform please see the Data Tools Platform User Documentation Additional user guides can be accessed from inside Zend Studio by going to Help Help Contents or from the Eclipse Online Documentation site http help ecli
500. tting the JavaScript Build Path for a project will allow you to determine which elements will be included in the project s build process This allows access to content assist and refactoring options from resources in locations other than in the project itself Advanced editing functionality in JavaScript editors For example e JavaScript Content Assist e JavaScript Syntax Coloring e JavaScript Code Commenting e JavaScript Hover Support e JavaScript Mark Occurrences e JavaScript Smart Goto Source JavaScript support can be added to new or existing PHP projects so that all of Zend Studio s JavaScript features are available to the project For a full list of features enabled for JavaScript development see Features Javascript Developtment Toolkit JSDT in the JavaScript Development Toolkit User Guide Additional user guides can be accessed from inside Zend Studio by going to Help Help Contents or from the Eclipse Online Documentation site http help eclipse org ganymede index jsp 172 Concepts PHPDocs PHPDocs provides structured easy to read documentation of all your php elements PhpDocumentor can automatically create PHPDocs from your scripts using a templating system to change your source code comments into readable formats The PHPDoc Generator Wizard is Zend Studio s interface with phoDocumentor E Debug php F JavaScript php P PHPDocumenti pho Example phpDoc d Example gige h Ep phpDocu
501. tudio 7 User Guide Creating PHP Elements New PHP Element wizards allow for the easy creation of PHP classes and interfaces The wizards let you easily configure all required parameters and give you access to Superclasses New PHP Element wizards allow you to create a new PHP Class and creating a new PHP Interface Creating a New PHP Class This procedure demonstrates how to create a new PHP class using the new PHP class wizard vn To create a new PHP class 1 In PHP Explorer view right click the project file in which you want to create the new class and select New Class The New PHP Class wizard is displayed New PHP Class Source Folder MyProyect My Folder Create New Fle Weste hg OC Add in existing Pie Class Name Modifiers Gone Ofinal O abstract Which methods stubs would you like to create C Constructor CJ Destructor Clinherted abstract methods Which comments would you like to create C Generate PHPDoc Blocks C Generate T0005 Cem 194 Tasks 2 Enter the following details Source Folder If necessary click Browse to change the soruce folder a Class location Select one of the following options e Create New File A new PHP file will be created in which the new class will be inserted e Add in existing file The class will be created in an existing file Click Browse to select the file in which it will be created and select whether it will be created as the 1st PHP Block in the file
502. tudio5 x 1 Right click in PHP Explorer view and select Import Zend Imports Import from Zend Studio 5 x or go to File Import Zend Imports Import from Zend Studio 5 x The Import from Zend Studio Wizard will open Import from Z nd Studio Wizard Import from Zend Studio Import an existing Zend Studio 5 x project Select Studio 5 x project File Project name Project contents Lal Use default Cancel 2 Click Browse to find your Zend Studio project stored on your file system The project will automatically have been stored with a zpj file extension 3 Click Open The Project name will by default be given the same name as your zpj file Edit this name if required If the project root contains folders linked to source control the name given will be the project name specified in this screen with the name of the project root in parentheses following it E g if the project name given was MyProject and the 198 Tasks imported project root was MyProjectRoot the Project will be displayed as MyProject MyProjectRoot 5 If you want the project to be imported into somewhere other than your current workspace unmark the Use default checkbox under the Project contents category and browse to a different location 6 Click Next The Import Summary dialog will open 7 import from Z nd Studio Wizard Import Summary This page presents the projects that wil be created in Neon and the
503. u want to incorporate e g a new SoapClient hetp api google com GoogleSearch wsdl 2 Save the file The WSDL file s methods classes functions etc will now be available in the Code Assist Menu and the SOAP Client now appears in the PHP Project Outline tab Once a WSDL file has been referenced in your project the following will be affected 427 Zend Studio 7 User Guide Outline and PHP Project Outline views The PHP Project Outline will now include all the functions from the referenced WSDL file Content Assist Code completion is automatically updated with all the functions included in the referenced WSDL file BA Date Types GoogleSeachResult documertFiteting searchComments estimated otaPlecutsCourt estimatel sE xact resultElements duectorCategones searchQuery stastindex ndindes searchTips search ime e ResutElement 20 DirectoryCalegory dGelCachedPageistring key a doGoogeSearchistiing key sting vi P o H o s D J o a new SoapClient htcp api google com GoogleSearch wsdl fa gt 2 Soaptheni SoapChent _calfsiing funchon_name anay argument _dRequestistiing Srequesl sting Slocation _getFunctions anay __getLadRequest sting __ gelLastRequestHeaders string _getLastResponse sing Code completion for Web Services is supported for PHP 5 Auto Link to WSDL files Transform the name of t
504. uded or excluded from the Build process If during project creation you selected the use project as source folder under the Project Layout category all resources within the folder will be added to the Build Path by default If you selected to create separate folders for source files and public resources during the project s creation resources in the public folder will be excluded from the Build Path by default The project s PHP Build Path can be configured through the project s Build Path properties page accessed by right clicking the required project and selecting Build Path Configure Build Path Build Path r EE Le MyProject hdd Fokje me Ce f Dee Ca This page allows you to add folders and resources to your Build Path and configure rules for including excluding certain resources in the project You can configure your Build Path according to the options listed below Once you have made changes click OK to save By default all folders which are on your Build Path will be included in your Include Path 371 Zend Studio 7 User Guide Configuring Inclusion Exclusion Patterns for the Project By configuring inclusion exclusion patterns for the Build Path you can select to include or exclude all resources in your project which match a defined pattern w To include exclude resources from the Build Path 1 Inthe Build Path Properties page expand the node next to the folder whose Inc
505. ug and analyze PHPUnit libraries Profiling PHPUnit Test Cases Suites Profiling a PHPUnit Test Case Suite will result in the PHPUnit view being displayed showing the results of the tests that were run in addition to the normal profiling functionality This will also allow you to profile and analyze PHPUnit libraries 168 Concepts PHPUnit Reporting Once a PHPUnit Test has been run Zend Studio can generate a range of reports to easily view and analyze your tests The types of reports available are XML Generates an XML output of your test results This can be used to create your own reports plain xsl Creates a report based on a predefined plain xsl format The report shows It shows percentages elapsed time total tests errors and failures In addition it shows individual report status message stack trace and warnings with their stack traces packages xsl Creates a report based on a predefined packages xsl format This is an extension of the plain report which divides the unit tests into packages Packages are defined by adding an package annotation to the PHPDoc of test classes Test classes without an package annotation will be categorized in a default package Custom XSL reports can also be generated by selecting the Generate with XSL option and selecting a previously created XSL report These will then be added to the list of available reports See Reporting on PHPUnit Test Results for more
506. uild to be performed only when Zend Studio is restarted Or click Cancel to cancel the operation Default PHP Interpreter Properties for all projects can be set in the Debug Preferences page accessed by going to Window Preferences PHP Debug or by clicking the Configure Workspace Settings link on the properties page 631 Zend Studio 7 User Guide PHP Task Tags Properties The PHP Task Tags Properties page allows you to add new task tags and edit existing ones Tasks are used as reminders of actions work to do or any other action required by the programmer Task tags are strings used by Zend Studio to recognize when tasks are added in your script Anything after these strings inside a comment will be recognized as a task To access the PHP Task Tags Properties page right click a PHP project in PHP Explorer view and select Properties Resource or select the project and from the menu bar go to Project Properties PHP Task Tags Properties wi To configure PHP Task Tags Properties for the project 1 Mark the Enable project specific settings checkbox 2 Configure the settings according to your preferences See Task Tags Preferences for more information on the settings available 3 Click OK to apply your settings Default PHP Task Tags Properties for all projects can be set in the Task Tags Preferences page accessed by going to Window Preferences PHP Editor Task Tags or by clicking the Configure Workspace S
507. uilder kel en Validation By default Builders will be added according to the type of resources in your projects e g if you add JavaScript libraries the JavaScript builder will be added However you can also configure your own external builders if required 621 Zend Studio 7 User Guide w To add a new Builder 1 Click New The Choose Configuration Type wizard is displayed iale Choose configuration type Select the required Builder type and click OK A wizard will be displayed allowing you to configure your Builder See the External Tools topic in the Workbench User Guide for information on configuring your Builder Additional user guides can be accessed from inside Zend Studio by going to Help Help Contents or from the Eclipse Online Documentation site http help eclipse org ganymede index jsp 4 Click OK to apply your settings 622 Reference Code Style Properties Code Templates Properties The Code Templates Properties page allows you to configure the code and comments that are automatically created for different types of elements for the selected project See Code Templates Preferences for more information To access the Code Templates Properties page right click a PHP project in PHP Explorer view and select Properties Resource or select the project and from the menu bar go to Project Properties Code Style Code Templates See y To configure Code Templates Properties
508. undled with Zend Server Zend Core and Zend Platform but can also be downloaded as a separate component from http www zend com en products studio downloads KY This procedure demonstrates how to debug applications on a server 1 Inside a PHP project create a new PHP file called form1 with the following code lt html gt lt body gt lt form action welcome php method post gt Name lt input type text name name gt Age lt input type text name age gt lt input type submit gt lt form gt lt body gt lt html gt 2 Create a second PHP file called welcome with the following code lt html gt lt body gt Welcome lt php echo _POST name gt lt br gt You are lt php echo _POST age gt years old lt body gt lt html gt 3 Save both files and copy them to your server 4 Click the arrow next to the debug button E on the toolbar and select Debug Configurations or right click the file in PHP explorer or within the file s editor window and select Debug as Debug Configurations A Debug dialog will appear Double click on the PHP Web Page option to create a new debug configuration Enter a name for the new configuration 78 te 8 g Getting Started Select the Zend Debugger from the Server Debugger drop down list Select your server from the drop down list If you have not configured a server click the PHP Servers link to be taken to the PHP Servers
509. upload a local project to a server connection Downloading Selected Files from a Folder This procedure describes how you can import a partial project ignoring any files that you don t need and keeping them hidden on your workspace 183 Zend Studio 7 User Guide Creating a Connection via the Servers View Downloading a Project from an Existing Location Sharing a Local Project to a Connection Synchronizing a Local Projectto a Creating a New Remote Project Connection Downloading Selected Filesfroma Folder RSS is an upgraded version of the Remote Systems View that reduces the amount of communication between networks by using less connection nodes RSS also communicates less data by directly transferring information rather than copying all of the files The Remote Systems View page is now obsolete Please use the following link to access the upgraded feature Remote System Explorer Working Remote Server Explorer 184 Concepts Mylyn Integration Mylyn is a task focused interface that reduces the overload of information and makes multi tasking easy It does this by making tasks a top priority and integrating rich and offline editing for repositories such as Bugzilla Trac and JIRA Once your tasks are integrated Mylyn monitors your work activity to identify relevant information and uses this task context to focus the user interface on the task at hand This puts the info
510. uration and replace it with the currently selected folder Update exclusion filters in other source folders to solve nesting This will exclude the currently selected folder from the parent directory s Build Path but will add it as a separate entity so that different inclusion exclusion patters can be configured for it 4 Click Finish You can now configure a pattern for including excluding resources for the source folder by following the instructions under Configuring Inclusion Exclusion Patterns above 374 Tasks Adding External Source Folders to the Build Path You can add an external source folder as a link to your project which will be scanned during the Build process ey To add an external source folder to the project s Build Path 1 Inthe Build Path Properties page click the Link Source button Or In PHP Explorer view right click the project and select Build Path Link Source The Link Source dialog is displayed Link Source Source folder Link additional source to project abc Linked folder location Folder name O Replace existing project source folder entry to solve nesting O Update exclusion fiters in other source folders to solve nesting Ignore nesting conflicts 2 Click the Browse button and browse to the location of the folder you want to add to the Build Path Alternately click Variables and select the variable which points to the required resource 3 The Folder name
511. urce pe hiber te amp General B S cys mm Le PHP S E PHP Profiler mp Remote Servers H gt Remote Systems amp Run Debug o svn D 3 Tasks mt E Team D amp XML mp Le Zend Imports gt Zend Server E Server Preferences and click Next The Import Zend Server Event File dialog opens The Server path mapping setting dialog opens Server path mapping settings Specify the server path mapping for the selected tracer file Associate this trace with server Local Zend Server E Path on server I Ci Documents and Settin LZ jMyProject Local path Tasks To open the Import Wizard go to File Import Zend Server Zend Server In the From File text field browse to the location of your Zend Server Event File 205 Zend Studio 7 User Guide 3 Select the server to associate with from the Associate this trace with server drop down menu You can add edit or remove a path map from this page using the appropriate buttons You may select to have a path in your workspace or in the file system For more information see Path Mapping Click Finish to save the changes Click Yes when the Confirm Perspective Switch message appears asking your permission to open the Zend Server Code Tracer perspective The Zend Server Code Tracer Perspective opens with the imported Zend Server Event File open in the Tracer View For information about the functionalities
512. urce Click Next Select The PHP version Whether to enable Short Tag Support Enable recognition of short PHP tags Recognizes lt as a valid PHP start tag When this option is not selected Zend Guard will not encode short tags which will be treated as regular HTML Whether to enable ASP Tag Support Enables recognition of ASP tags Recognizes lt as a valid PHP start tag When not selected code within ASP tags is treated as regular HTML Resolve Symlinks Resolves Symbolic Links before encoding not applicable in Windows A symbolic link often shortened to symlink and also known as a soft link consists of a special type of file that serves as a reference to another file or directory Unix like operating systems in particular often feature symbolic links Which files to encode Lists the file extensions for Guard to encode extensions not listed will not be encoded File extensions that are not listed here and in Patterns to Ignore will be sent as is to the output folder Which patterns to ignore Files matching these patterns will not be encoded when encoding a directory nor will they be copied as is to the target directory By default the list contains the CVS directory and cvsignore files includes Wildcards 7 Click Finish Your project will be opened in Zend Guard and can be encoded using Zend Guard s functionality 423 Zend Studio 7 User Guide Goad Dpiore PD 534 Uf Example Proj
513. use those changes not to take effect Click OK to apply the changes The method will be extracted and the relevant changes made to the code 401 Zend Studio 7 User Guide Generating Getters and Setters Zend Studio can automatically create getter and setter functions in order for Get and Set function calls to be easily created This procedure describes how to generate getter and setter functions for all variables within a class y To generate getters and setters 1 In a PHP file place your cursor within the class for which you would like to generate the getters and setters 2 Right click within the class s source code and select Source Generate Getters and Setters Or from the Menu Bar go to Source Generate Getters and Setters Or Right click the required class in PHP Explorer view and select Source Generate Getters and Setters 1 lt php 2 class Person 3 private fage 4 private id 5 public name 6 protected Seyes E 3 zs 10 3 The Generate Getters and Setters dialog will open displaying all variables that might require a getter setter 1 Generate Getters and Setters Select getters and setters to create Ol id Insertion point o BE Select Al E eyes LI o geteyest Deselect Al setEyes Select Getters E o name Select Setters Pret method Sort by Fields in getter setter pairs Access modifier public O protec
514. used Interface 2 0 ais cae il i es Aes E eee 447 Task focuSed Ordering A 448 Task HyperlinkiNg EENS NEESS SEENEN ee nia idee 448 Developing with JavaScript A 449 Enabling JavaScript Support in PHP Projects ccccccceeeeceeeeeceeeeeceaeeeeaaeeeeeeeseeeeesaeeseaeeeeaes 450 Enabling JavaScript Support for New PHP Projects cceccceceeeeeeseeeeeeeeseereeseaeeeseeeeenees 450 Enabling JavaScript Support for Existing PHP Projects ccccccssseeeseeseeeeeseeeeeneeeeenees 451 Removing JavaScript Support asirian aaan haeetedeera aea aaa Re Eege tiheaedss 451 Setting the JavaScript Build Path 452 Viewing JavaScript Elements in the Outline View 461 Using JavaScript Content ASSISt ccecceeesceceeeeeeceeeeeeeeeeeeeeaeeseaaeseeaaesaeeeeaaesteaeeseeeeesaes 462 Using JavaScript Syntax Coloring ANEREN 465 Using JavaScript Mark Occurrences sssessseseeesirssensstnsstnsstnsstnsstesstenstenstnnttnnsnnnntnnntnnnennnnt 467 usteet 469 Setting Up and Using Dojo Integration 470 BEEE A ET EENT D TEE ASE A d de eed loaves T E Gee ieee ceed ee A Barony 474 PHP Perspectives and ViOWS 0 cccessecceceeseneeeeeeeeeeeeeeeeeeeeeeeeeeseeaeeeeseaaeeeseeaaeeeseeseeeeneeseneeees 475 PHP Ve 476 PHP Explorer EE 477 El 480 Remote Systems View 483 EE 486 Ree een 488 xii Table of Contents PHP Debug Perspective n nuranine ae aA EE EARE AE 491 Debug View PHP Debug Perspective A 493 Variables View PHP Debu
515. vaScript or CSS The context of the current code being entered defines which templates are available For example PHP templates are not available if your current code is Java Inserting a Template into Code This procedure describes how to insert a template into your script wi To insert a template 1 Place your cursor at the desired insertion point 2 Enter a character string e g Sw 3 Click Ctrl Space The Content Assist box will appear listing all available templates and completion options that begin with that combination of keys Templates are marked in the content assist list with a blue square 4 Double click the required template from the list The template will be entered into your code 224 Tasks Example Entering sw and selecting the the switch statement template from the list will give you the following code switch var case value break default break ID OO JO D bb Gau PM 10 Templates can be created imported and exported through the Template Preferences page accessed from Window Preferences PHP Templates 225 Zend Studio 7 User Guide Formatting Code Zend Studio can auto format your code according to set standards in order to make it easily navigable and readable Your code will be automatically formatted according to the settings defined in the PHP Formatter Preferences page accessed from Window Preferences PHP Formatter This procedure demonst
516. ver Enables deleting a user space object 1 Connects to i5 server 2 Deletes user space object 3 Closes connection to i5 server Retrieves user space data Connects to i5 server Opens a user space and prepares it to be run Retrieves user space data Closes connection to i5 server Enables to add user space data Connects to i5 server Opens a user space and prepares it to be run Adds user space data Closes connection to i5 server Zend Studio contains Content Assist for commonly used IBM i functionality Content Assist is available for the IBM i PHP Toolkit functions listed above as well as for connectivity to the Zend 5250 Bridge For more information on Content Assist and how to use it see the Content Assist topic 181 Zend Studio 7 User Guide Remote System Explorer RSE Remote System Explorer provides transparent access to remote resources including the upload and download of files RSE helps you to create view and manage your connections to remote systems such as FTP and SSH This will allow you to work on projects with local files remotely enabling you to create view and manage your connections to remote systems RSE enables you to perform the following tasks Create a connection via the Server s view Create a new remote project Import a project from an existing connection Share a local project to a connection Synchronize a local project to a connection Export Actions Import Actions RSE is an up
517. vers view by performing the following steps 1 Open 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 Click the Auto Detect Zend Server Ee icon on the toolbar If a Zend Server installation has been detected a New Zend Server Found dialog is displayed asking whether you want to configure it to be the default server New Zend Server Found 3 A Zend Server installation has been detected on your local machine Do you want to be set as the default server L we Iw 4 Click Yes to set it as the default server or No for the server to be configured by but not set as the default A Local Zend Server configuration is configured and added to your PHP Servers Preferences page 101 Zend Studio 7 User Guide Creating a project on a Local Zend Server Through Zend Studio you can create new PHP projects directly on your local Zend Server s document root Ensure you have configured your local Zend Server integration as described above S To create a new PHP project on Zend Server 1 From the menu bar go to File New PHP Project The New PHP Project dialog is displayed Enter ZendServerProfiling in the project name field Under the contents category ensure the create project on a local server option is selected The directory path should point to the document root of your Zend Server 4 Click Finish Th
518. w CalculatorSuite file will be created integrating both tests into one file Run the CalculatorSuite by clicking the arrow next to the Run button off on the toolbar and select Run As PHPUnit Test amp or go to Run Menu and select Run As PHPUnit Test 7 Both tests will be run with the results of both displayed in a tree in the PHPUnit view at the bottom of the screen EEEE S Runs D Errors 0 Failures 1 a Be Bye CalculatorTest E Ca CalculatorTest2 Getting Started Generating PHPUnit Test Reports Ky The following steps demonstrate how to run a report on your Unit Test results 1 Once you have run the PHPUnit Test Suite click the arrow next to the Generate Report icon on the PHPUnit view s toolbar and select Generate with plain xsl from the drop down list See PHPUnit Testing for more on the different types of reports E Open Original XML 3a Generate with plain xsl ea Generate with packages xsl Generate with XSL A report will be automatically generated and opened in a browser window 99 Zend Studio 7 User Guide Working with Zend Server The purpose of this tutorial is to teach you how to deploy profile and debug files and applications using the Zend Server Contents Purpose and Usage Configuring Zend Server Integration Creating a project on a Local Zend Server Diagnosing and Profiling Performance Issues on Zend Server Diagnosing and Debugging Errors On Zend Server
519. w Easy PHP File icon on the Or Click the New File icon on the toolbar toolbar E A new PHP file will open in the editor Or In PHP Explorer view right click and select New Untitled PHP Document A new PHP file by default called PHPDocument1 will open in the editor To create a new PHP file within a project 1 In PHP Explorer view select the Project within which you would like to place the file 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 will be displayed Enter the name of the file and click Next Click Finish See Easy File Creation for more information 34 Getting Started Debugging By creating a debug launch configuration in Zend Studio 7 x you can easily rerun the debug session with the settings specified by clicking the arrow next to the debug button E on the toolbar and selecting your launch configuration To debug a PHP script using Zend Studio s internal debugger Zend Studio 5 x Zend Studio 7 x Open the Preferences window by Click the arrow next to the debug selecting Tools Preferences from the button F on the toolbar and select Debug As PHP Script Or In PHP Explorer view right click main menu Select the Debug tab From the Debug Server Configuration the required file and select Debug As area of the Debug tab select internal PHP Script from the Debug Mode category Click
520. w zend com en products studio downloads but can w To profile a PHP Web Page 1 Click the arrow next to the Profile button db on the toolbar and select Open Profile Dialog or go to Run Open Profile Dialog from the main menu or right click in PHP Explorer view and select Open Profile Dialog A Profile dialog will appear Double click the PHP Web Page option to create a new Profile configuration EE EE 4 Enter a name for the new configuration 5 Select your server from the list If you have not yet configured your server click New The PHP Server Creation 354 Tasks Wizard will open Configure your server by following the instructions on adding a new server under the PHP Servers Preferences page For more information on configuring the communication between Zend Studio and your remote server see Setting Up Remote Debugging 6 Under PHP File click Browse and select your debug target file the file from which the profiling process will start 7 For further profiling options select the Advanced tab which has the following options Open in Browser Mark if you would like the application to be displayed in Zend Studio s internal browser Source Location Choose whether the source files used during this session will be taken from the Server or from a local copy if a local copy is not available files will be taken from the server according to the search mechanism detailed in the Path Mapping topic Cl
521. want to change something on a prewous screen click the Previous button You may cancel this installation at any time by clicking the Cancel button InstallAnywhere by Macr mision Cancel revi Net __ d W Wi 25 Zend Studio 7 User Guide Launch Zend Studio The first time Zend Studio is launched the Welcome Page is displayed Welcome to Zend Studio FY Product Homepage E Watch Videos 5 Ways to Get Started with Zend Studio fz Developing and Debugging on Zend Server Check out frre afferent methods of learning how to start working with Leam about Zend Server Zeng e complete enterprse r ady PHP Server Zend Studie and how it integrates wth Zend Studo to provide an optimal PHP Web apphcation development and debugong environment Advanced PHP Editing Features for Faster Coding E Tutorials Learn bout Zend Stutho s PHP coding and editing features which make FoBow La by step tutorials to learn how to use Zend Studio s mann writing PHP faster and more accurate featur Zend Framework Development d What s New Leam how to qacily and easily create appkcabens according to mdustry See what new features are avaiable in the latest verson of Zend Studo Standard best practices umng the Zend Framework Connectivity and Configuration Management 3 Zend Studio Updates Learn about Zend Studio s connectivity features such as working weh Enter your nad in the feld below to s n up for notifications regardi
522. will appear in a new browser tab of the Editor The initial default site cannot be removed or edited Click OK to apply your settings 606 Reference PHP Servers Preferences The PHP Servers Preferences page will display a list of your currently configured servers and allow you to add servers or edit settings for existing servers The server settings will be used for debugging profiling files on a remote server The PHP Servers Preferences page is accessed from Window Preferences PHP PHP Servers w Preferences X AX z filter PHP Servers Kez v H General Data Management Dynamic Languages Note that removing a server definition will also remove any launch Field Assist configuration that is using it PHP Servers Management Install Update PHP Appearance Code Coverage Code Gallery Code Refactor Set Default E Default PHP Web 5 http ilocalhost Ed F Local Zend Serve http localhost 80 4 Code Style Debug Editor New Project Layout PHP Executables PHP Interpreter PHP Libraries PHP Manual PHP Servers m One server configuration setting is configured by default and will point to the URL http localhost You can benefit from Zend s expertise by using the Zend Server which includes the Zend Debugger in order to perform optimal debugging and profiling functionalities See Zend Server Integration for more information If you have a Zend
523. will be displayed with a section showing all the tests run and the results and two extra tabbed views showing code coverage and failure trace A EE pf amp 2 7D Runs 4 4 E Errors 0 H Failures 1 Se E g CalculatorTest Failure Trace E after er E Le A or ES ee test_add Element Covered Lines Visited Si Ge test_divide Failed asserting that lt integer 3 gt is equal t S G UnitTesting Project 2 2 65 28 43 119 E e Je E test_multiply P Calculator Hp 65 11 17 22 d test_subtract subtract test not implemented EI CalculatorTest php 65 17 26 97 In the main area of the PHPUnit test view the results for each of the tests run will be displayed Tests that have passed successfully will be displayed with a green tick icon ee Tests that have failed will be displayed with a blue X icon El Functions with tests that have not been implemented i e functions that tests have not been created for will have passed but will have a note indicating that they have not been implemented The number at the top of the view indicates how many tests have been run Tests may not be run if an exit command is given or if a fatal error is encountered D Click the Show failures only icon E to only view failed results Select a failed result to view it in the Failure Trace view Click the Filter Stack Trace icon to display only functions relevant to your application and not PHPUnit functions
524. wing debug options by clicking the arrow to the right of the X Debug button Next page on site The debugging session will be launched when the next link is clicked a form is posted or an AJAX request is executed All forms POST on this site The debugging session will be launched every time a link is clicked a form is posted or an AJAX request is executed using the POST method The script that will be debugged will be the script designated as the action of the form or link All pages on this site Debugs all pages from the current page 327 Zend Studio 7 User Guide If the files you would like to debug exist in your workspace you can choose to debug the workspace copy of your files by going to Extra Stuff Settings on the Toolbar and selecting the Debug Local Copy option In Zend Studio for Eclipse if path mapping has not yet been configured a path mapping dialog will be displayed once the debugging session is launched to determine which workspace files will be debugged See Path Mapping for more details The relevant debug session will be launched in Zend Studio 328 Tasks Installing and Configuring the Zend Browser Toolbar Installing the Zend Browser Toolbar The Zend Browser Toolbar can be installed during the installation of Zend Studio or can be downloaded and installed separately 9 To install the Zend Browser Toolbar during Zend Studio installation In the Choose Install Set dialog of the
525. wing options are available when running your files and applications Running PHP Scripts Locally Run files on your workspace using Zend Studio s internal debugger Running PHP Scripts Remotely Run files on your workspace using your server s Zend Debugger Running PHP Web Pages Run applications situated on a server 308 Tasks Running PHP Scripts Locally This procedure describes how to run a PHP Script from your workspace using Zend Studio s internal debugger S To locally run a PHP Script 1 Click the arrow next to the Run button oh on the toolbar and select Run Configurations or go to Run Run Configurations A Run dialog will open 2 Double click the PHP Script option to create a new run configuration Name New_configuration 1 D pezent PHP Soret Arguments IM Environment Common Debugger Location OPH Executable PHP Debugger Zend Debugger SS PHP Executable P 5 2 5 CGI C Program Files ZendiZend Stud for Edp PHP Executables OPHP Web Server elt Zen ve PHP File F Display debug information when running 3 Enter a name for the new configuration Ensure that the PHP Executable option is selected under the Debugger Location category and select the required PHP executable Under PHP File click Browse and select your file Marking the Display debug information when running checkbox will cause debug views to be displayed 7 f necessary you can add argume
526. ww zend com en support center to get answers to frequently asked questions from the forums and knowledgebase articles 32 Getting Started Switching from Zend Studio 5 x to Zend Studio 7 x The following Switching from Zend Studio 5 x to Zend Studio 7 x quick guide is intended for users who have worked with the traditional Zend Studio and want to learn how to perform Zend Studio 5 x tasks in the new Zend Studio 7 x Contents Project File Creation Debugging Profiling Source Control Subversion SVN Project File Creation To create a new PHP project Zend Studio 5 x From the main toolbar select Project New Project The New Project Wizard dialog box will appear Enter a name for the new project The location is updated accordingly Click Next to define specific properties for the new project Click Finish Source Control CVS FTP Connectivity Database Connection Tunneling Zend Studio 7 x Go to File Menu and select New PHP Project Or In the PHP Explorer View right click and select New PHP Project The New Project wizard will open Enter a name for your new project into the Project Name field 3 Click Finish See the Creating Projects and Files tutorial for more information 33 Zend Studio 7 User Guide To create a new file Zend Studio 5 x Zend Studio 7 x From the Menu Bar select File New To create a new PHP file not associated File with a project my 1 Click the ne
527. xecution data includes function call trees arguments and return values function execution duration memory usage and indication for an executed files name and line of code This enables you to capture problems when they occur which eliminates the need to set up environments and reproduce the steps that led up to the failure Integrating Code Tracing into Zend Studio allows you to open the source of the execution data inside of your environment Code Tracing uses the Zend Server Code Tracer Perspective to allow you to view the trace data within your environment This feature is useful in resolving time performance issues memory performance issues and workflow errors In order to use the Code Tracing feature you must first export a Zend Server Event File from Zend Server and then import the Zend Server Event File into Zend Studio Once the Zend Server Event File has been imported you can open the source of trace data Important Note For more information about additional features and usability of Code Tracing see Code Tracing in the Zend Server Online Documentation The Code Tracing feature in Zend Studio allows you to do the following Export Trace Information Located in the Zend Server Online Documentation Import a Zend Server Event File Open the Source of Trace Data For more information see Working with Code Tracing The source of the execution data can only be opened in an environment in which the project already exists loca
528. xport Breakpoint wizard Select the relevant breakpoints and the name and location of the file to which they should be exported Note The Breakpoint bkpt file will not appear in Navigator PHP Explorer views 525 Zend Studio 7 User Guide ee ee Le Launch Configurations Imports a debug launch configurations file Tasks Task List and Contexts Export all Task List data useful for migrating workspaces Team Team Project Set Exports Imports a description of the repository and version control information for a set of projects For more on Team Project Sets see Sharing your workspace setup using Project Sets ML XML Catalog Exports an XML Catalog file Zend Server Preferences Imports server preferences from a server Servers preferences zsc file 526 Reference Edit Menu The Edit menu contains normal text editing functionality as well as features such as tasks and bookmarks which are specifically related to editing code The available from the Edit menu are Shortcut Description Undo Text Ctrl Z Undoes the last text edit in the active file e Redo Text Ctrl Y Redoes the last text edit in the active file Sa ee T ex It Leewen O emt oa See aetna OOOO Ctrl K Goes to the next instance of an item selected in the editor Ctrl Shiftt K Goes to the next instance of an item selected in the editor Incremental Ctrl J Finds character strings after before the cursor wit
529. xt to configure the project s Include Path this can also be done following the project creation 8 Click Next to configure the project s PHP Build Path this can also be done following project creation 434 Tasks 9 Click Finish The new PHP project will be created in your workspace and displayed in PHP Explorer View You can now start to develop your application by creating PHP Files or adding other resources to your project 435 Zend Studio 7 User Guide Downloading a Project from an Existing Connection This procedure describes how to download a project from an existing connection therefore making a local files available Before downloading a project from an existing connection you must have already created a remote server connection Creating a Connection via the Server View my To download a project from an existing connection Go to the Servers View Double click Connections Right click the relevant connection and click Import Project Select the Remote Source location Click Finish The project will appear on your workspace oF 2 res import Project Import Project from Remote Connection Select an existing location or create a new location required to connect with an existing remote connection my Rete zo zc Select E Use Defaut Location Options C Overwrite existing resources without warning O The source input can not be empty Please input or select a remote folder Alt
530. y a button on the views toolbar 6 Select a failed result to view it in the Failure Trace view Click the Filter Stack Trace K d icon to filter the results and view the relevant functions Double click the failed result to go to the relevant section in the code Correct the code save the file and run the test again by clicking the Run Last Test button in the PHPUnit view The tests should be successful If they are not repeat steps 6 8 97 Zend Studio 7 User Guide Creating and Running a PHPUnit Test Suite A number of different PHPUnit Test Cases can be unified into one UnitTest Suite file which will run all unit tests at once This function is useful if you have a few tests within a project which you would like to run at once S The following steps demonstrate how to create a PHPUnit Test Suite T 98 Create another Unit Test Case for your Calculator file by following steps 3 7 under Creating Unit Test Cases above Edit the test file to create different tests using your own tests or copy paste the example code into the file See the Working with PHPUnit Testing Tutorial in Zend Studio s Online Help for the example code Save the file From PHP Explorer View select and right click the Calculator project Select New Other PHP PHPUnit PHPUnit Test Suite A New PHPUnit Test Suite dialog will open Ensure that both your test cases are selected from the list Click Finish A ne
531. y out different functions on your projects including open close build and encode For more information on the build process see the topic in the Workbench User Guide This can be accessed from inside Zend Studio for Eclipse s Online Help by going to Help Help Contents or from the Eclipse Online Documentation site http help eclipse org ganymede index jsp The available from the Project menu are Shortcut Description Lone Project SS the currently selected project This option is enabled when a closed project is selected Close Project Closes the currently selected project Closing a project does not cause it to be deleted from the file system A closed project will still be displayed in PHP Explorer view with a closed project icon H but its resources are no longer accessible from within the Workbench Closing projects takes up less memory and speeds up the build process Build All Ctrl B This command manually invokes an incremental build on all projects in the Workbench This is only available if automatic build is not selected see below Build Project This command manually invokes an incremental build on any resources in the currently selected project that have been affected since the last build This is only available if automatic build is not selected see below Build This command manually invokes an incremental build on any Working Set resources in a working set that have been modified since th

Download Pdf Manuals

image

Related Search

Related Contents

standard licensing conditions for premises  Brodit ProClip 655028  USER MANUAL  Bosch ZX1-90 loudspeaker  

Copyright © All rights reserved.
Failed to retrieve file