Gossamer Forum
Quote Reply
Dumper output
So if I use the GT::Dumper module in my plugin, where does the output go? Trying to debug a plugin...

Thanks.
Quote Reply
Re: [selk] Dumper output In reply to
Code:
use GT::Dumper;
print Dumper($data);

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [jagerman] Dumper output In reply to
Dear Jason,

Thanks for the quick reply.

That's exactly what I did in my code. But where does the print output go since I suppose it would be run under apache and there is no console.

It's just probably in one of the apache logs or somethin, but I wasn't able to see it so I suppose somebody would know right off the top of their head.

I'll keep looking though.
Quote Reply
Re: [selk] Dumper output In reply to
It will just print it out to the browser.

You might want to do: print $IN->header(); beforehand, just in case the header hasn't been printed yet.

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [jagerman] Dumper output In reply to
Hi,

Thanks, did it but still nothing happens.

Maybe my problem is I'm hooking up my plugin in the wrong place. I'm trying to create a plugin that will be invoked everytime there is a new entry to a forum, either new post, reply to an existing post, or editing an existing post. And I'm hooking it up on post_cant_attach method, as POST processing. Is this the right place to put the hook?

Thanks again.
Quote Reply
Re: [selk] Dumper output In reply to
The best way to do it would be to use hooks on do_post_post, do_post_reply_post, and do_post_edit_post, which correspond to GForum::Post::Write::post, GForum::Post::Write::reply_post, and GForum::Post::Write::edit_post, respectively.

The "post_cant_attach" plugin is simply used to determine whether or not you are allowed to make attachments to posts.

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [jagerman] Dumper output In reply to
Aha!!! Thank you very much. I'll give those a try.

BTW, as you can probably tell I'm new at this. I have gone through the docs, the 3 sample plugins, and even the sources in GForum themselves but I obviously missed them. Without you, I wouldn't have figured this out. How could have I done this myself? I'm asking because there maybe other hooks I'd be interested only if I know they existed.

Again, thanks for the tremendous help so far.
Quote Reply
Re: [selk] Dumper output In reply to
If you go into the admin panel and go to Setup -> Actions it lists all of the various actions (for example, post_write). EVERY action has a plugin hook on it - so, for example, do_post_write is the plugin hook on the "post_write" action.

Jason Rhinelander
Gossamer Threads
jason@gossamer-threads.com
Quote Reply
Re: [jagerman] Dumper output In reply to
Oh wow! There's plenty, I'm like a kid in a candy storeSmile

BTW, back to the original subject of the thread, I was able to get the Dumper output to work. It helped me a lot in figuring out what is passed in to my hook method. And I already finished my very first plugin, it wasn't painful at all!

Thanks again for all the help.