Re: [Catalyst] Bug with $c-request-query_keywords ?

2008-07-19 Thread Matt S Trout
On Thu, Jun 19, 2008 at 12:33:44PM -0600, Larry Leszczynski wrote:
 I've run into what appears to be a query keyword bug using Catalyst
 5.701[02]:
 
% catalyst.pl MyApp
% cd MyApp
% perl script/myapp_server.pl
 
 Request:
 
http://localhost:3000/ - works
http://localhost:3000/?a=123   - works
http://localhost:3000/?123 - fails
 
 The error message is:
 
[error] Caught exception in engine Can't locate object
method query_keywords via package Catalyst::Request
at /Library/Perl/5.8.8/Catalyst/Engine.pm line 446.

You've got half a Catalyst::Runtime install of one version and half
another.

-- 
  Matt S Trout   Need help with your Catalyst or DBIx::Class project?
   Technical Directorhttp://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/http://www.shadowcat.co.uk/servers/

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Capture page on server?

2008-07-19 Thread Matt S Trout
On Tue, Jun 24, 2008 at 12:23:05AM +0800, Martin Ellison wrote:
 I actually want to save a static copy of the front page to improve load
 times. My fastcgi process sometimes disappears (I'm on shared hosting and I
 think they auto-cancel stale processes), and it takes a while for the
 process to be restarted, which impacts the first page load. Subsequent pages
 are faster but it's the first page that makes the impression on the user.
 The static plugin does not work, because that requires fastcgi to be
 running, and my app is too small for me to set up squid.
 
 So I want to redirect the front page to a static page, but regenerate the
 static page, and also force the app to do something (so the server can
 restart the fastcgi process before the user requests any other page).

Catalyst::Plugin::PageCache ?

-- 
  Matt S Trout   Need help with your Catalyst or DBIx::Class project?
   Technical Directorhttp://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/http://www.shadowcat.co.uk/servers/

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] [Fwd: [rt-users] Security vulnerability in RT 3.0 and up]

2008-07-19 Thread Matt S Trout
On Mon, Jun 23, 2008 at 01:17:15PM -0400, Lance A. Brown wrote:
 H.   Is this something Catalyst needs to worry about?

StackTrace only activates for Catlyst in debug mode.

If you're deploying your app publically in debug mode, you have more than
this to worry about (like exceptions showing your DBI connect info :)

-- 
  Matt S Trout   Need help with your Catalyst or DBIx::Class project?
   Technical Directorhttp://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/http://www.shadowcat.co.uk/servers/

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Catalyst::Authentication::Credential::LDAP

2008-07-19 Thread Matt S Trout
On Wed, Jun 25, 2008 at 11:27:13AM -0700, Bruce J Keeler wrote:
 Also, somewhat apropos, I have a 
 C::A::{Store,Credential}::ActiveDirectory  that I based on the LDAP 
 stuff.  The LDAP modules didn't work for me because they want to bind 
 anonymously and retrieve the crypted password, whereas AD just wants to 
 authenticate with a bind.  My stuff also gets role information from AD 
 groups.  I've been meaning to get it out on CPAN one of these days, but 
 it hasn't been a priority; I suppose I can work on it if anyone else 
 needs it though.

Sounds to me like 'auth by bind' versus 'auth by retrieve and check' should
be an option in the LDAP stuff, not a separate module. Fancy doing up
a patch?

-- 
  Matt S Trout   Need help with your Catalyst or DBIx::Class project?
   Technical Directorhttp://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/http://www.shadowcat.co.uk/servers/

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] [Announce] Catalyst-Runtime 5.7099_01 - Developer Release

2008-07-19 Thread Matt S Trout
On Thu, Jun 26, 2008 at 06:50:58PM -0400, Charles Bailey wrote:
 On Wed, Jun 25, 2008 at 4:57 PM, Marcus Ramberg [EMAIL PROTECTED] wrote:
 
  The feature to note here is 'go', which works like an internal redispatch to
  another action, while retaining the stash intact. Being able to do this
  means that in practice you don't ever need to set the template name in
  stash, but can depend on using go when you want to render the template of
  the other action, rather than the one you dispatched to.
 
 Would it make sense to include a function analogous to forward() (say,
 visit()) in the same way that go() is analogous to detach()?  Seems
 like it'd be a nice way to wrap an action that uses auto() or end()
 in its controller to handle tasks common to several actions there.

Maybe. How about doing up a patch for catalyst-dev@ ?

-- 
  Matt S Trout   Need help with your Catalyst or DBIx::Class project?
   Technical Directorhttp://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/http://www.shadowcat.co.uk/servers/

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Accessing schema in non-DBIC-model

