Using XDebug for PHP Development

Well, this post is a slight shift from Mods for HESK development, as this article isn’t directly about Mods for HESK, but instead is a tool I’m now using for Mods for HESK development.  This tool, in conjunction with PhpStorm (the IDE I’m using for development), is called XDebug.  Most IDEs for other languages, such as Eclipse or IntelliJ IDEA for Java, has debugging out-of-the-box. Unfortunately, PHP doesn’t have this. This is where XDebug comes in.  Since this is a somewhat annoying process, here’s how I got working (note that I am using a Mac running OS X 10.10 Yosemite).

1. Install XDebug using Homebrew – Using Homebrew to install XDebug is the easiest way to get started. Simply run “brew install php55-xdebug” to install XDebug for PHP 5.5 (use php54 or php56 for PHP 5.4 or PHP 5.6, respecively)

2. Update php.ini for XDebug – Open php.ini using a text editor (such as TextWrangler), and add the following lines at the bottom:

[Xdebug]
zend_extension=/usr/lib/php/extensions/no-debug-non-zts-20121212/xdebug.so
xdebug.remote_enable=1
xdebug.remote_host=<URL to PHP installation>
xdebug.remote_port=<port to broadcast>

Save your php.ini file and restart Apache / PHP

3. Setup PHPStorm – In PHPStorm, near the top-right is an icon of a telephone with a bug. This, when clicked, will listen for incoming XDebug sessions, and attach to your file. Once this is clicked, startup your server and navigate to your breakpoint!

This is a quick rundown and keeps out some basic parts, but it takes care of some of the annoying parts!

[2.3.0] Service Message Icons

Well, I finally found some time to start working on version 2.3.0 of Mods for HESK. First item in the list is something I wanted to include way back in 2.1.0, but there were some technical issues causing this feature to be released in 2.3.0. Well here it is: service message icons.

The manage service messages page will have a new field added, known as the “Icon” field. Here you can select any Font Awesome or Octicon icon to accompany your service message text, regardless of the type of message (success, info, etc).

Screenshot of Service Messages

The icon dropdown, which is powered by a modified version of the bootstrap-iconpicker GitHub repository, allows you to easily see what the icon is and what it will look like using an easy-to-use interface.  If you don’t want an icon to accompany your service message, simply select “No icon”.  Clicking on the “Success”, “Info”, “Notice”, or “Error” styles will automatically change the icon to the style’s default icon (which is currently used in Mods for HESK 2.0.0 to 2.2.1) to hopefully make it easy to quickly create a new service message.

When this feature is released, will you be using custom icons for service messages?