Re: plugins; was Re: [Catalyst] debug mode

2007-06-07 Thread Matt S Trout
On Wed, Jun 06, 2007 at 05:22:43PM -0700, mla wrote: > Assuming I'm not using threads, how would I hurt myself by > subclassing Catalyst and supplying a MyApp->context that returns > the current catalyst context? If you think magic globals are a good thing, I have a PHP interpreter to sell you. -

Re: plugins; was Re: [Catalyst] debug mode

2007-06-06 Thread mla
Matt S Trout wrote: On Wed, Jun 06, 2007 at 02:18:33PM -0700, mla wrote: Matt S Trout wrote: On Wed, Jun 06, 2007 at 12:29:12PM -0700, mla wrote: Is it not possible to offer the current Catalyst instance through a class method? Something analogous to Apache->request, rather than having to do t

Re: plugins; was Re: [Catalyst] debug mode

2007-06-06 Thread Matt S Trout
On Wed, Jun 06, 2007 at 02:18:33PM -0700, mla wrote: > Matt S Trout wrote: > >On Wed, Jun 06, 2007 at 12:29:12PM -0700, mla wrote: > >>Is it not possible to offer the current Catalyst instance through > >>a class method? Something analogous to Apache->request, rather than > >>having to do the whole

Re: plugins; was Re: [Catalyst] debug mode

2007-06-06 Thread mla
Matt S Trout wrote: On Wed, Jun 06, 2007 at 12:29:12PM -0700, mla wrote: Is it not possible to offer the current Catalyst instance through a class method? Something analogous to Apache->request, rather than having to do the whole ACCEPT_CONTEXT prototype object thing? Not without limiting ours

Re: plugins; was Re: [Catalyst] debug mode

2007-06-06 Thread Matt S Trout
On Wed, Jun 06, 2007 at 12:29:12PM -0700, mla wrote: > Matt S Trout wrote: > >On Tue, Jun 05, 2007 at 01:42:42PM -0700, Michael Reece wrote: > sub _ACTION : Pricvate { > my ($self, $c) = @_; > $self->_context($c); > $self->SUPER::_ACTION($c); > } > >>>That's not only

Re: plugins; was Re: [Catalyst] debug mode

2007-06-06 Thread mla
Matt S Trout wrote: On Tue, Jun 05, 2007 at 01:42:42PM -0700, Michael Reece wrote: sub _ACTION : Pricvate { my ($self, $c) = @_; $self->_context($c); $self->SUPER::_ACTION($c); } That's not only in the wrong place to work for begin/end/auto it screws up the destruction process and

Re: plugins; was Re: [Catalyst] debug mode

2007-06-06 Thread Matt S Trout
On Tue, Jun 05, 2007 at 01:42:42PM -0700, Michael Reece wrote: > >> sub _ACTION : Pricvate { > >>my ($self, $c) = @_; > >>$self->_context($c); > >>$self->SUPER::_ACTION($c); > >> } > > > >That's not only in the wrong place to work for begin/end/auto it > >screws up > >the destructio

Re: plugins; was Re: [Catalyst] debug mode

2007-06-05 Thread Michael Reece
On Jun 5, 2007, at 12:33 PM, Matt S Trout wrote: On Tue, Jun 05, 2007 at 08:04:03AM -0700, [EMAIL PROTECTED] wrote: if the catalyst base controller class provided an easy way to access $c from a utility method (vs an action method, which receives $c 'automatically'), then i think plugins mig

Re: plugins; was Re: [Catalyst] debug mode

2007-06-05 Thread Matt S Trout
On Tue, Jun 05, 2007 at 08:04:03AM -0700, [EMAIL PROTECTED] wrote: > if the catalyst base controller class provided an easy way to access $c > from a utility method (vs an action method, which receives $c > 'automatically'), then i think plugins might be a little less popular. Well, you can alread

Re: plugins; was Re: [Catalyst] debug mode