2008-07-19 Thread Matt S Trout
On Tue, Jul 01, 2008 at 02:49:37PM +0200, Tobias Kremer wrote:
 I'm using Catalyst::Model::DBIC::Schema to make my DBIC schema available as
 model in my Catalyst application. Now I'd like to create a custom model (e.g.
 MyApp::Model::Custom) which during the server start fetches and calculates 
 some
 stuff from the database via my DBIC schema and keeps it in the object to speed
 up retrieval in my Cat app. I want to do:
 
 my $rs = $c-model( 'Custom' )-find_by_foo( $foo )
 
 and get back a (e.g. MyApp::Schema::Foo) ResultSet with stuff fetched during
 server start that fits the condition $foo.
 
 My problem is that I can't think of an elegant way to access the initialized
 schema from within the models new or COMPONENT method (which is called during
 server start when the model is set up). I tried this:
 
 sub COMPONENT {
 my( $class, $app, $args ) = @_;
 $app-model( 'Schema::Foo' )-result_source-schema ...
 }
 
 But, of course, $app-model('Schema::Foo') isn't fully initialized at that 
 time.
 
 Any hint is greatly appreciated!

Catalyst initializes less-namespaced names first.

So I suspect if you called this MyApp::Model::Schema::Precache then
$c-model('Schema')-resultset('Foo') would be fine.

-- 
  Matt S Trout   Need help with your Catalyst or DBIx::Class project?
   Technical Directorhttp://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/http://www.shadowcat.co.uk/servers/

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] parameter validation

2008-07-19 Thread Matt S Trout
On Wed, Jul 02, 2008 at 11:08:46PM +0100, Caroline Johnston wrote:
 Hi,
 
 This isn't strictly a catalyst question, but it arose from a previous
 thread,
 http://lists.scsys.co.uk/pipermail/catalyst/2007-December/016329.html, on
 parameter validation and the problems of code like
 
   my $user = $rs-create({ 
   is_admin = 0,
   username = $c-req-param('username'), 
   });
 
 
 I'm using Data::FormValidator. If I have a DFV constraint on fields that 
 shouldn't be multi-valued, something like:
 
 sub is_single{
 my $c = shift;
 return sub{
   my $dfv = shift;
   $dfv-name_this('is_single');
   my $field = $dfv-get_current_constraint_field;
   my $data = $dfv-get_filtered_data;
 my $test = $data-{$field};
   return ref $test ? 0:1;
 }
 }
 
 should that allow me to use validated parameters in hashes with impunity
 or am I missing the point of the problem?

The point of that message was that $c-req-param('foo') is list context
aware whereas $c-req-params-{foo} isn't.

But once you've done the validating, you're going to be ok either way.

-- 
  Matt S Trout   Need help with your Catalyst or DBIx::Class project?
   Technical Directorhttp://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/http://www.shadowcat.co.uk/servers/

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Package , Catalyst::Plugin::Wizard is great but examples need some clarification

2008-07-19 Thread Matt S Trout
On Fri, Jul 11, 2008 at 04:50:08PM +1000, [EMAIL PROTECTED] wrote:
 
 hi there
  
 Anyone used this module yet? I was very impressed when i read the
 perldoc for it.
  Even got it installed. 
 I  think it's a very powerful module but needs some work.

First, it needs a rewrite as a controller base class.

We established with the various form plugins that a $self-form was much
better than $c-form (no clashes between plugins, better control of form
scoping etc.).

This use case is no different. I'd recommend not using it at the moment
since the author clearly isn't aware of best practices.

-- 
  Matt S Trout   Need help with your Catalyst or DBIx::Class project?
   Technical Directorhttp://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/http://www.shadowcat.co.uk/servers/

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] why no $c-action_class ?

2008-07-19 Thread Matt S Trout
On Wed, Jul 16, 2008 at 03:47:43PM +0200, Dami Laurent (PJ) wrote:
 Hi all,
 
 Catalyst lets users build their own base classes for Request, Response,
 Dispatcher , etc. (cf. methods $c-request_class, $c-dispatcher_class,
 etc.).
 
 Question : why is there no such mechanism for setting my own base class
 for Action ?
 
 I found a way to do it as follows :
 
 package My::App::Base::Controller;
 use My::App::Base::Action;
__PACKAGE__-_action_class('My::App::Base::Action');
 
 Another way would be to override the register_actions and/or
 create_action method in My::App::Base::Controller.
 
 However, both ways make me fell a bit uncomfortable because they rely on
 Catalyst internals, not on any public API.
 
 I know that there is a way to set action classes on a per-method basis,
 by using the :ActionClass attribute, but it would be tedious to do this
 on every method of every Controller. Furthermore, I want to keep the
 :ActionClass mechanism for specific cases where I need a specific
 subclass of My::App::Base::Action.
 
 So, coming back to my question : is there any good reason why we don't
 have a $c-action_class method in Catalyst ?

Yes. It's per-controller. The two methods you already described are
correct. _action_class is _prefixed to indicate it shouldn't be called
from outside the class, not that you shouldn't override it.

register_actions and create_action are both not prefixed because they're
not only meant to be wrapped but callable from outside the object.

If you feel that this isn't clear, a doc patch would be much appreciated.

-- 
  Matt S Trout   Need help with your Catalyst or DBIx::Class project?
   Technical Directorhttp://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Want a managed development or deployment platform?
http://chainsawblues.vox.com/http://www.shadowcat.co.uk/servers/

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


[Catalyst] please take me of your mailing list

2008-07-19 Thread tim nong
please take me of your mailing list

___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/