On 6/4/07, Matthew Pitts <[EMAIL PROTECTED]> wrote:

I wrote a cheap little plugin for my app to override $c->debug to return
the debug flag from $c->config->{debug}. As such:

package MyApp::Plugin::DebugMode;

sub debug {
    my $c = shift;

    return $c->config->{debug} || 0;
}

1;

Then I just add a "debug: 1" line to my DEV/QA/UAT configs and make it
"debug: 0" for my PROD config. It's been working pretty well for me.




Did you have to do anything in lib/MyApp.pm  to get this to work?  It seems
I would want to add this plugin, but Catalyst cant find it.  I'm probably
doing something very obviously wrong, but I havent tried to write my own
plugins yet:

in lib/MyApp.pm:

use Catalyst qw/
MyApp::Plugin::DebugMode
...
/;


when I start the server:
Can't locate Catalyst/Plugin/MyApp/Plugin/DebugMode.pm in @INC


Thanks!
John
_______________________________________________
List: Catalyst@lists.rawmode.org
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.rawmode.org/
Dev site: http://dev.catalyst.perl.org/

Reply via email to