21
hervet
Re: PHP-Debugging without XOOPS
  • 2009/8/8 17:08

  • hervet

  • Friend of XOOPS

  • Posts: 2267

  • Since: 2003/11/4


Quote:

frankblack wrote:
V1.3 is released

This is really the best enhancement for XOOPS developpers !

22
kaotik
Re: PHP-Debugging without XOOPS
  • 2009/8/8 17:19

  • kaotik

  • Just can't stay away

  • Posts: 861

  • Since: 2004/2/19


I've been tring to do the following:
Assume you want to log a variable you just have to write the following:
$firephp->log($yourvariable);
I've followed the previous steps and have firephp console open, where do I see my variable?
Thanks

23
frankblack
Re: PHP-Debugging without XOOPS
  • 2009/8/8 17:21

  • frankblack

  • Just can't stay away

  • Posts: 830

  • Since: 2005/6/13


Quote:
This is really the best enhancement for XOOPS developpers !


Feels like an accolade to hear this from you. Really! I admire your whole work, so this compliment makes me feel proud.

But I am not quite satisfied, because of some quirks like uncaught exceptions thrown inside XOOPS, which I can't track down.

Inside Frameworks/FirePHPCore I kept the original firephp class, if you want to revert getting exceptions caught. There are even PHP 4 classes in it, but I wasn't interested to write docs for them as well.

24
frankblack
Re: PHP-Debugging without XOOPS
  • 2009/8/8 17:28

  • frankblack

  • Just can't stay away

  • Posts: 830

  • Since: 2005/6/13


Quote:

I've been tring to do the following:
Assume you want to log a variable you just have to write the following:
$firephp->log($yourvariable);
I've followed the previous steps and have firephp console open, where do I see my variable?
Thanks


Hmm, my docs are a bit incomplete. First of all you have to activate "console" and "network" on the Firebug console. Logging your own variables in your modules need some extra.

I assume you have a header.php or anything like this getting included in every file you use?

Add the following code to your header.php:
require_once XOOPS_ROOT_PATH.'/Frameworks/FirePHPCore/FirePHP.class.php';
$firephp FirePHP::getInstance(true);
$firephp->registerErrorHandler(false);


Add this now to your file where you want the variable to be logged:
$firephp->log($yourvariable);


If used inside a function you have to add global $firephp; of course.

This should do the trick. You see the logs under the tab console.

25
kaotik
Re: PHP-Debugging without XOOPS
  • 2009/8/8 17:50

  • kaotik

  • Just can't stay away

  • Posts: 861

  • Since: 2004/2/19


Sorry about nagging, I folowed your previous steps.
here's my code:
include '../../mainfile.php';
require_once 
XOOPS_ROOT_PATH.'/Frameworks/FirePHPCore/FirePHP.class.php';
$firephp FirePHP::getInstance(true);

include 
XOOPS_ROOT_PATH.'/header.php';

$hello='betty boop';

$firephp->log($hello);

echo 
'testS';

include 
XOOPS_ROOT_PATH.'/footer.php';
?>


and here's a screen capture of my firebug. Where can I see my var $hello ?

26
frankblack
Re: PHP-Debugging without XOOPS
  • 2009/8/8 17:54

  • frankblack

  • Just can't stay away

  • Posts: 830

  • Since: 2005/6/13


Make sure Net and Console are activated. There is besides both a small triangle. Click this small triangle you'll get a pulldown where you can activate Net or Console. I see on your image that Net is not activated. The logs you'll see under the tab Console.

Did I mention that I am a bad teacher? Or doc writer?

27
kaotik
Re: PHP-Debugging without XOOPS
  • 2009/8/8 18:04

  • kaotik

  • Just can't stay away

  • Posts: 861

  • Since: 2004/2/19


It works!!! Wow, this looks very promising!
I should have been using something like this for a long time, would have saved me all those print_r()

28
kaotik
Re: PHP-Debugging without XOOPS
  • 2009/8/8 18:05

  • kaotik

  • Just can't stay away

  • Posts: 861

  • Since: 2004/2/19


Thanks frankblack for this great work!

29
Mamba
Re: PHP-Debugging without XOOPS
  • 2009/8/8 22:31

  • Mamba

  • Moderator

  • Posts: 11373

  • Since: 2004/4/23


Quote:
Thanks frankblack for this great work!

I second that! Awesome work!

And very much needed for XOOPS developers!
Support XOOPS => DONATE
Use 2.5.10 | Docs | Modules | Bugs

30
frankblack
Re: PHP-Debugging without XOOPS
  • 2009/8/8 22:47

  • frankblack

  • Just can't stay away

  • Posts: 830

  • Since: 2005/6/13


Not I did the awesome work, but the guys from Firefox, FireBug and FirePHP. I just made the quick and dirty hack. I am not fishing for compliments. Everyone else could have done this. This solution was born out of my own frustration that xajax and XOOPS were confusing each other with their debug methods.

So this was a waste product of my efforts on the work at my module. There are about two other waste products that could lead to other modules if I had the time. Maybe one day ...


Login

Who's Online

894 user(s) are online (85 user(s) are browsing Support Forums)


Members: 0


Guests: 894


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits