Jump to navigation Jump to search

Uniform Server PHP IDE: IDE Overview

169 bytes removed, 23:21, 9 December 2010
Punctuation and grammatical changes; some clarification.
'''''PHP IDE Overview'''''
Notepad++ is Uniform Server PHP IDE ‘s IDE‘s main component is Notepad++ this . This is an excellent text editor and is well supported. There is Notepad++ has a wide range of easily installed plugins for Notepad++ our . Our IDE uses the following two plugings DBGp and NppExec. The XDebug client DBGp interfaces to the PHP Debug module providing interactive control for debugging. An integrated console window and command scripting is are provided by NppExec.
This overview covers the user interface, main debugging elements and menu options.
The IDE user interface consists of three windows:
'''''Edit Window'':'''
* Start IDE: Double click on file '''Run_IDE.bat'''
* Notepad++ runs and the edit window is displayed. This is where you enter and save scripts.
'''''Debug Window'':'''
* Click '''Debugger''' icon '''B)''' opens to open the debug window
* Debug window '''DBGp''' displayed '''C)'''
'''Console Window'''
* Click '''Show Console Dialog''' icon '''D)''' opens to open the console window
* Console '''E)''' window displayed
Resize You can resize and rearrange windows position as appropriate.
'''''[[#top | Top]]'''''
== IDE Commands - Macro and Context menu ==
IDE uses four command scripts these that perform the following functions:
{| cellpadding="2" cellspacing="1" style="background:#000000;"
|-valign="top" style="background:#f5f5f5;"
| '''''C'')''' '''Run PHP CLI Debug''' ||Execute currently displayed PHP script using the PHP interpreter configured for debugging. Debugging results displayed in debug window. Script results displayed in console window.
|-valign="top" style="background:#f5f5f5;"
| '''''D'')''' '''Run Script On Server'''  ||Run currently displayed PHP web page on server. Script is first saved and default browser redirected to page on server. Page is displayed in browser.
'''''[[#top | Top]]'''''
== Debug Window Overview ==
At first sight the debugger looks intimidating , however it really is easy to use. Start the IDE by running '''Run_IDE.bat'''
* Located in folder <whatever path you used>/'''us_portable_php_ide''' - Portable installation
* Or located in folder <whatever path you used>/'''UniServer\us_portable_ide''' - Plugin installation
* Set at least one break-point.
** D) Click on a line becomes highlighted
** E) Click Add '''breakpoint break point button'''<br>''Marks line with a red dot''<br>''If clicked again toggles to off''
** F) Entry displayed in list<br>''Right click list to delete all breakpoints''
* G) From macro select '''Run PHP CLI Debug'''
* Use the debugger toolbar or shortcut keys to control the debugger.
** H) Step Into - Proceed into functiosfunctions
** I) Step over - Proceed
** J) Step out - If you're in a function, skip the rest and go to return.
** K) Run to cursor - Automatically adds a break point and runs script up to the cursor.** L) Run - Runs to next breakpoint break point or script end
** M) End - Terminate debugging
** O) Eval - Allows you to change a variable
'''''Note'':''' Script output and errors are displayed in the cosole console window
'''''[[#top | Top]]'''''
== Change Value of a variable ==
=== Set a variable as follows ===
* ''Step A)'' Click the '''Eval button''' this which opens a pop-up
* ''Step B)'' In the pop-up enter a '''variable name''' and assign a '''new value'''. For example '''$a=222'''<br>Note : you do not need to add a semicolon.* ''Step C)'' Click '''OK''' this which performs an evaluation and opens a pop-up
* ''Step D)'' Pop-up displays result of evaluation. Unlike PHP's eval , the new value is immediately available to your script.<br>Script may update this variable as it runs.
* ''Step E)'' Click cross to close pop-up window.
'''''[[#top | Top]]'''''
== Watches ==
List The list of variables displayed in the Local Context may become large masking , obscuring a variable you want to constantly monitor.
Ideally you want to directly monitor a few variables ; this is achieved by using the Watches window. Add variables as appropriate to this window.
=== Add Watch ===
* ''Step A)'' Click Watch tab (bottom of DBGp window)
* ''Step B)'' Right click in this window and select '''Add watch''' which opens Add Watch pop-up
* ''Step C)'' In the pop-up enter variable to watch
* ''Step D)'' Click '''OK''' adds variable to watch window
'''''[[#top | Top]]'''''
== Xdebug Break function ==
For debugging you must set at least one break point. Currently we have a A default break point set when the debugger starts. This is set to break on first line of a scriptwhen the debugger starts.
Generally this This is suitable for most debugging applications however , but sometimes you want to start debugging in another page that is called from your main script.
=== Disable default break point ===
'''''Note 1'':'''
For debugging to take place , either manually set a break point in a page<br>or add the '''xdebug_break()''' function to the script.
'''''[[#top | Top]]'''''
== Alternative Console Window ==
Notpad++’s integrated console window is ideal for running and testing scripts that use standard I/O. However being integrated there are limitations hence on occasions you may want to use a real command window (console cmd). This is achieved by running a batch file that in turn runs a PHP CLI script.
=== Debug ===
The batch file runs our test script '''debug_test.php''' and any output or input is directed to the batch file command window. The script is debugged using Notepad++ however in this scenario the internal console window is not used.
'''''[[#top | Top]]'''''
== Summary ==
Next page looks at running [[Uniform Server PHP IDE: PHP CLI | PHP CLI scripts]] on this IDE.
'''''[[#top | Top]]'''''

Navigation menu