PhpED: PHP IDE
new features
features
version comparison
features: php tools
php debugger
php profiler
php frameworks
php scripts
features tour
licensing
php testing
PhpED difference
PhpED on Mac/Linux
testimonials
PhpDock
Nu-Coder
PhpExpress
TechPlatform

Ajax PHP Debugging with DBG PHP Debugger

At this point you should have your Ajax and PHP XOAD framework set in PhpED's Project. If you don't - please read Ajax PHP Project part of this tutorial. You can now learn about the design of Ajax PHP frameworks with PhpED's PHP Debugger.

How to run Ajax based PHP in debugger

If you look at the source of the output generated by index.php you will see plenty of JavaScript code. This figure shows how this source can be seen in PhpED's PHP Viewer Ajax PHP Source
To find out which calls to XOAD generated this JavaScript:
  • Open index.php in PHP Editor
  • Select Run in Debugger button on PhpED ToolBar (F9)
  • Open Output window of PHP Debugger. As you step through the lines of code you will see that JavaScript is generated by the call to XOAD_Client::register( new FirstClass())
Ajax PHP JavaScript Source
If you want to see the source for XOAD_Client::register method, simply place the cursor on the the call to XOAD_Client::register and select Find Declaration (Shift+F12) on the popup menu.
PHP IDE will open the source for the method in the editor.
Ajax PHP Find Source

How to debug Ajax server side calls to PHP

Ajax is used to make server side calls to PHP scripts. As you can guess typical Ajax PHP Framework like XOAD implements the mechanism for such calls and hides the details of the implementation from the application. But you still need to debug the methods of your PHP classes on the back end. How can you make the program stop when your back end class method is called from Ajax? With DBG PHP Debugger this becomes a simple task:
  • Place a call to DebugBreak() function in the method
  • Run the script.
  • When Ajax makes the call to your method, PHP Debugger will stop the execution
Ajax PHP Break
As you can see on the figure above PHP Debugger helps you learn everything about the way your back end method is called. You can:
  • See the values assigned to the variables
  • Change the values of the variables on the fly right in the debugger window
  • Look at the call back of your method and open the calling methods and classes by simply double clicking on the stack
Ajax PHP Call Stack

In this tutorial you learned how to take advantage of PhpED debugger features to greatly reduce the time spent on learning how PHP Frameworks work. Additional technical information is available from the NuSphere Forum. Download a free trial of our PHP IDE with PHP Code completion today!

 Download NuSphere PHP IDE

Download a free trial of the fast PHP EDitor and robust Integrated Development Environment for PHP.

 Buy NuSphere PhpED® now

Best PHP Editor and complete PHP IDE.
NuSphere PhpED 21.0 is available from our online store front.
"To be honest its bloody awesome, I have looked at loads of PHP editors and this is THE only one that actual works straight out of the box!!! Brilliant, well done."
Andrew Breward,
Director of Technology
caboodal.com

 Guide

Walk through NuSphere PhpED interface
PhpED video tutorial: Webservices
Learn how to add webservices to your code in less than 5 minutes (a flash demo).

 Special Team4 Offer

Get 4 copies of PhpED for the price of 3!

Optimum solution for development teams.
PhpED 21.0 Team4
Need more than 4 licenses? Contact Us for more quantity discounts, please use "Ordering/Payment issue" subject on the form.

 Dr. Dobb's

Dr. Dobb's

Dr. Dobb's Magazine covers NuSphere PhpED in New and Noteworthy section.

 InfoWorld

infoworld.com
PhpED is a proper, world-class IDE for PHP code. It is the only IDE worth considering if PHP development is your primary job