This is a very first stab at a plugin that provides FirePHP integration for Moodle. It follows a similar approach as the one suggested in MDL-16371 but instead of patching core Moodle code it follows a modular plugin approach.
That way, it can provide some basic access control and configurabiltiy.
Basically, the plugin does the following:
1) integrating the FirePHP Core Library from http://www.firephp.org
2) dumping the content of the four global Moodle variables ($CFG, $SITE, $USER and $COURSE) to the FirePHP console, where they can be inspected using FirePHP's powerful Variable Viewer (see screenshot)
3) redirecting error and exception handling to Firebug
For more information see:
http://www.firephp.org/HQ/Learn.htm
http://www.firephp.org/HQ/Use.htm
The plugin still leaves much to be desired:
* better configurability (at the moment the plugin can only be globally activated/deactivated site wide)
* better integration with build in Moodle debugging features
* full use of language strings for localisation
Any comments and suggestions for improvement are welcome!
Kind regards,
Frank
You can download the code under www.nakohdo.de/downloads/firephp.zip

thou, i had a little issue with it.
i was getting FATAL uncaught exception... error
so i had to remark line 2664 inside lib/weblib.php
//ob_end_clean();
now it works great and it even helped my get some info i was needing
from the $COURSE global var. (thanks)
ob_start("header");
include($CFG->header);
$output = ob_get_contents();
ob_end_clean();
ob_start();
so it will not break Moodle's visual theme display
if i disable the block.
Actually, it should be the responsibility of the plugin not to produce errors
Cheers,
Frank
Here's a short instruction on installing the plugin (taken from http://dev.moodle.org/mod/forum/discuss.php?d=363&parent=805):
For properly installing and enabling the plugin do the following:
1) Click on "Notifications" in the Site Admin menu
2) Enable the plugin under Modules > Blocks > FirePHP
3) The plugin is a block, so you have to turn Editing on and add the FirePHP block to a course. The block only shows whether FirePHP is activated or not.
4) For security reasons the block will only be active for users with administrator rights.
There are still some problems regarding output buffering. So if you got an error message you might try setting output_buffering = On in the php.ini file (note: for XAMPP this file lives in \apache\bin\php.ini). See also Installing Moodle/Creating custom php.ini files.
And here's the discussion about that issue from the FirePHP forum:
"FirePHP on Frameworks which makes use of ob_start()"
http://n2.nabble.com/FirePHP-on-Frameworks-which-makes-use-of-ob_start%28%29-tp2510006p2510006.html
How do you add the FirePHP block into a course? Is it an activity or Resource?
Thanks.
Then the FirePHP block should show up in the list of blocks in the "Add Block" block when you have turned editing on.
hth
Frank
But now an error appears when I try to add the block:
Fatal error: Exception
thrown without a stack
frame in Unknown on
line 0
This is also stopping me to add more blocks to my moodle pages because it replaces the add block dropdown list. I have my debugging options set to NORMAL. If I take the debugging options off the add block just disappears along with the error message.
Thanks for testing the plugin and your feedback. I could reproduce this error on my new installation of Moodle 2.0 dev (Build: 20090423) (2009041700). Which version do you use? Will try to find the bug.
Cheers,
Frank
I'm currently using Moodle version 1.9.4
I recently very gald of finding the FirePHP-Plugin for moodle, because I already tried to get FirePHP working by editing the moodle php code but it didn't work. (I'm a student of software engineering and woking on my term paper now. For that I need to modify the assingment module of my moodle installation.)
Now I moved the FirePHP-code to the folder \blocks and turned it on (as mentioned in the above). But as I added the block to my curse I got the same error than Pedro did.
Fatal error: Exception thrown without a stack frame in Unknown on line 0
And nothing happens now in the Firebug console window when I do anything. Is there a fix now?
Kind regards, Markus
Sorry for my late reply. Please do the following to get the plugin working:
1) Download the latest version of the FirePHP server library (FirePHPCore 0.3.2 ) from http://www.firephp.org and copy the "FirePHPCore" folder in the firephp block's folder (thereby overwriting the old versions).
2) You probably will still get an error message like the one in the screenshot which already hints at the problem. Try activating output buffering in your servers php.ini file as recommended by setting "output_buffering = ON".
hth
Frank

www.nakohdo.de/downloads/block_firephp19.zip
www.nakohdo.de/downloads/block_firephp20.zip

Hi Frank,
This is excellent work, thanks. I'll be giving it a try, particularly as I work on Javascript stuff like SimpleSpeak. A few requests:
- Can you put the code up on Github, so the community can help out, and for easier tracking of fixes? See Git for contrib in the Wiki.
- Can you add the plugin to the database please?
Thanks again. Best wishes,
Nick
https://moodle.org/mod/data/view.php?d=13&rid=4793
(but still a work in progress)
I get a "you do not have permission to view this plugin" error on that page. I presume it's because it's still waiting for approval?
Thanks for your interest in the plugin. You're right, that message is caused by the plugin still having passed the approval process. However, as the code lives on GitHub anyhow you can get the code from there: https://github.com/nakohdo/moodle-block_firephp
Frank
Tried an install on 2.03 (20110518) and got the following error. I get it with the "local" version posted at the end of this thread also:
Thanks for the feedback. Will look into this asap.
Cheers,
Frank
I cannot reproduce the error. The block works ok after updating my Moodle to 2.03+ and also after re-installing the block. Have you checked whether all your Moodle core files are intact?
Cheers,
Frank
I reloaded all and got it working. Thanks.
I have
output_buffering no value no value
output_handler no value no value
For output_buffering the values must be ON?
And for output_handler wich values must be set? ON?
Thank´s in advance
Here is the Brazilian Portuguese translation for the firephp block.
Thanks for this - it's really nifty to be able to have the core variables available in Firebug when developing
Frank,
I've made a slightly modified version of your block packaged as a local plugin, the idea being that it loads FirePHP in the lib.php, and the functions are then available for use in your code. At the moment, I've set it to use static calls (e.g. FB::info()) so save having to do "global $firebug;" in functions.
The disadvantages are that you can't automatically log $COURSE since lib.php is executed before it's set up, and you can't (as far as I can tell) enable error and exception handling.