I’ve been developing on a mac since I was at university in 2002 but this was mainly for personal projects as I used Windows/Ubuntu at work. Recently I’ve managed to convert my work machine into a macbook pro, so I wanted to start using Safari as the browser of choice. The development tools available are fantastic, and they are built right into the browser.
One of the main tools I use on a daily basis is Eclipse PDT which integrates into Xdebug out of the box, however sometimes you simply don’t want to be using such a heavy IDE. I’ve started to use MacDBGp from Blue Static and TextWrangler from Bare Bones Software, and together they provide a lightweight alternative to Eclipse. One of the nice feature of Eclipse however is the auto start of Xdebug debugging by appending XDEBUG_SESSION_START=1 onto the url. There are a couple of plugins for Firefox that allow you to do this in the browser, however there are none for Safari.
You can download the extension here
Once you have installed the extension you will get a bug like icon in the toolbar:
From this point on it is business as usual to step through the application
This extension also works with all debuggers such as Eclipse PDT, vim and others etc, as it simply sets the cookie needed for Xdebug to know to start the debugging session
Any issues please raise them here
I have now updated Xdebug Toggler to cater for the IDE keys. So please download the latest version above. Once you have done this you should be able to enter Safari Preferences and set the IDE Key: