Re: [Catalyst] Trailing undef in uri_for()

2007-06-05 Thread Matt S Trout
On Mon, Jun 04, 2007 at 10:59:41PM -0700, Bill Moseley wrote: In a template I was using: c.uri_for( 'path', arg1, arg2 ); where arg1 and arg2 are sometimes not defined. In that case uri_for generates a url with two trailing slashes. Is there a reason to keep that behavior or

Re: [Catalyst] Trailing undef in uri_for()

2007-06-05 Thread Erik Broes
I think for '' the behaviour's correct. Not sure about undef, it doesn't strike me as a valid value. Thoughts, anyone? I think we can safely delete any trailing undef values. I agree for '' it should append /s. And it's as easy as: ### Remove trailing undef arguments. pop @args

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 Matthew Pitts
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 on every single method call on $c (there's a reason I keep telling people not

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 on every

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 explaining that a bit

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

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:

Re: [Catalyst] Catalyst::Plugin::Session, Facebook, and Custom Session ids

2007-06-05 Thread Jim Spath
Matt S Trout wrote: On Mon, Jun 04, 2007 at 11:44:50AM -0400, Jim Spath wrote: Is there any way to disable the validation of session ids? Seems like it would be a somewhat useful option for those cases (like interfacing with Facebook), where the session ids are pre-created. sub

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 helps. I

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

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,

Re: [Catalyst] Trailing undef in uri_for()

2007-06-05 Thread Matt S Trout
On Tue, Jun 05, 2007 at 06:20:33AM -0700, Bill Moseley wrote: Hum, I can see where a single '' would be useful if you wanted to do: $x = $c-uri_for( '/path', '' ); # include trailing slash $x .= 'foo'; # for /path/foo Although I'm not sure why you wouldn't

Re: [Catalyst] Trailing undef in uri_for()

2007-06-05 Thread Bill Moseley
On Tue, Jun 05, 2007 at 04:12:07PM +0100, Matt S Trout wrote: Although I'm not sure why you wouldn't just use '/foo' in that case. Nor am I, but for e.g. DAV presence of / is significat. Ya, my static plugin will do a redirect to /foo/ if the request is /foo and foo is a directory. So

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 already

[Catalyst] PostgreSQL connect error

2007-06-05 Thread 张淼
#MyAPP name is NIC, #NIC/lib/NIC/Model/NiscDB.pm package NIC::Model::NiscDB; use strict; use base 'Catalyst::Model::DBIC::Schema'; __PACKAGE__-config( schema_class = 'NiscDB', connect_info = [ 'dbi:Pg:dbname=niscdb;host=210.42.1**.***', 'user', 'password', ], );

[Catalyst] Re: running a function once on all requests

2007-06-05 Thread A. Pagaltzis
* Eden Cardim [EMAIL PROTECTED] [2007-06-04 22:15]: sub auto : Private { my($self, $c) = @_; push @{$c-stash-{controllers}}, $self-namespace; return 1; } # in Root sub end : Private { my($self, $c) = @_; $c-stash{controller} = $c-stash-{controllers}[0]; } Not that this