Netbeans, Symfony, Xdebug and the magical file_link_format

Flattr this
Tweet this: Netbeans, Symfony, Xdebug and the magical file_link_format
Dent this: Netbeans, Symfony, Xdebug and the magical file_link_format
Datum: 08.11.2011 19:48:59
Originally I was looking for a solution to get Chromium to open Files in Netbeans directly from symfony1 stack traces, because some time ago in a video I had see how it was done for other editors. Originally I was looking for a solution to get Chromium to open Files in Netbeans directly from symfony1 stack traces, because some time ago in a video I had see how it was done for other editors. Here we have two screenshots for a symfony1 stack trace, which is shown in dev-mode when an error happens or an exception is thrown but not caught and a xdebug stack trace:
  • Symfony1 error strack trace with netbeans links
  • And a xdebug stack trace with netbeans links
For symfony1 to create the links you need the following in settings.yml
all:
  .settings:
    file_link_format:       netbeans://%f?line=%l
For xdebug you need to have html_errors = On in your php.ini set xdebug.file_link_format
xdebug.file_link_format = "netbeans://%f?line=%l"
The next thing we need to do is to create a new url-handler in Gnome's gconf.
gconftool-2 -t string --set /desktop/gnome/url-handlers/netbeans/command "/path/to/netbeansprotocol.sh %s"
gconftool-2 -t bool --set /desktop/gnome/url-handlers/netbeans/enabled true
gconftool-2 -t bool --set /desktop/gnome/url-handlers/netbeans/needs_terminal false
netbeansprotocol.sh will do the parsing - a snippet I found in my desktop-wiki from a search for the same problem some time ago - it probably can be done in a nicer way - but it works (for me).
#!/bin/bash

url=$2
file=${url#*\/\/}
file=${file%?line=*}
line=${url#*line=}

/home/robo47/netbeans-7.0/bin/netbeans --open $file:$line
Further Links:

Trackbacks (0)

Trackbackurl: http://www.robo47.net/trackback/blogentry/210

Es sind keine Trackbacks vorhanden.


Kommentare (0)

Es sind noch keine Kommentare vorhanden.

Die Kommentare zu diesem Beitrag sind gesperrt.

You liked it ? Link it on your homepage or blog: