Reply to comment

"Verstecktes" debugging mit FirePHP

Wer kennt es nicht... irgendwas läuft mal wieder im PHP-Projekt falsch und sei es nur ein kleiner Randfall. Oft weiß man schon, wo der Fehler liegen könnte, aber Beweise müssen her!

Hat man keinen umfangreichen Debugger (wie den Zend Debugger oder Xdebug) zur Verfügung oder ist dessen Einsatz ein Schuss mit Kanonen auf Spatzen, helfen nur Debug-Ausgaben um den Anfangsverdacht zu prüfen.

Schlecht nur, wenn die Kollegen gerade am selben projekt arbeiten und man sie nicht durch hässliche Debugausgaben ärgern möchte.

Hier hilft "FirePHP", welches versteckt Botschaften aus dem HTTP-Header empfängt und in der Firebug-Konsole darstellt.
Theoretisch kann sogar im Testbetrieb der korrekte Ablauf des Scriptes überprüft werden (Achtung, im laufenden Betrieb ist das gefährlich, schließlich können alle Clients die Ausgabe lesen, außer ihr beschränkt das Debugging dies auf euer Benutzerkonto (den Output per PHP)!)

Wie ihr das Tool verwenden könnt, wird auf der Projekthomepage unter:
http://www.firephp.org/
beschrieben. Daher spare ich mir jetzt genauere Erläuterungen.

Als weiteren Tipp möchte ich euch auch die Komponente "Zend_Log_Writer_Firebug" des Zend Framework an die Hand geben. Damit sind entsprechende Ausgaben in kürzester Zeit erledigt und ihr könnt eine saubere Anknüpfung an eventuell vorhandene Log-Module vornehmen!

Viel Erfolg mit diesem coolen Helferlein Wink

Reply

The content of this field is kept private and will not be shown publicly. If you have a Gravatar account associated with the e-mail address you provide, it will be used to display your avatar.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Internal paths in single or double quotes, written as "internal:node/99", for example, are replaced with the appropriate absolute URL or path. Paths to files in single or double quotes, written as "files:somefile.ext", for example, are replaced with the appropriate URL that can be used to download the file.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd><blockquote>
  • Lines and paragraphs break automatically.
  • Pairs of<blockquote> tags will be styled as a block that indicates a quotation.
  • You can enable syntax highlighting of source code with the following tags: <c>, <cpp>, <css>, <drupal5>, <drupal6>, <java>, <javascript>, <mysql>, <php>, <python>, <ruby>, <smarty>, <xml>. The supported tag styles are: <foo>, [foo]. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.
  • Textual smileys will be replaced with graphical ones.
  • Each email address will be obfuscated in a human readable fashion or (if JavaScript is enabled) replaced with a spamproof clickable link.

More information about formatting options

Type the characters you see in this picture. (verify using audio)
Type the characters you see in the picture above; if you can't read them, submit the form and a new image will be generated. Not case sensitive.