2007-06-05 Thread mreece
> if the catalyst base controller class provided an easy way to access $c > from a utility method (vs an action method, which receives $c > 'automatically'), then i think plugins might be a little less popular. > > some of my bits have ended up as controllers because i'd rather oops, s/controllers

plugins; was Re: [Catalyst] debug mode

2007-06-05 Thread mreece
if the catalyst base controller class provided an easy way to access $c from a utility method (vs an action method, which receives $c 'automatically'), then i think plugins might be a little less popular. some of my bits have ended up as controllers because i'd rather $c->twiddle_with_session()

Re: [Catalyst] debug mode

2007-06-05 Thread Charlie Garrison
Good morning, On 5/6/07 at 8:52 AM -0400, Matthew Pitts <[EMAIL PROTECTED]> wrote: >So... > >use Catalyst qw/ >+MyApp::Plugin::DebugMode >/; > >will load the MyApp::Plugin::DebugMode package. Without the '+' it would >try to find Catalyst::Plugin::MyApp::Plugin::DebugMode. > >Hope this he

Re: [Catalyst] debug mode

2007-06-05 Thread Brian Cassidy
Daniel McBrearty wrote: FWIW I just turn debug off, and do export MYAPP_DEBUG=1; script/myapp_server.pl -r; the -d option is so much easier to type :) script/myapp_server.pl -d -r -Brian ___ List: Catalyst@lists.rawmode.org Listinfo: http://lists

Re: [Catalyst] debug mode

2007-06-05 Thread Daniel McBrearty
FWIW I just turn debug off, and do export MYAPP_DEBUG=1; script/myapp_server.pl -r; as I am developing. As that line is always there in the command buffer it's no hassle. If I want I can have BEGIN { $ENV{MYAPP_DEBUG} = 1; } in test scripts. Basically i find just using one mechanism is easi

Re: [Catalyst] debug mode

2007-06-05 Thread Matt S Trout
On Tue, Jun 05, 2007 at 10:30:49PM +1000, Charlie Garrison wrote: > Good evening, > > On 5/6/07 at 1:17 AM +0100, Matt S Trout > <[EMAIL PROTECTED]> wrote: > > >>in lib/MyApp.pm: > >> use Catalyst qw/ > >+MyApp::Plugin::DebugMode > >>... > >>/; > > > >The + is important. > > Would you mind exp

Re: [Catalyst] debug mode

2007-06-05 Thread Matt S Trout
On Tue, Jun 05, 2007 at 08:40:52AM -0400, Matthew Pitts wrote: > On Tue, 2007-06-05 at 01:18 +0100, Matt S Trout wrote: > > On Mon, Jun 04, 2007 at 12:55:38PM -0700, Dylan Vanderhoof wrote: > > > Oh, missed this email. Yours looks better than mine. =) > > > > Except for being a performance hit o

Re: [Catalyst] debug mode

2007-06-05 Thread Matthew Pitts
On Tue, 2007-06-05 at 22:30 +1000, Charlie Garrison wrote: > Good evening, > > On 5/6/07 at 1:17 AM +0100, Matt S Trout > <[EMAIL PROTECTED]> wrote: > > >> in lib/MyApp.pm: > >> use Catalyst qw/ > >+MyApp::Plugin::DebugMode > >> ... > >> /; > > > >The + is important. > > Would you mind explai

Re: [Catalyst] debug mode

