Pro PHP- Patterns, Frameworks, Testing and More

(vip2019) #1

(^124) CHAPTER 8 ■ TESTING, DEPLOYMENT, AND CONTINUOUS INTEGRATION


Remote Debugging with Xdebug.


Finally, Xdebug offers a way for integrated development environments (IDEs) to communicate
with a running PHP script. It provides a communications channel that will let your IDE step
through PHP scripts and analyze them. Every environment is different, so following the specific
documentation for your IDE is crucial.
You can also use command-line debuggers, such as the official debugclient that is bundled
with Xdebug. However, I strongly suggest a graphical approach to this type of debugging. The
PDT project for Eclipse and ActiveState Komodo IDEs both support remote debugging with
Xdebug.
When working with an attached debugger, the xdebug_break() command forces a break-
point. Good places to use this function would be in an error-handler function or in a global
exception catch block.

Just the Facts


In this chapter, you looked at some useful techniques that help you build, test, and manage
PHP applications.
Subversion provides revision control. After you create a repository and checkouts, you can
work with files under revision control.
PHP helps you perform unit testing with PHPUnit, following an object-oriented approach.
Phing automates your build and deployment steps. You can use it to create targets to update a
Subversion checkout, run unit tests, copy files to a beta testing site, and deploy to production.
Xinc is a continuous integration server that can help you to monitor changes to the Subversion
repository and continuously integrate your project with Phing build scripts. By combining Xinc,
Phing, PHPUnit, and Subversion, you can create a comprehensive development environment
that will help you solve common development process challenges.
Xdebug can provide you with some very useful debugging information, including code
tracing, profiling, code coverage, and remote debugging.

McArthur_819-9C08.fm Page 124 Friday, February 22, 2008 9:06 AM

Free download pdf