#native_company# #native_desc#
#native_cta#

Getting Started with Jenkins for PHP Developers Page 2

By W. Jason Gilmore
on June 21, 2011

Exploring Jenkins Continuous Integration with PHP

With your project defined, it’s time to begin exploring Jenkins’ capabilities. After the project has been defined you’ll be returned to the project’s Jenkins home page. This home page includes a menu (see Figure 1) which you can use to perform various tasks, including building the project on-demand (you can automate the build process in various ways; the configuration page offers three such options), performing configuration changes, and notably, viewing build information.



Template for Jenkins Jobs for PHP Projects
Click here for larger image


Figure 1. Jenkins’ Project Menu

Try building your project by clicking the Build Now link, and after a moment you’ll see an entry appear in the project build log which is located directly below the menu. Click the entry link and you’ll be presented with some useful information regarding the build’s status (see Figure 2).



Template for Jenkins Jobs for PHP Projects
Click here for larger image


Figure 2. Reviewing a Project’s Build Status

This interface provides a bevy of useful information about the build, including the latest commit message and a variety of status updates pertaining to the plugins executed as defined by the Template for Jenkins Jobs for PHP Projects’ configuration file.

Reviewing Project Statistics

After completing a build a list of useful graphs (known as plots) will also be at your disposal, summarizing the total lines of code found in the project, the number of code structures (classes, methods, functions, etc.), various test targets (classes, methods, etc.), the average length of classes and methods, and much more. Figure 3 presents a screenshot depicting the total lines of code found in a new project.



Template for Jenkins Jobs for PHP Projects
Click here for larger image


Figure 3. Reviewing the Total Lines of Code Found in Your Project

Documentation Generation

Jenkins will by default generate API and code coverage documentation, in addition to a Web-based code browser. The documentation is placed in respective directories found in your project’s build directory. You can determine whether these generation features are enabled and additionally set the default directories from within your project’s configuration interface (see Figure 4).



Template for Jenkins Jobs for PHP Projects
Click here for larger image


Figure 3. Enabling Documentation Generation

Conclusion

Like PHPUnit, Git and XDebug, Jenkins and the Template for Jenkins Jobs for PHP Projects project offer PHP developers another great solution for effectively and efficiently building complex PHP-driven applications. Are you currently using Jenkins for your PHP applications? Tell us about your experiences in the comments!

About the Author

Jason Gilmore is founder of the publishing, training, and consulting firm WJGilmore.com. He is the author of several popular books “Easy PHP Websites with the Zend Framework”, “Easy PayPal with PHP”, and “Beginning PHP and MySQL, Fourth Edition”. Follow him on Twitter at @wjgilmore.