2007-06-05 Thread Matthew Pitts
ot; plugin would that improve the NEXT performance? Thanks, Matt > > > > -Original Message- > > > From: Matthew Pitts [mailto:[EMAIL PROTECTED] > > > Sent: Monday, June 04, 2007 8:23 AM > > > To: The elegant MVC web framework > > > Subject

Re: [Catalyst] debug mode

2007-06-05 Thread Charlie Garrison
Good evening, On 5/6/07 at 1:17 AM +0100, Matt S Trout <[EMAIL PROTECTED]> wrote: in lib/MyApp.pm: use Catalyst qw/ +MyApp::Plugin::DebugMode ... /; The + is important. Would you mind explaining that a bit further? Or pointing to documentation? When is it appropriate to use the + and

Re: [Catalyst] debug mode

2007-06-05 Thread Matt S Trout
On Mon, Jun 04, 2007 at 08:04:01PM -0700, [EMAIL PROTECTED] wrote: > > > > On Mon, Jun 04, 2007 at 12:55:38PM -0700, Dylan Vanderhoof wrote: > >> Oh, missed this email. Yours looks better than mine. =) > > > > Except for being a performance hit on every single method call on $c > > (there's > >

Re: [Catalyst] debug mode

2007-06-04 Thread mreece
07 8:23 AM >> > To: The elegant MVC web framework >> > Subject: RE: [Catalyst] debug mode >> > >> > >> > I wrote a cheap little plugin for my app to override >> > $c->debug to return >> > the debug flag from $c->config->{

Re: [Catalyst] debug mode

2007-06-04 Thread Matt S Trout
On Mon, Jun 04, 2007 at 05:47:32PM -0400, John Goulah wrote: > 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

Re: [Catalyst] debug mode

2007-06-04 Thread Matt S Trout
-Original Message- > > From: Matthew Pitts [mailto:[EMAIL PROTECTED] > > Sent: Monday, June 04, 2007 8:23 AM > > To: The elegant MVC web framework > > Subject: RE: [Catalyst] debug mode > > > > > > I wrote a cheap little plugin for my app to over

Re: [Catalyst] debug mode

2007-06-04 Thread Matt S Trout
On Mon, Jun 04, 2007 at 10:32:07AM -0400, John Goulah wrote: > What is the best way to deal with the -Debug flag between a production and > development environment? Obviously its not desirable to go into the file > and remove the flag every time the code goes to prod. I see you can start > the s

Re: [Catalyst] debug mode

2007-06-04 Thread John Goulah
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 ju

RE: [Catalyst] debug mode

2007-06-04 Thread Dylan Vanderhoof
Oh, missed this email. Yours looks better than mine. =) -D > -Original Message- > From: Matthew Pitts [mailto:[EMAIL PROTECTED] > Sent: Monday, June 04, 2007 8:23 AM > To: The elegant MVC web framework > Subject: RE: [Catalyst] debug mode > > > I wrote a ch

RE: [Catalyst] debug mode

2007-06-04 Thread Dylan Vanderhoof
Monday, June 04, 2007 7:51 AM To: 'The elegant MVC web framework' Subject: RE: [Catalyst] debug mode I thought a nice way would be to be able to specify it in the config file; then your _local.yml file could add it for the dev environment. Yet to pro

RE: [Catalyst] debug mode

2007-06-04 Thread Matthew Pitts
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 m

Re: [Catalyst] debug mode

2007-06-04 Thread Dave Rolsky
On Mon, 4 Jun 2007, John Goulah wrote: What is the best way to deal with the -Debug flag between a production and development environment? Obviously its not desirable to go into the file and remove the flag every time the code goes to prod. I see you can start the stanalone server with -d to

Re: [Catalyst] debug mode

2007-06-04 Thread Bernhard Graf
John Goulah wrote: > What is the best way to deal with the -Debug flag between a > production and development environment? Obviously its not desirable > to go into the file and remove the flag every time the code goes to > prod. I see you can start the stanalone server with -d to force > debug.

Re: [Catalyst] debug mode

2007-06-04 Thread mreece
i use the following in sandbox httpd.conf's: BEGIN { $ENV{MYAPP_DEBUG} = 1; } use MyApp; and s/1/0/ for prod. > What is the best way to deal with the -Debug flag between a production and > development environment? Obviously its not desirable to go into the file > and remove the fl

RE: [Catalyst] debug mode

2007-06-04 Thread mark
I thought a nice way would be to be able to specify it in the config file; then your _local.yml file could add it for the dev environment. Yet to produce a patch for that though it should be pretty straight forwards. Mark _ From: John Goulah [mailto:[EMAIL PROTECTED] Sent: 04 June 2007