Re: [Catalyst] Bareword catalyst not allowed while strict subs in use at Makefile.PL line 90.

2010-05-06 Thread Matt S Trout
On Mon, May 03, 2010 at 02:57:10PM +0300, Octavian Rasnita wrote:
 Hi,
 
 I am trying to install a Catalyst-based app under Debian which has Perl 
 5.10.0 installed.
 I've installed the latest versions of CPAN, CPANPLUS, ExtUtils::MakeMaker, 
 Module::Install, Module::Build and local::lib using cpan.
 
 Then I tried to run perl Makefile.PL because I was hoping that it will show 
 me the missing Perl modules:

Did you do this properly by building a tarball with 'make dist' ? If so, then
inc/Module/Install.pm and inc/Module/Install/Catalyst.pm should already exist
in the unpacked tarball, so there was no need to install either.

If you're making a checkout and pretending that's an installation source,
then you're basically installing from a development environment - at which
point, shockingly enough, you need Catalyst::Devel.

But don't do that for a build server. make a dist and do it properly.
(ironically, the catalyst; line in your Makefile.PL is why a dist works well :)

-- 
Matt S Trout - Shadowcat Systems - Perl consulting with a commit bit and a clue

http://shadowcat.co.uk/blog/matt-s-trout/   http://twitter.com/shadowcat_mst/

Email me now on mst (at) shadowcat.co.uk and let's chat about how our Catalyst
commercial support, training and consultancy packages could help your team.

___
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] RunAfterRequest/delayed Catalyst view

2010-05-02 Thread Matt S Trout
On Fri, Apr 30, 2010 at 02:38:50PM -0700, Steve Kleiman wrote:
 Here goes...hopefully a simple test case for the RunAfterRequest oddness.

 The code below with the forward INSIDE 'run_after_request' subroutine throws 
 the error:
  [error] Caught exception in engine Modification of non-creatable array 
  value attempted, subscript -1 at 
  /usr/local/lib/perl5/site_perl/5.10.1/Catalyst/Dispatcher.pm line 278.

I think that's probably $c-stack being empty because there's no request
anymore.

I *think* that

$c-view('Email')-process($c);

would work, since that doesn't rely on the action call stack.

That error message is fucking awful though, and almost certainly my fault.

Proposal: first you try the -process-by-hand approach to confirm that I'm
an idiot the way I think I am. Second we discuss how to either (a) fix this
or (b) make sure it produces a non-awful error.

(even if you've already rewritten the code it'd be much appreciated if you
could try this out and see if it does the right thing - also, you then get to
point and laugh at me with a bit of luck, which may or may not be an added
incentive ;)

-- 
Matt S Trout - Shadowcat Systems - Perl consulting with a commit bit and a clue

http://shadowcat.co.uk/blog/matt-s-trout/   http://twitter.com/shadowcat_mst/

Email me now on mst (at) shadowcat.co.uk and let's chat about how our Catalyst
commercial support, training and consultancy packages could help your team.

___
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] Returning error codes to the user.

2010-05-02 Thread Matt S Trout
On Fri, Apr 30, 2010 at 04:18:46PM -0700, Bill Moseley wrote:
 I have a CRUD interface to an application.  This is used for both the Web
 and directly as an API.
 
 The model uses DBIC which, as you know, allows chaining resultsets, which I
 use to add additional constraints to the result set.
 
 So, a request for, say, /user/1234 might result in:
 
 $c-model( 'App::User' )-search(
 {
 'me.id' = $requested_user_id,
 'me.active  = 1,
 'me.date_expires'   = [
 { '' = \'now()' },  # past expired
 { '=' = undef }, # or never expires
 ],
 
 'account.active'= 1,
 'account.balance'   = { '' = 0 },
 'account.locked'= 0,
 'account.date_expires'  = [
 { '' = \'now()' },  # past expired
 { '=' = undef }, # or never expires
 ],
 },
 {
 join = 'account',
 },
 );
 
 [That's not a great example because we assume that user and account
 might get checked when first logging in.  Ignore that. Just assume a query
 that does a lot of joins to test if a given object can be accessed.]

Am I correct in thinking that's built up in multiple -search calls?

If so ...
 
 The request either succeeds (200) or fails (404).
 
 The VAST majority of the time the ID provided will return a row because a
 valid ID was provided by the application itself in the first place.
 
 But, for a tiny, tiny percent a request might fail.  Then the question is
 *why* did it fail?  What WHERE condition or join failed?

... if you keep all the intermediate resultsets around in the stash or
wherever (or better still refactor to resultset methods and have your
custom resultset class keep the intermediate resultsets around) then it
seems like it should be pretty easy to walk back up the chain making
the extra queries until one returns data - at which point you know the last
step you walked back up is the problem child for this request.

That way you get to only make the extra queries in the failure case, for
minimal extra code - basically taking advantage of DBIx::Class' laziness
coming -and- going :)

-- 
Matt S Trout - Shadowcat Systems - Perl consulting with a commit bit and a clue

http://shadowcat.co.uk/blog/matt-s-trout/   http://twitter.com/shadowcat_mst/

Email me now on mst (at) shadowcat.co.uk and let's chat about how our Catalyst
commercial support, training and consultancy packages could help your team.

___
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] Dist::Zilla + Catalyst?

2010-04-28 Thread Matt S Trout
On Mon, Apr 26, 2010 at 06:03:15AM -0400, John SJ Anderson wrote:
 
 On Apr 25, 2010, at 12:10 , Ævar Arnfjörð Bjarmason wrote:
 
  On Sun, Apr 25, 2010 at 15:39, John SJ Anderson geneh...@genehack.org 
  wrote:
  Is anybody using Dist::Zilla in combination with Catalyst? If so, are you 
  just not using it to generate your Makefile.PL or are you working around 
  the issues that presents in some other way?
  
  I'm using it for a plugin I have (Catalyst::Plugin::Upload::Digest).
  What issues are you talking about?
 
 I'm sorry, I thought that the location of 'Home' was set based on the 
 Makefile.PL. Reviewing the documentation, I see a dist.ini file can also 
 serve for that purpose. 

However, one of the tenets of Dist::Zilla is that your base directory need
not look anything like the final distribution.

In the case of Catalyst applications, the standard assumption that a checkout
and a final dist look much the same (as is normal for CPAN) is used quite
substantially; so I'd say that in this case Dist::Zilla's philosophical
decision to violate that convention makes it a suboptimal choice.

OTOH, if it works for you, I'm all for you enjoying using it :)

-- 
Matt S Trout Catalyst and DBIx::Class consultancy with a clue
 Technical Director  and a commit bit: http://shadowcat.co.uk/catalyst/
 Shadowcat Systems Limited
  mst (@) shadowcat.co.ukhttp://shadowcat.co.uk/blog/matt-s-trout/

___
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] Alternatives to Catalyst ?

2010-04-28 Thread Matt S Trout
On Tue, Apr 27, 2010 at 01:39:44PM +0400, Oleg Pronin wrote:
 Why can't nobody understand, the question is not why someone should
 use $c-req-{params}. Of course that is an evil. Problem is that if
 i could get -{parameters}{name} at a speed 100x there can't be no
 reason for -params to work as a turtle and i see a good reason to use
 wrappers around Request to provide normal, fast method of acessing
 parameters. Use Class::XSAccessor, Fast::XS, i dont now, use
 something!!! Many people ask me why most of catalyst accessors working
 so slow ? i dunno what to answer except for writing our own wrapper
 accessors getting values directly with massive speedup.

You know, in the entire time I've been working on Catalyst apps (and bear
in mind Shadowcat have been a largely specialist Catalyst/DBIx::Class
consultancy for four years plus now) I have never, ever seen the speed
of methods on $c-req show up as a bottleneck.

I've never even seen them show up on pre-5.80 Catalyst where the accessors
were *slower* than they are now (which is why I find your comment about Moose
and hardware manufacturers to be ... unsupportable) - and as such I am unable
to understand why you're complaining now rather than back then.

Why can't -you- understand that the question is why you think a microbenchmark
of a method that should only be called a handful of times per request - and
has never, ever, shown up as a bottleneck for any of the developers on this
list - is remotely relevant and in any way a problem?

use strict;

is significantly slower than

BEGIN { $^H |= 0x602; }

but that doesn't count as an argument to use the second form instead unless
that import() call is genuinely a bottleneck in your application.

Premature optimisation is the root of much evil. Profiles of this being
a genuine problem for real production code or GTFO, please.

-- 
Matt S Trout Catalyst and DBIx::Class consultancy with a clue
 Technical Director  and a commit bit: http://shadowcat.co.uk/catalyst/
 Shadowcat Systems Limited
  mst (@) shadowcat.co.ukhttp://shadowcat.co.uk/blog/matt-s-trout/

___
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] unsubsricbe

2010-04-28 Thread Matt S Trout
On Tue, Apr 27, 2010 at 06:59:53PM +0800, KT Lo wrote:

For future reference, mail from shadowcat.co.uk lists contain a standard header

List-Unsubscribe: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst,
mailto:catalyst-requ...@lists.scsys.co.uk?subject=unsubscribe

that describes how to unsubscribe from it.

However, I've gone into the admin console and deleted your subscription for
you.

-- 
Matt S Trout Catalyst and DBIx::Class consultancy with a clue
 Technical Director  and a commit bit: http://shadowcat.co.uk/catalyst/
 Shadowcat Systems Limited
  mst (@) shadowcat.co.ukhttp://shadowcat.co.uk/blog/matt-s-trout/

___
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] Pre-Moose version of Catalyst and all plugins?

2010-04-28 Thread Matt S Trout
On Mon, Apr 26, 2010 at 04:09:48PM -0400, Kee Hinckley wrote:
 I'm trying to get some old code running in a hurry. Unfortunately Moose has 
 completely fouled things up.

No it hasn't. Please throw away your preconceptions and report the actual
problem.

 First it broke my use of Error.pm (conflict with with). Fortunately I 
 didn't use with, and could just comment it out. But what I did have was my 
 own Error subclass that was the Catalyst Exception class.

You mean you added 'use Moose' somewhere and thereby found you had a 'with'
sub imported. That happens when you add import lines.

You can ask Moose to not import with, you can ask Error to not import with,
or you can ask Moose to import with under a different name.

But I don't even understand why you added 'use Moose' to your own classes at
all since that's in no way required to use Catalyst 5.80 - we spent a lot of
time making sure old code Just Worked for every application we could get at.
 
 BEGIN {
 $Catalyst::Exception::CATALYST_EXCEPTION_CLASS = 'Error::Throws';
 };

is the BEGIN block -before- the 'use Catalyst' line?
 
 I have no idea how to even get started on making that work. I made Error a 
 Moose inherited module from Catalyst::Exception (which is the wrong level, 
 but it got rid of:

I have no idea how it doesn't work yet because you didn't tell us what didn't
work.

Maybe you could elaborate a little?

 Not inlining 'new' for Catalyst::Exception since it is not inheriting the 
 default Moose::Object::new
 If you are certain you don't need to inline your constructor, specify 
 inline_constructor = 0 in your call to 
 Catalyst::Exception-meta-make_immutable

Which is a warning, not an error - though it's a little annoying. Let's fix
everything else and get to that one last?

 But then that left me with
 
 Recursive inheritance detected while looking for method 'isa' in package 
 'Catalyst::Exception' at /usr/local/lib/perl/5.8.8/Class/MOP/Class.pm line 
 570.

I can't find Error::Throws on CPAN.

Is it a private package?

If so, please show us what it contains - we're not really going to be able
to debug it otherwise.

 If someone has a quick way of telling me how to make my code compatible with 
 Catalyst::Exception that would be great, but I'm worried that I'm going to 
 hit lots of other things like this. In particular, I'm also using Embperl as 
 a Catalyst interpreter instead of TT, so I may hit Moose again there. It 
 might be easier for me to just take a step back in time and get old versoins:

I have no idea what you mean by hit Moose and I have no idea how Moose
and Embperl are remotely related. Could you elaborate please?

 Any suggestion on a solution that isn't going to take me days?

Not until you tell us what the actual problems are, no, sorry.

-- 
Matt S Trout Catalyst and DBIx::Class consultancy with a clue
 Technical Director  and a commit bit: http://shadowcat.co.uk/catalyst/
 Shadowcat Systems Limited
  mst (@) shadowcat.co.ukhttp://shadowcat.co.uk/blog/matt-s-trout/

___
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] Oddness with Catalyst::Plugin::Session::Store::DBIC

2010-04-28 Thread Matt S Trout
On Tue, Apr 27, 2010 at 05:07:36PM +0700, Ben van Staveren wrote:
 Hi Moritz,
 
 Yeah I just figured that one out - but that's new, never saw it do this 
 before to be honest - it's not a big deal actually since in production 
 Static::Simple isn't used and I let lighttpd take care of serving static 
 files, but in testing it's a bit disconcerting to see it crop up all of 
 a sudden :)

Check your plugin order; this doesn't normally happen because Static::Simple
bypasses the loading of the session. If you've tried it both before and
after you load your session plugins, come back to us with the versions of
all the plugins you're loading and we'll dig further.

-- 
Matt S Trout Catalyst and DBIx::Class consultancy with a clue
 Technical Director  and a commit bit: http://shadowcat.co.uk/catalyst/
 Shadowcat Systems Limited
  mst (@) shadowcat.co.ukhttp://shadowcat.co.uk/blog/matt-s-trout/

___
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] Oddness with Catalyst::Plugin::Session::Store::DBIC

2010-04-28 Thread Matt S Trout
On Wed, Apr 28, 2010 at 10:58:58PM +0700, Ben van Staveren wrote:
 Hi Matt,
 
 Check your plugin order; this doesn't normally happen because 
 Static::Simple
 bypasses the loading of the session. If you've tried it both before and
 after you load your session plugins, come back to us with the versions of
 all the plugins you're loading and we'll dig further.
   
 Current load order:
 
 use Catalyst qw/-Debug
ConfigLoader
Unicode
Compress
Authentication
Authorization::Roles
Session
Session::State::Cookie
Session::Store::DBIC
Static::Simple/;
 
 This makes the weird happen. If I move Static::Simple to right after 
 ConfigLoader, it still happens. Seeing as it happens when things go on 
 with Session (e.g. Session updating itself for expiry time), it seems 
 that plugin load order has no effect, unless there's some weirdness 
 happening with another of those modules.

Right after ConfigLoader ... shouldn't do that.

Honestly, the session shouldn't be UPDATEd at all in that case.
 
 Like I said though, for me it's not a big deal that this happens, now 
 that I know what causes it, I'm not worried about this showing up on my 
 app_server.pl output during development. For production DBIC_TRACE is 
 forced off and Static::Simple is never loaded :)

Which is great. But a lot of users leave Static::Simple loaded, so while
it's not going to bother you it -will- bother them.

So, in the name of paying karma forwards, any chance I could have the
versions anyway please?

-- 
Matt S Trout - Shadowcat Systems - Perl consulting with a commit bit and a clue

http://shadowcat.co.uk/blog/matt-s-trout/   http://twitter.com/shadowcat_mst/

Email me now on mst (at) shadowcat.co.uk and let's chat about how our Catalyst
commercial support, training and consultancy packages could help your team.

___
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] Mason + DBI + Catalyst?

2009-06-08 Thread Matt S Trout
On Wed, May 27, 2009 at 03:23:29PM +0300, Octavian Rasnita wrote:
 Ok, I will correct it (because I remember at least an error in it), test it 
 and put it in a wiki.
 
 Can anyone recommend a good place for a thing like this?

I'm not really very sure. How about a page linked off the 'faq' under a
question of Why do you want me to use an ORM? ORMs are evil! or something?

Not perfect but then it's there and somebody can move it later :)

-- 
Matt S Trout Catalyst and DBIx::Class consultancy with a clue
 Technical Director  and a commit bit: http://shadowcat.co.uk/catalyst/
 Shadowcat Systems Limited
  mst (@) shadowcat.co.ukhttp://shadowcat.co.uk/blog/matt-s-trout/

___
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] Multiple instances of same app with 5.80 under mod_perl

2009-06-08 Thread Matt S Trout
On Fri, May 29, 2009 at 11:49:45AM -0500, Stephen Clouse wrote:
 On Thu, May 28, 2009 at 5:48 PM, Stephen Clouse 
 stephenclo...@gmail.comwrote:
 
  Commenting that out, then theoretically (note that this is totally untested
  at the moment, but I intend to tomorrow):
 
 
 Well, it was worth a try, but obviously too much voodoo.  Catalyst complains
 about not being able to find //_DISPATCH.  Something internal gets fried
 with the delayed setup call.
 
 This, on the other hand, works perfectly, although less memory-efficient --
 one full compile of Catalyst per vhost.  Even so, this should be a win over
 the traditional FastCGI deployment (since the optree will at least still be
 shared within the vhost interpreter pool).

I doubt it.

FastCGI isn't traditional for Catalyst - it's what people switched to
because mod_perl almost never has a better memory/performance profile.

Especially since most of the mod_perl cleverness relies on interpreter
cloning, which unshares a huge amount of stuff that -can- be shared across
a fork.

-- 
Matt S Trout Catalyst and DBIx::Class consultancy with a clue
 Technical Director  and a commit bit: http://shadowcat.co.uk/catalyst/
 Shadowcat Systems Limited
  mst (@) shadowcat.co.ukhttp://shadowcat.co.uk/blog/matt-s-trout/

___
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] Lighttpd and mod_perlite

2009-06-08 Thread Matt S Trout
On Sun, May 31, 2009 at 09:19:32PM +0200, Kiffin Gish wrote:
 Just wondering what kind of experience folks in the catalyst community
 have had using lighttpd/mod_perlite as replacements for the more widely
 accepted apache/mod_perl stack. While apache might be better in being
 proven technology and mod_perl being better documented, I'm still
 looking for lightweight and scalable options.

Shadowcat's clients tend to end up on $webserver + FastCGI or $proxy + Prefork
depending on their requirements.

mod_perl is more 'legacy' than 'accepted' to people using practices from
this century.

-- 
Matt S Trout Catalyst and DBIx::Class consultancy with a clue
 Technical Director  and a commit bit: http://shadowcat.co.uk/catalyst/
 Shadowcat Systems Limited
  mst (@) shadowcat.co.ukhttp://shadowcat.co.uk/blog/matt-s-trout/

___
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] Best practice: How to build app parts reusable?

2009-06-08 Thread Matt S Trout
On Sun, May 31, 2009 at 06:06:48PM +0200, Matthias Dietrich wrote:
 Hi,
 
 in one of my Catalyst apps I'm building application parts that I want  
 to reuse in other Catalyst apps where possible.  What's the best  
 practice to do that?  I mean the complete parts from controller, to  
 model, DBIC schema classes and templates.
 
 Let's assume one part is a guestbook (no, it's not but it's a funny  
 example ;)).  The integration of the controller class is very easy.  I  
 just would build a new controller inside the app which uses the  
 guestbook controller as base class and sets the correct namespace,  
 where the guestbook should appear.  A similar procedure would get me  
 the model and schemes into my app, but it requires a wrapper class for  
 each class the guestbook brings with.  And the templates?  The only  
 way I know of is to copy and paste them into the 'root' folder of the  
 app.
 
 There has to be a better way.  But which?

Just have your controller base class set:

$c-stash(additional_template_paths = $self-template_paths);

in a begin or auto or whatever action.

See Catalyst::Plugin::AutoCRUD for injecting extra components into the
various areas during application setup.

-- 
Matt S Trout Catalyst and DBIx::Class consultancy with a clue
 Technical Director  and a commit bit: http://shadowcat.co.uk/catalyst/
 Shadowcat Systems Limited
  mst (@) shadowcat.co.ukhttp://shadowcat.co.uk/blog/matt-s-trout/

___
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] Action attributes

2009-06-08 Thread Matt S Trout
On Sat, Jun 06, 2009 at 02:35:53PM +1100, Илья wrote:
 Hi there,
 we use Catalyst about year and one thing make a lot of pain. When you
 make typo in action attribute name Catalyst silently eat it. For
 example:
 
 sub foo : Loacal Arg(1) {
 
 }
 
 will be work, but Arg(1) just do nothing.
 
 Now we use few additional attributes and I add trivial check in
 Our::Catalyst::Action:
 
 my @correct_names = qw
 Path
 Private
 Global
 Local
 Regex
 LocalRexgex
 Args
 Chained
 CaptureArgs
 PathPart
 
 Method
 Secure
 UnSecure
 RestrictTo
 Crumb
 Test
;
 
 foreach my $name (keys %$attrs) {
 unless ( first { $name eq $_ } @correct_names ) {
 die Wrong trait (attribute) $name!;
 }
 }
 
 so it is work for us, but mb better to add something like this in
 Catalyst itself? I can make patch if this helps.

A patch that let you do something like

__PACKAGE__-config(
  Dispatcher = {
action_attributes = {
  allow = \...@list
}
  }
);

in MyApp.pm (preferably with the built in ones already in the list) to
turn on strict checking would seem fine to me.

Then the dispatcher could check the actions when each one is registered with
it.

-- 
Matt S Trout Catalyst and DBIx::Class consultancy with a clue
 Technical Director  and a commit bit: http://shadowcat.co.uk/catalyst/
 Shadowcat Systems Limited
  mst (@) shadowcat.co.ukhttp://shadowcat.co.uk/blog/matt-s-trout/

___
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] Mason + DBI + Catalyst?

2009-05-26 Thread Matt S Trout
On Tue, May 26, 2009 at 01:14:18AM +0200, Daniel Carrera wrote:
 I hesitate to make predictions like this. I don't know DBIC, and you 
 don't know my queries. I know that I find SQL no harder than Perl, and 
 that I appreciate being able to experiment with queries with phpMyAdmin. 
 So I can't help but wonder if it really makes sense to use a Perl module 
 to write the SQL for me rather than write the SQL directly. How would 
 you tell DBIC to use a sub query or to use a temporary table? Is it hard?

If you can't make DBIC produce the exact SQL you would have written by hand,
that's a missing feature in DBIC - at least so far as the development team
is concerned.

I often prototype queries by fiddling at the SQL level and then rewrite them
into DBIC syntax afterwards - though equally as often I fire up a Devel::REPL
re.pl and play around with resultsets with DBIC_TRACE on so it shows me the
queries as it runs them.

DBIx::Class -does- have a learning curve, but that's because it's an ORM
written by people who actually like SQL and the relational model - so once
you get to grips with it you should be able to write DBIC code and be able
to see the SQL that's going to eventually be executed in your head, except
be typing a lot less - and be able to use resultset chaining to put complex
queries together in a piecemeal, reusable fashion.

-- 
Matt S Trout Catalyst and DBIx::Class consultancy with a clue
 Technical Director  and a commit bit: http://shadowcat.co.uk/catalyst/
 Shadowcat Systems Limited
  mst (@) shadowcat.co.ukhttp://shadowcat.co.uk/blog/matt-s-trout/

___
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] Mason + DBI + Catalyst?

2009-05-26 Thread Matt S Trout
On Tue, May 26, 2009 at 01:37:40AM +0200, Daniel Carrera wrote:
 Do you write your queries using straight SQL? For my application, MySQL 
 is a bottleneck. So it is important to me that I have control over the 
 queries to try to make them efficient. I don't have any query that spans 
 8 tables though. So if you are happy with DBIC, then it should be good 
 enough for me too. I'll take a second look at DBIC.

Have a look at -

http://www.shadowcat.co.uk/catalyst/-talks/yapc-na-2008/dbix-masterclass.xul

http://www.shadowcat.co.uk/archive/conference-video/yapc-eu-2008/dbic-masterclass/

http://xrl.us/oubg6 

Those should give you an idea of the level of complexity that can be built
up elegantly.
 
 Btw, why is it called DBIC if CPAN says DBIx::Class?

DBIx is the namespace for DBI extensions.

So we use DBIC as an abbreviation.

 Being able to chain resultsets makes it much much easier than using 
 straight SQL, and you write less code.  If you have a query you've 
 constructed called $query, and lets say you now only want active records 
 you can do $query = $query-search({ active = 1 });  In this way you 
 can filter many things incrementally.
 
 But is that efficient? It looks like you are getting MySQL to return the 
 entire data set and then making Perl filter it. That can't be efficient.

-search just constructs another resultset.

DBIC doesn't hit the database until you make it via -count or -next/-all
(or something that calls one of those).

That's rather the key advantage of DBIC - a resultset is basically a sort of
lazy virtual view onto your database that turns itself into an SQL query as
and when (and only when) required to do so by something you want.

-- 
Matt S Trout Catalyst and DBIx::Class consultancy with a clue
 Technical Director  and a commit bit: http://shadowcat.co.uk/catalyst/
 Shadowcat Systems Limited
  mst (@) shadowcat.co.ukhttp://shadowcat.co.uk/blog/matt-s-trout/

___
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 IPv6 support?

2009-05-22 Thread Matt S Trout
On Sun, May 17, 2009 at 09:02:11AM +0200, Matija Grabnar wrote:
 chiel wrote:
 Hello,
 
 I was wondering if Catalyst supports IPv6? I search the archive/google 
 but couldn't find anything useful. If it's not support, is it planed?
 I've just gotten IPv6 connectivity on my home lan, so I did some testing.
 There is good news and bad.
 
 Bad news: myapp_server only listens on the IPv4 socket, and the very 
 simple modifications I tried
 did not change the situation. It looks like a myapp_server that opened 
 on dual IPv4/IPv6 stack would take some work. (At least several hours by 
 someone who knows the guts of myapp_server).

is there any reason we can't get myapp_server back to using
HTTP::Server::Simple and just outsource the problem?

The code's diverged a bit from when it was forked but I don't really see
it being that horrible a job ...

-- 
Matt S Trout Catalyst and DBIx::Class consultancy with a clue
 Technical Director  and a commit bit: http://shadowcat.co.uk/catalyst/
 Shadowcat Systems Limited
  mst (@) shadowcat.co.ukhttp://shadowcat.co.uk/blog/matt-s-trout/

___
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] Problem with objects

2009-05-14 Thread Matt S Trout
On Wed, May 13, 2009 at 03:09:54PM -0300, Naylor Garcia wrote:
 Hi all,
 
 I am creating a sub in the Model/IMAP.pm makes no connection with the
 database, but performs authentication via IMAP. But failing to call this sub
 in the controller.
 
 I am new to Catalyst and appreciate the help.

You asked this on IRC. We asked for:

The Model/IMAP.pm

The Controller calling it

The full output of myapp_server.pl -d as you make a request to it that
causes the exception.

Until you give us those, we can't easily help you - what you've said so far
is like your mum calling you and saying help the internet is broken - way
too vague to provide a useful answer :)

-- 
Matt S Trout Catalyst and DBIx::Class consultancy with a clue
 Technical Director  and a commit bit: http://shadowcat.co.uk/catalyst/
 Shadowcat Systems Limited
  mst (@) shadowcat.co.ukhttp://shadowcat.co.uk/blog/matt-s-trout/

___
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] Handling of keywords for controller methods

2009-05-14 Thread Matt S Trout
On Wed, May 13, 2009 at 08:28:22PM +0200, Roland Lammel wrote:
 For the records, just did my first commit for Catalyst to resolve this.
 
 Thnx for directions.

Welcome to the team. I think you forgot to add yourself to

http://search.cpan.org/~flora/Catalyst-Runtime-5.80003/lib/Catalyst.pm#CONTRIBUTORS

though ... (alphabetical by IRC nick please)

-- 
Matt S Trout Catalyst and DBIx::Class consultancy with a clue
 Technical Director  and a commit bit: http://shadowcat.co.uk/catalyst/
 Shadowcat Systems Limited
  mst (@) shadowcat.co.ukhttp://shadowcat.co.uk/blog/matt-s-trout/

___
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] Doc patch for ConfigLoader.

2009-05-14 Thread Matt S Trout
On Wed, May 13, 2009 at 10:02:36PM -0700, Louis Erickson wrote:
 I also began to see why it's hard to catch these, as I noticed that this 
 behavior is documented in the existing docs if you understand how it works 
 already.

I have a bit of a rant that relates to this -

http://www.shadowcat.co.uk/archive/conference-video/yapc-eu-2008/you-arent-good-enough/
 
 With these docs in place, I would have found what I was looking for and 
 not spent time debugging.

Awesomeness. Thank you -very- much.

-- 
Matt S Trout Catalyst and DBIx::Class consultancy with a clue
 Technical Director  and a commit bit: http://shadowcat.co.uk/catalyst/
 Shadowcat Systems Limited
  mst (@) shadowcat.co.ukhttp://shadowcat.co.uk/blog/matt-s-trout/

___
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] Caught exception in engine Can't call method header on an undefined value

2009-05-14 Thread Matt S Trout
On Thu, May 14, 2009 at 11:47:16AM +0800, Malloy wrote:
 What's wrong with my application?
 
 [error] Caught exception in engine Can't call method header on an
 undefined value at /usr/local/share/perl/5.10.0/Catalyst.pm line 1838.
 When get this error, I can't open the web page.

Update Catalyst::Runtime to the latest version - you've got one of the early
5.80s with a weird context constructor bug, I think.

-- 
Matt S Trout Catalyst and DBIx::Class consultancy with a clue
 Technical Director  and a commit bit: http://shadowcat.co.uk/catalyst/
 Shadowcat Systems Limited
  mst (@) shadowcat.co.ukhttp://shadowcat.co.uk/blog/matt-s-trout/

___
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] More natural access to model?

2009-05-13 Thread Matt S Trout
On Tue, May 12, 2009 at 08:04:18PM -0700, Darren Duncan wrote:
 Paweł Tęcza wrote:
 Dnia 2009-05-12, wto o godzinie 19:30 +0100, Matt S Trout pisze:
 Well, that's a horrible idea.
 
 The whole point of having a database is to -model- your data.
 
 If you try and turn it into a giant hash, then of course you're going to
 end up with nasty code.
 
 I -could- explain how to clean that loop up a lot, but the reality is that
 you should have actual columns for things and update your database as
 required as new types of data need to be included - you'll have to update
 the application anyway, so I don't see any reason not to update the 
 database
 at the same time ...
 
 Intriguing post. My application and database design are still under
 heavy development, so all ideas, suggestions and comments are very
 welcome :D
 
 A general rule of thumb is that you should be conceptualizing your 
 databases similar to how you conceptualize your applications.
 
 Your database schema, such as what tables you have, and their columns, and 
 their column data types, and the relationships between tables and columns 
 etc, these are like program code, such as how you choose to decompose your 
 application into libraries and classes and class attributes and type 
 constraints and input constraints and so on.  The actual data you put in 
 your database tables is analogous to what data you put in your application 
 variables or objects.
 
 Generally speaking it should be natural to change your actual database 
 schema as often as you change your application source code, where it makes 
 sense; for example, changing your schema is a similar sort of operation to 
 changing what attributes your object classes have or your constraints.
 
 Or more accurately in practice, a database is more like (or in some cases, 
 exactly like) a shared library, where you have some classes you write once 
 and share in multiple applications, and if you change the library you have 
 to consider that impact on all the applications that use it.  Hence people 
 tend to be more conservative in database design changes, but still one 
 shouldn't be afraid to do it, and all you really need is just proper 
 communication and planning between the involved parties so it goes smoothly.
 
 Also, same as classes can have multiple APIs, eg keeping old ones for 
 backwards compatibility if old apps can't update, databases have things 
 called views / virtual tables which let them also have multiple APIs; this 
 is one of the main purposes of views in fact.

Too bloody right. Care to shove this on the catwiki somewhere?

-- 
Matt S Trout Catalyst and DBIx::Class consultancy with a clue
 Technical Director  and a commit bit: http://shadowcat.co.uk/catalyst/
 Shadowcat Systems Limited
  mst (@) shadowcat.co.ukhttp://shadowcat.co.uk/blog/matt-s-trout/

___
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] My experience porting to CataMoose

2009-05-13 Thread Matt S Trout
On Wed, May 13, 2009 at 04:13:06AM +0200, Sebastian Willert wrote:
 On Wed, 2009-05-13 at 07:21 +0900, Daisuke Maki wrote:
   2. Hooking to methods that Plugins use via method modifiers breaks
   method dispatch
  
   I got bit by this while depending on Catalyst::Plugin::Unicode, and
   trying to hook a custom error handling mechanism at finalize().
   
   snip explanation
   
   Hmm, that certainally looks like a bug to me..
   
   Any chance that I could get you to write a test case or two for this 
   issue?
  
  I get it now, it has to do with when setup() and method modifiers run:
  
  snip example code
 
If you intend to use Moose's method modifiers in your app, do so
/AFTER/ Catalyst-setup has been called.
  
  or some such
 
 First of all: thanks for the pointer, you have ended a lot of hair
 pulling for me. But IMO this is not just a common gotcha but a serious
 bug.

Wrong, sorry. It's an inevitable caveat. The point is that plugin setup
changes the app's @ISA, so it simply isn't safe to run modifiers before
-setup, or more specifically until after -setup_plugins.

 I have a few plugins I am trying to convert to Moose::Role's that
 desperately need both
   before 'setup_components'
 and
   after 'finalize'
 
 This just isn't going to work one way or the other :(

Fortunately, setup_plugins happens -before- setup_components so you can
apply a role any time after that and it'll all work fine.

 Maybe I can whip up some testcases tomorrow ..

Maybe you can whip up some documentation tomorrow?

Though it would be nice if modifier application before -setup_plugins
produced a warning explaining why that's bad, wrong, and not going to work.

-- 
Matt S Trout Catalyst and DBIx::Class consultancy with a clue
 Technical Director  and a commit bit: http://shadowcat.co.uk/catalyst/
 Shadowcat Systems Limited
  mst (@) shadowcat.co.ukhttp://shadowcat.co.uk/blog/matt-s-trout/

___
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 dynamic SQL model and custom tables

2009-05-13 Thread Matt S Trout
On Wed, May 13, 2009 at 03:56:34PM +0400, ivan wrote:
 Is it possible add to dynamic SQL model in Catalyst custom sources and 
 custom fields ?

create=dynamic is STRONGLY disrecommended; there is no reason -at all- not
to use create=static and switching over should be trivial - just re-run
your myapp_create.pl with =static instead of =dynamic and it should all work
fine  - and if it doesn't, you can get support for DBIx::Class and
DBIx::Class::Schema::Loader via the dbix-class list - see

http://lists.shadowcat.co.uk/

-- 
Matt S Trout Catalyst and DBIx::Class consultancy with a clue
 Technical Director  and a commit bit: http://shadowcat.co.uk/catalyst/
 Shadowcat Systems Limited
  mst (@) shadowcat.co.ukhttp://shadowcat.co.uk/blog/matt-s-trout/

___
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] Testing controller which require login.

2009-05-13 Thread Matt S Trout
On Tue, May 12, 2009 at 10:07:49PM -0700, Louis Erickson wrote:
 
 I've been neglecting my test scripts, and I'm finally getting to that 
 before my app gets any bigger.  I want to make sure I don't break anything 
 that's working, and that it works as well as I think it does.
 
 I'm probably going to have several questions in the next few days about 
 tests.  I think I've got a lot of the basics working; tests pass, I have a 
 sensible test database and environment.  I can see fixtures from here, I 
 think.
 
 I haven't been able to get a test user logging in and out yet, though.
 
 I have several sections of my application that redirect the user away if
 they are not logged in.  I have another that returns a 404 if they don't
 have access, so prying users can't find it (as easily).
 
 My tests are currently based on the stubs generated by myapp_create,
 and use Catalyst::Test.  I could move them to WWW::Mechanize::Catalyst if 
 it would help.
 
 I can't tell if Catalyst::Test supports cookies.  Does it?  Or do I need 
 to use WWW::Mechanize::Catalyst for that?
 
 I've read some suggestions on how to go about this, and found a couple.
 
 1 Use WWW::Mechanize::Catalyst to log the user in
 2 Use the mock user in config to set a user who is logged in.
 
 The problem with really logging the user in is that the login is a set of 
 site-wide cookies generated by a Single Sign On system.  That system may 
 or may not have a test instance running.  If it does, cookies stored from 
 it probably won't work with cookies from 'localhost' like the local test
 app wants.

I think what you want is Test::WWW::Mechanize::Catalyst and to mock the
single sign on stuff.

After all, you're not trying to test -it-, you're trying to test your
application, right?

-- 
Matt S Trout Catalyst and DBIx::Class consultancy with a clue
 Technical Director  and a commit bit: http://shadowcat.co.uk/catalyst/
 Shadowcat Systems Limited
  mst (@) shadowcat.co.ukhttp://shadowcat.co.uk/blog/matt-s-trout/

___
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] Who wants to be rid of the Unknown Error w/attributes bug on 5.10?

2009-05-12 Thread Matt S Trout
On Mon, May 11, 2009 at 06:28:12PM -0500, Andrew Rodland wrote:
 On Monday 11 May 2009 05:45:01 pm Jonathan Rockway wrote:
  Or, you can use Debian, which fixed this bug in its Perl a while ago:
 
  http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=488088
 
 Not everyone uses Debian, and I, for one, would much rather be able to tell 
 people get 5.10.1 than to have to explain what patch is or try to 
 convince 
 them to switch their operating system. A fix from upstream is long overdue. :)

Right, so I'm asking the community to help.

John, if you don't want to help, that's fine, you can remain part of the
precipitate for all I care.

Now, who wants to help and is there anything you need from me to make it
easier for you to help out?

-- 
Matt S Trout Catalyst and DBIx::Class consultancy with a clue
 Technical Director  and a commit bit: http://shadowcat.co.uk/catalyst/
 Shadowcat Systems Limited
  mst (@) shadowcat.co.ukhttp://shadowcat.co.uk/blog/matt-s-trout/

___
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] Howto Catalyst::Plugin::Captcha ?

2009-05-11 Thread Matt S Trout
On Fri, May 08, 2009 at 03:33:52PM +0200, t...@dix.cz wrote:
 
 Hello catalysters,
 
 I'm trying to use  Catalyst::Plugin::Captcha

Don't. Controller::reCAPTCHA is far saner.

This, as with many things, should never have been a plugin, and as such it's
kinda fragile, sorry.

-- 
Matt S Trout Catalyst and DBIx::Class consultancy with a clue
 Technical Director  and a commit bit: http://shadowcat.co.uk/catalyst/
 Shadowcat Systems Limited
  mst (@) shadowcat.co.ukhttp://shadowcat.co.uk/blog/matt-s-trout/

___
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] Forward to view question

2009-05-11 Thread Matt S Trout
On Tue, May 05, 2009 at 10:54:17AM -0400, Dennis Daupert wrote:
 I've created a view that's intended to write a couple of files to the file
 system.
 
 The output filename needs to be dynamically set. I'm having a bit of a go
 figuring out how to do that.
 
 The TT configuration documentation speaks of an output subroutine:
 
 OUTPUT = \output,
 
 Later on in the view base class...
 
 sub output {
   my $filename = shift;
   # do stuff
 }
 
 Here's my question:
 How do I get the $filename into sub output when I forward to the view?

Screw that.

sub write_file {
  my ($self, $c, $filename) = @_;
  my $data = $self-render($c, ...); # look at how process calls render
  write data
}

then do:

$c-view('Foo')-write_file($c, $filename);

Having to pass $c along like that is a little bit annoying, but this approach
is -way- simpler.

Of course if you were feeling truly insane you could do

  $self-template-{OUTPUT} = sub { capture $filename here };
  $self-render(...);

but I don't really see that it would gain you anything.

*wonders if write_file should be a role that applies to any view that supplies
render* ...

-- 
Matt S Trout Catalyst and DBIx::Class consultancy with a clue
 Technical Director  and a commit bit: http://shadowcat.co.uk/catalyst/
 Shadowcat Systems Limited
  mst (@) shadowcat.co.ukhttp://shadowcat.co.uk/blog/matt-s-trout/

___
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] Authorization Failure

2009-05-11 Thread Matt S Trout
On Fri, May 08, 2009 at 04:08:29PM +0400, Oleg Pronin wrote:
 Catalyst and controllers are the same. Catalyst imho is _not only web_
 framework.

You can beat a nail in with a screwdriver too.

More seriously, I'd really like to split out the bits of Catalyst that are
application framework rather than web so that those parts can be shared
and you basically subclass it.

But that's a fucktonne of code I don't have time to write just yet. If anybody
wants to experiment with this idea, I'd be more than happy to help bikeshed
out the design.

-- 
Matt S Trout Catalyst and DBIx::Class consultancy with a clue
 Technical Director  and a commit bit: http://shadowcat.co.uk/catalyst/
 Shadowcat Systems Limited
  mst (@) shadowcat.co.ukhttp://shadowcat.co.uk/blog/matt-s-trout/

___
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] Handling of keywords for controller methods

2009-05-11 Thread Matt S Trout
On Mon, May 11, 2009 at 02:08:40AM +0200, Roland Lammel wrote:
 Hi all,
 
 I was bitten by the naming of one of my controller methods. After digging a
 little into that I found that the method name actions was not the best
 idea to use. It is in catalyst terms a keyword (actually an attribute) of
 Catalyst::Controller where also my controller inherits from.

That's a bug, the attribute should -not- be called 'actions'.

Can somebody do up a patch that renames it to something sensible? (_actions
seems reasonably safe to me ...)

-- 
Matt S Trout Catalyst and DBIx::Class consultancy with a clue
 Technical Director  and a commit bit: http://shadowcat.co.uk/catalyst/
 Shadowcat Systems Limited
  mst (@) shadowcat.co.ukhttp://shadowcat.co.uk/blog/matt-s-trout/

___
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] Who wants to be rid of the Unknown Error w/attributes bug on 5.10?

2009-05-11 Thread Matt S Trout
Because I know you guys all hate it. Certainly the ones using Catalyst heavily.

Well, it's been fixed in bleadperl for a while, but in order to get that out
we require a 5.10.1 - and to get a 5.10.1 we needed to fix all the bugs that
were in smartmatch in 5.10.0 because not enough of us tested the dev releases.

So, rgs has updated the smartmatch POD, and the code, and the tests.

Because rgs is wonderful.

But given how much trouble we had with the 5.10.0 version it almost certainly
wants more tests and the time for being sure of 5.10.1 features draw nigh. So.

http://github.com/rjbs/perl-smartmatch-tests/tree/master

Here is a repo. Fork it. Try and break it. If you succeed, note how that break
departs from the spec. Send pull requests to rjbs as often as you're sure is
a good idea so he can keep everybody in sync.

Go on. Go! GO GO GO GO GO!

-- 
Matt S Trout Catalyst and DBIx::Class consultancy with a clue
 Technical Director  and a commit bit: http://shadowcat.co.uk/catalyst/
 Shadowcat Systems Limited
  mst (@) shadowcat.co.ukhttp://shadowcat.co.uk/blog/matt-s-trout/

___
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] unknown resource

2009-05-05 Thread Matt S Trout
On Sat, May 02, 2009 at 06:17:19PM +0300, Octavian Râşniţă wrote:
 From: Ash Berlin ash_c...@firemirror.com
 I'm guessing you've got your cat app rooted/deployed on '/' and are  using 
 FastGCI (from your other thread)?
 If so then I think you need something like this in the config:
 Alias /server-status /server-status
 
 Yes, this was the problem. I made some tests and I came to the conclusion 
 that Catalyst responds to all those URIs which don't have a distinct Alias 
 when it is used with fastcgi, no matter if they are handled by other 
 modules.

I don't understand why you mention Catalyst here.

That's just how Alias works in apache; if you don't understand it you should
be reading the http://httpd.apache.org/ manual and talking to apache lists;
there's exactly zero Catalyst specific ness here :)

-- 
Matt S Trout Catalyst and DBIx::Class consultancy with a clue
 Technical Director  and a commit bit: http://shadowcat.co.uk/catalyst/
 Shadowcat Systems Limited
  mst (@) shadowcat.co.ukhttp://shadowcat.co.uk/blog/matt-s-trout/

___
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] fastcgi error

2009-05-01 Thread Matt S Trout
On Fri, May 01, 2009 at 05:28:14AM -0700, gutta wrote:
 
 Hi Jon,
 I have done the changes u suggested.. now its working fine.

Please use whole words on this mailing list, AOLisms like 'u' are really
annoying.

Additionally, please go to http://lists.scsys.co.uk/ and subscribe properly
rather than using Nabble - they're spammer friendly and I have to block
them on a regular basis.

-- 
Matt S Trout Catalyst and DBIx::Class consultancy with a clue
 Technical Director  and a commit bit: http://shadowcat.co.uk/catalyst/
 Shadowcat Systems Limited
  mst (@) shadowcat.co.ukhttp://shadowcat.co.uk/blog/matt-s-trout/

___
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] script/myapp_server -r Can't exec /usr/bin/perl every 3 or 4 restarts

2009-04-30 Thread Matt S Trout
On Thu, Apr 30, 2009 at 02:44:05PM +0200, Erik Wasser wrote:
 On Tuesday 28 April 2009, Matt S Trout wrote:
 
  Two possibilities:
 
  (1) exec a $^X to print @INC to get the normal @INC
 
  (2) use $Config{arch} and /^5.\/ to strip off the extra ones.
 
  Thoughts?
 
 I think (1) is more bulletproof. I think a restart costs a lot of time 
 and an additional call of $^X doesn't matter here.

I think I agree. Fancy having a go at a patch? I -still- don't use -r so
I -still- can't really shake such a patch out in real world usage :)

-- 
Matt S Trout Catalyst and DBIx::Class consultancy with a clue
 Technical Director  and a commit bit: http://shadowcat.co.uk/catalyst/
 Shadowcat Systems Limited
  mst (@) shadowcat.co.ukhttp://shadowcat.co.uk/blog/matt-s-trout/

___
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] upgraded to latest catalyst runtime 5.8 and Catalyst::Plugin::Upload::Image::Magick::Thumbnail::Fixed cant be loaded

2009-04-30 Thread Matt S Trout
On Thu, Apr 30, 2009 at 03:17:03PM +0100, Chisel Wright wrote:
 On Thu, Apr 30, 2009 at 03:05:35PM +0100, Tomas Doran wrote:
  Catalyst::Plugin::Upload::Image::Magick contains code which says  
  Catalyst::Request::Upload-mk_accessors('_image');
 
  This is the plugin changing the core framework class, and is nasty  
  action at a distance.
 
  That plugin is broken
 
 Yeah, I'd already come to that conclusion.
 
 Any suggestions for a sane(r) approach? As it's a plugin I've used I
 might be able to find some tuits to experiment with an implementation.

CatalystX::RoleApplicator I guess.

-- 
Matt S Trout Catalyst and DBIx::Class consultancy with a clue
 Technical Director  and a commit bit: http://shadowcat.co.uk/catalyst/
 Shadowcat Systems Limited
  mst (@) shadowcat.co.ukhttp://shadowcat.co.uk/blog/matt-s-trout/

___
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] Is there a good solution of file cache? which plugin is recommended?

2009-04-30 Thread Matt S Trout
On Thu, Apr 30, 2009 at 11:46:12PM +0800, Malloy wrote:

Vague question is vague.

Perhaps you could try asking a question with some detail about what you're
going to be caching, why you want to do so, and why you think a Catalyst
plugin is the right layer of your stack to do this?

Alternatively you're welcome to sit back and enjoy the silence :)

-- 
Matt S Trout Catalyst and DBIx::Class consultancy with a clue
 Technical Director  and a commit bit: http://shadowcat.co.uk/catalyst/
 Shadowcat Systems Limited
  mst (@) shadowcat.co.ukhttp://shadowcat.co.uk/blog/matt-s-trout/

___
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] Using test database with TWAM?

2009-04-30 Thread Matt S Trout
On Thu, Apr 30, 2009 at 05:29:12PM +0100, Iain wrote:
 If your wondering why I went to all this trouble. We have several
 developers so running multiple tests at the same time caused all kinds
 of strange problems and nobody wanted to maintain a DB per developer!

If you're using ::Fixtures and -deploy maintaining a DB per developer is
-easy-.

For shadowcat clients we usually set them up with a db, per developer, per
major branch. Works like a dream.

-- 
Matt S Trout Catalyst and DBIx::Class consultancy with a clue
 Technical Director  and a commit bit: http://shadowcat.co.uk/catalyst/
 Shadowcat Systems Limited
  mst (@) shadowcat.co.ukhttp://shadowcat.co.uk/blog/matt-s-trout/

___
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] Migrating mod_perl app to Catalyst

2009-04-28 Thread Matt S Trout
On Mon, Apr 27, 2009 at 01:54:12PM -0500, Michael Reddick wrote:
 Does anyone have any advice for migrating a large mod_perl app that has no
 tests to catalyst?
 
 I already know of Catalyst::Controller::WrapCGI which seems to be a good
 start.

Assuming your app doesn't use apache specific stuff.

What I tend to recommend in such cases is to start writing new functionality
in Catalyst as FastCGI and just map chunks of the URI space across to the
new stuff. When you need to significantly alter the old code, port it first.

Eventually you'll just have a Catalyst+FastCGI codebase, and you'll have had
working code at every stage.

-- 
  Matt S Trout   Catalyst and DBIx::Class consultancy with a clue:
   Technical Directorhttp://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Any questions? Mail mst at shadowcat.co.uk
My blog: http://www.shadowcat.co.uk/blog/matt-s-trout/ (warning: profanity)

___
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 error from CPAN

2009-04-28 Thread Matt S Trout
On Mon, Apr 27, 2009 at 08:18:33PM +0100, gor...@gorste.plus.com wrote:
 Dear List
 
 
 
 I have just installed catalyst from CPAN.  I seam to get this error :
 
 
 
 Can't call method can without a package or object reference at
 /usr/local/share/perl/5.8.8/Catalyst/Plugin/Authentication/Store/DBIC.pm
 line 101

If you've only just installed, why are you even using that?

Catalyst::Authentication::Store::DBIx::Class obsoleted it some time ago.

-- 
  Matt S Trout   Catalyst and DBIx::Class consultancy with a clue:
   Technical Directorhttp://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Any questions? Mail mst at shadowcat.co.uk
My blog: http://www.shadowcat.co.uk/blog/matt-s-trout/ (warning: profanity)

___
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] Relations 1:M

2009-04-28 Thread Matt S Trout
On Tue, Apr 28, 2009 at 08:02:49PM +0200, neila wrote:
 Welcome,
 
 I have got a problem with relation has_many.

If you just hit reply to a random post you're replying to that thread,
not starting a new one - you need to start a new message to:

catalyst@lists.scsys.co.uk

Additionally, since this is a DBIx::Class question, it would be better
asked on the DBIx::Class list, so please subscribe to that (also at
http://lists.scsys.co.uk/ ) and ask your question there, starting by
creating a new message to:

dbix-cl...@lists.scsys.co.uk

-- 
  Matt S Trout   Catalyst and DBIx::Class consultancy with a clue:
   Technical Directorhttp://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Any questions? Mail mst at shadowcat.co.uk
My blog: http://www.shadowcat.co.uk/blog/matt-s-trout/ (warning: profanity)

___
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] Which model is better, DBI or DBIC::Schema?

2009-04-28 Thread Matt S Trout
On Tue, Apr 28, 2009 at 05:38:57PM +0800, Malloy wrote:
 Which model is better, DBI or DBIC::Schema?

If you're asking, you should probably be using DBIC::Schema since it's most
popular so the best integrated and easy to get help with.

-- 
  Matt S Trout   Catalyst and DBIx::Class consultancy with a clue:
   Technical Directorhttp://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Any questions? Mail mst at shadowcat.co.uk
My blog: http://www.shadowcat.co.uk/blog/matt-s-trout/ (warning: profanity)

___
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] how to reuse Catalyst Schema for non-web purposes?

2009-04-27 Thread Matt S Trout
On Fri, Apr 24, 2009 at 02:08:14PM +1000, kakim...@tpg.com.au wrote:
 I took off the 'Authentication::Store::DBIC' from my use Catalyst qw( in 
 myApp.pm.
 
 This is such that  Catalyst/Plugin/Authentication/Store/DBIx/Class.pm will 
 not be required.
 After all, no such thing exists(checked cpan).

Right, that's because only -old- authentication stores were under
Catalyst::Plugin::Authentication::Store:: - the new style stores aren't
plugins because they don't need to be so they're under
Catalyst::Authentication::Store::

 Strangely, when I run scripts/myApp_server.pl, 
 I got this message: 
 
 -- error message - start 
 [error] Caught exception in myApp::Controller::Root-auto Can't call method 
 user_is_restorable 
 on an undefined value at 
 /usr/local/lib/perl5/site_perl/5.8.9/Catalyst/Plugin/Authentication.pm line 
 168.
 -- error message - end 

Without seeing your current config I can't tell you waht's gone wrong there.

-- 
  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] unexpected behavior of $c-request-secure and $c-request-base

2009-04-27 Thread Matt S Trout
On Sat, Apr 25, 2009 at 11:13:16AM -0700, seasproc...@gmail.com wrote:
 Yes, it all makes sense ... now. Still, I think that when something as
 fundamental as $c-request-base is fragile, it calls for some thought.
 Perhaps a config variable that lets you set your SSL port? My guess is that
 the average cat user does not realize that req-secure and req-base may be
 unreliable.

I'm not sure unreliable is the right word. Determined by heuristics is
probably more accurate.

I think either (a) we need more documentation explaining exactly how it
makes its best guess so that it's more obvious to the people the guess is
wrong for what's happening, or (b) we need (a) and some better guessing.
Let's keep discussing how it could/should have guessed for your setup to
find out which :)

-- 
  Matt S Trout   Catalyst and DBIx::Class consultancy with a clue:
   Technical Directorhttp://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Any questions? Mail mst at shadowcat.co.uk
My blog: http://www.shadowcat.co.uk/blog/matt-s-trout/ (warning: profanity)

___
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] Can't seem to use forward or detach. Any special requirements?

2009-04-27 Thread Matt S Trout
On Mon, Apr 27, 2009 at 11:09:19AM +1000, kakim...@tpg.com.au wrote:
 Hello, Oliver,
 
  Good morning.
  Referring to
 http://kobesearch.cpan.org/htdocs/Catalyst-Runtime/Catalyst.html#c_gt_detach_class_method_arguments,
 under $c-detach(),
 it says that detach is the same as forward, but doesn't return to the
 previous action when processing is finished. 

And forward() takes a private path, not a URL, too.

Look at the debug output on myapp_server.pl startup - it shows the URLs
and the private paths.

-- 
  Matt S Trout   Catalyst and DBIx::Class consultancy with a clue:
   Technical Directorhttp://www.shadowcat.co.uk/catalyst/
 Shadowcat Systems Ltd.  Any questions? Mail mst at shadowcat.co.uk
My blog: http://www.shadowcat.co.uk/blog/matt-s-trout/ (warning: profanity)

___
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] script/myapp_server -r Can't exec /usr/bin/perl every 3 or 4 restarts

2009-04-23 Thread Matt S Trout
On Thu, Apr 23, 2009 at 09:51:59AM +0100, Mike Glen wrote:
 I think it might be due to line 335 in HTTP.pm
 335 $ENV{PERL5LIB} .= join $Config{path_sep}, @INC;

Hmm. That's to try and make sure -I calls on the original perl invocation
get included. I guess what you need to do is try something like -

my %already;
@already{split(quotemeta($Config{path_sep}), $ENV{PERL5LIB})} = 1;

$ENV{PERL5LIB} .= join $Config{path_sep}, grep !$already{$_} @INC;

or so.

Fancy having a play and seeing if you can come up with a patch for us?

-- 
  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] how to reuse Catalyst Schema for non-web purposes?

2009-04-23 Thread Matt S Trout
On Thu, Apr 23, 2009 at 08:12:23AM +1000, kakim...@tpg.com.au wrote:
  Execution of test - start 
 kakim...@dev-machine:~/projects/myApp/t$ prove -v userSubscriptions.t 
 userSubscriptions.t .. 
 ok 1 - use myApp::Schema::UserSubscriptions;
 ok 2 - The object isa myApp::Schema::UserSubscriptions
 ok 3 - myApp::Schema::UserSubscriptions-can('subscriptions_id')
 ok 4 - myApp::Schema::UserSubscriptions-can('name')
 ok 5 - myApp::Schema::UserSubscriptions-can('user_id')
 ok 6 - myApp::Schema::UserSubscriptions-can('comments')
 ok 7 - myApp::Schema::UserSubscriptions-can('rea_agent_code')
 1..7
 Can't call method resolve on an undefined value at
 /usr/local/lib/perl5/site_perl/5.8.9/DBIx/Class/Row.pm line 720.
 # Looks like your test exited with 255 just after 7.
 Dubious, test returned 255 (wstat 65280, 0xff00)
 All 7 subtests passed 

 foreach my $new_subscription ( @user_subscriptions )
 {
 my $new_user_sub = $package_name-new();
 isa_ok ( $new_user_sub, $package_name );
 
 foreach my $attr ( keys %{$new_subscription} )
 {
 can_ok ($new_user_sub, $attr);
 $new_user_sub-$attr($new_subscription);
 }
 $new_user_sub-insert();
 }

Right, so, you've created a row object directly with new(), never
associated it with a live, connected $schema, and then you're trying
to -insert. The error message could be better, but of -course- that
doesn't work. You wanted to create a $schema and do -

$schema-resultset('User')-new({});

I suspect. Please don't just guess how to use DBIx::Class outside of
Catalyst, read the DBIx::Class manual - and please ask further DBIx::Class
specific questions on the relevant list; this isn't really anything to
do with Catalyst ...

-- 
  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] how to reuse Catalyst Schema for non-web purposes?

2009-04-22 Thread Matt S Trout
On Wed, Apr 22, 2009 at 02:41:34PM +1000, kakim...@tpg.com.au wrote:
 hi guys,
   I just looked at my app and found that I need to reuse the Schema
 files found in my 'Schema' directory.

Your DBIC classes aren't connected to the Catalyst app at all. That's
intentional. Just use DBIx::Class the way DBIx::Class is documented in and
of itself. The DBIx::Class list is also on http://lists.scsys.co.uk/ if you
get stuck - if you're getting an error show your code and the complete error
on there.

-- 
  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] Couldn't instantiate component AddressBook::Model::AddressDB

2009-04-22 Thread Matt S Trout
On Wed, Apr 22, 2009 at 01:15:18PM +0200, Kiffin Gish wrote:
 Actually both People.pm and Address.pp were generated and can be found
 in the directory: lib/AddressBook/Schema/AddressDB/Result/.
 
 I thinks that's the problem.

Right, the DBIx::Class helper now uses load_namespaces style by default,
because that's the recommended standard these days.

The book uses the older load_classes style. If you just remember to mentally
include ::Result:: when modifying those files you should 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] C::Engine::HTTP taking very long

2009-04-21 Thread Matt S Trout
On Tue, Apr 21, 2009 at 10:10:54AM +0200, Ian Wells wrote:
 2009/4/20 Matt S Trout dbix-cl...@trout.me.uk:
  Depends if you're going to write the patch - I don't have any networks with
  broken DNS to test on so I can't really do it ...
 
 I wasn't aware I did either, but there you go.
 
 I'll keep quiet and update to 5.8 instead, I think.  Seems like the
 easier solution.

Can you put something on the wiki as well please?

People keep asking for this, getting it explained to them, deciding not to
write a patch and then vanishing - it'd be really nice if you could explain
things somewhere in such a way that hopefully the next guy can reach
enlightenment without us having to go over it again :)

-- 
  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] [PATCH] Catalyst::DispatchType::Chained (5.7101, 5.80001)

2009-04-21 Thread Matt S Trout
On Mon, Apr 20, 2009 at 09:48:57PM +0100, Tomas Doran wrote:
 
 On 20 Apr 2009, at 20:58, Oleg Kostyuk wrote:
 
 I don't think that was what Matt asked for. Anyways,
 1) Why can't your changes be a patch to Text::SimpleTable?
 I think that new module will be better in this case, because someone
 else can be needed unchanged Text::SimpleTable.
 
 sri _wrote catalyst_, I'm sure he wouldn't mind us patching  
 Text::SimpleTable (which was probably written for Catalyst!)

Indeed it was, in order to get rid of whatever we used before, which was
somewhat weird and crufty.

Of course by the time he did andyg and I had fixed all the memory leaks
in the old one, finally, but it was still a good replacement :)

-- 
  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] Local action in controller not mapping to template (retry)

2009-04-21 Thread Matt S Trout
On Mon, Apr 20, 2009 at 07:31:52AM -0700, Anne Brown wrote:
 Unfortunately, my manuals show it.  So do the PODs.  I use ppm on Windoze to
 download perl modules.  I couldn't find any repositories with later versions
 of Catalyst or the manual.

I think ppm.tcool.org should have something recent. Make sure you ask for
Catalyst-Runtime and Catalyst-Devel rather than just Catalyst though.

-- 
  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] Local action in controller not mapping to template (retry)

2009-04-20 Thread Matt S Trout
On Sun, Apr 19, 2009 at 07:55:31AM -0700, Anne Brown wrote:
 Apache says:
 
File does not exist: c:/webs/webapp/www/somecontroller/

Then the request isn't even getting to Catalyst. Check your apache config.

-- 
  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] Perplexed Catalyst newbie

2009-04-20 Thread Matt S Trout
On Sun, Apr 19, 2009 at 01:05:25PM -0700, Sean McAfee wrote:
 I changed $c-model('Language') to $c-model('DB::Language') in my
 controller, but as far as I can tell, nothing has changed.  I still get
 Quiz::Model::DB::Language objects back, not Quiz::Schema::Language objects.
 The snippet above produces the same output, including the oddball unblessed
 array reference.

Model::DBIC::Schema uses $schema-compose_namespace which creates
Quiz::Model::DB::Language as a subclass of Quiz::Schema::Language so that
if you want you can create a lib/Quiz/Model/DB/Language.pm file to add
Catalyst-app-specific methods to your row objects.

A documentatoin patch for Model::DBIC::Schema explaining this more clearly
would be very welcome.

-- 
  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] Perplexed Catalyst newbie

2009-04-20 Thread Matt S Trout
On Sun, Apr 19, 2009 at 09:51:42PM -0700, Sean McAfee wrote:
 [% FOR a IN as; FOR b IN a.bs; b.cs; br; END; END %]

b.cs here is equivalent to:

my $val = [ $b-cs ];

not

my $val = $b-cs;

You probably wanted b.cs_rs, which always returns a resultset.

-- 
  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] [PATCH] Catalyst::DispatchType::Chained (5.7101, 5.80001)

2009-04-20 Thread Matt S Trout
On Mon, Apr 20, 2009 at 05:16:55AM +0300, Oleg Kostyuk wrote:
 PS: probably, it's needed to check all other places, that use 
 Text::SimpleTable

That'd be well worth doing. Please send us a patch if you find any more when
you check them :)

-- 
  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] C::Engine::HTTP taking very long

2009-04-20 Thread Matt S Trout
On Mon, Apr 20, 2009 at 01:26:57PM +0200, Ian Wells wrote:
 2009/4/20 Andrew Rodland arodl...@comcast.net:
  The time spent in inet_ntoa
  is your system DNS resolver choking while trying to reverse-lookup the 
  source
  IP address of the request. Most likely situation: you're using RFC1918
  addresses and your network is set up improperly to do DNS for these. If you
  can't fix this, hosts file entries might alleviate the problem.
 
 I wouldn't necessarily assume that everyone has reverse lookup DNS on
 their test network.  (Mine certainly doesn't, and I've been bitten by
 this slowing things down in the last few days.)  Is there any chance
 we could make this lookup configurable?

Depends if you're going to write the patch - I don't have any networks with
broken DNS to test on so I can't really do it ...

-- 
  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] upon successful login, how do i get redirect users back to the page they wanted to access previously?

2009-04-19 Thread Matt S Trout
On Sun, Apr 19, 2009 at 07:06:14AM +0900, J. Shirley wrote:
 On Sat, Apr 18, 2009 at 10:19 PM, kakim...@tpg.com.au wrote:
  I tried using FLASH and yet it doesn't work for me.
  The value  I set in the flash gets lost after a redirect. Sorry to ask
  but does flash really work and is it reliable? I know setting stuff in
  the session variable is definitely reliable.

That was a really silly question.

Does X really work is basically saying are the developers idiots?. If it
didn't work, we'd have a failing test case and be trying to write a patch or
it'd go into the docs.

Of course, flash by its nature isn't always safe under e.g. multiple tab
situations etc. but that's down to -what- it is, not the implementation.

 
   1) I access www.lginsurance.com.au/subscriptions/add
   2) Since I am not logged in, Root-auto() kicks in and calls
  Login-index()

Ok, so at this point you haven't changed the URL at all. Why bother changing
it?

What I usually do is $c-forward to my login action, which tests for
__login_user and __login_pass fields and if present, tries to login. If
that works, it just returns and the request goes on as normal. If not,
it sets up the login form and does $c-detach.

For bonus points you can save the POST params (if any) and the HTTP method
(if not POST) into the login form so you can provide the exact same
environment - you can't redirect to a POSt request but you -can- allow
one to continue ...

-- 
  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] What's the best way to exclude static requests from needing user to log in?

2009-04-19 Thread Matt S Trout
On Sun, Apr 19, 2009 at 10:06:51AM +1000, kakim...@tpg.com.au wrote:
 
 hi, all
 
what's the best way to exclude static requests from needing the user
 to log in?
 Some parts of my site are open to general public. For example, the
 'contact us', 'services portfolio' and so forth pages.
 
   At the moment, I have put in codes in my MyApp::Controller::Root-auto
 and it seems to want every request to be logged on.

Two options:

(1) (preferred) use Chained and have two root chain points, one that requires
login and one that doesn't

(2) sub static_serving_thing :NoLogin and check for
$c-action-attributes-{NoLogin} in your root auto

I'd suggest avoiding the ACL plugin; the implementation's a complete hack
and Chained effectively obsoletes it anyway.

-- 
  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] Google Summer of Code: mentors, projects

2009-02-22 Thread Matt S Trout
So, the Summer of Code is fast approaching, so I need two things out of
you wonderful people:

(1) if you think you might be able to mentor, yell - and outline what areas
you think you'd prefer doing so in[0]

(2) suggestions for projects that *would appeal to a student to work on.[1]
Note that your suggestion will carry a lot more weight if you're willing to
do the doc/writeup and even more if you're willing to mentor it :)

We have a few people working on student recruitment, and I'll post later
about how anybody else who wants to work that side of things can help out.

For now, we need to make a list of mentors and projects so we can get that
sent out and set up - if we don't get slots, nothing else matters sadly.

Excessive bikeshedding will result in me resetting the thread with a new
summary email and killfiling the old one; we don't have time for it, sorry.

[0] note that you shouldn't worry too much about expertise here - I intend
for a number of us to provide backup services to mentors in terms of
technical knowledge, the key requirements here are interest and time

[1] I'm not interested in your personal wishlist of features here, mine's
probably at least as long as yours and I'm not inflicting it on the list
just now so please show the same courtesy :)

-- 
  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] London Perl tutorials - 25th 26th February 2009 - day 2 includes Cat+DBIC

2009-01-21 Thread Matt S Trout
Ok, so, as a favour to the UKUUG and to Dave Cross, founder of the illustrious
london.pm and person mad enough to let me split the tutorial time at the
London Perl Workshop 2008 with him, I hereby re-appear on the lists to
point out that there are tutorials going on, and those of you attempting to
get people up to speed or rescue PHP developers or whatever might be
interested in it.

So, if you are interested, here's the details -

UKUUG (in conjunction with O'Reilly) presents:

Introduction to Perl - 25th February 2009 

Advanced Perl Techniques - 26th February 2009

Tutor: Dave Cross

see:  http://www.ukuug.org/events/perl09/

Day 1: Introduction to Perl - 25th February:

This one-day course is an introduction to Perl for complete beginners. No 
knowledge of Perl is assumed, although attendees will have a slight advantage 
if they have some knowledge of at least one other programming language. At 
the end of the course, attendees will have enough knowledge to write a number 
of useful Perl programs, together with details of where to go for more 
information.

Syllabus: 
What is Perl 
Input and output 
Creating and running a Perl program 
Regular expressions 
Perl variables 
References 
Operators and functions 
Finding and using modules 
Conditional constructs 
Smart matching 
Subroutines 


Day 2: Advanced Perl Techniques - 26th February:

Perl has come a long way since the scripting language which powered most of 
the world wide web in the 1990s. There are many ways to build applications in 
Perl. In this course we will look at some powerful techniques which are used 
by the best Perl programmers in the world. This one-day course is aimed at 
programmers who have been using Perl for some time but who may not be 
completely up to date with the latest Perl techniques. At the end of the 
course attendees will have a number of modern Perl programming techniques to 
their programming toolkit. 

Syllabus: 
What's new in Perl 5.10 
Dates and times
Testing (including coverage analysis)
Database access with DBIx::Class
Profiling 
Object oriented programming with Moose
Templates 
Web application development with Catalyst 

TUTOR Biography:
Dave Cross is the owner of Magnum Solutions Ltd, an Open Source consultancy 
company based in London. In 1998 he started london.pm which has grown to be 
one of the largest Perl Mongers groups in the world. He nominally led the 
group until September 2001. Between August 2002 and June 2006 he was the Perl 
Mongers User Groups Co-ordinator for the Perl Foundation. Dave is a regular 
speaker at Perl and Open Source conferences and is often invited to present 
tutorials alongside the main conference. He is the author of Data Munging 
with Perl (Manning, 2001) and a co-author of Perl Template 
Toolkit (O'Reilly, 2003). Dave lives in South West London. The rumours about 
gold-plated cats were never true.

Each day starts at 09:30 - ends approx. 17:00 each day

-- 
  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] noob question about session timeouts

2008-11-15 Thread Matt S Trout
On Sun, Nov 02, 2008 at 10:20:08PM +, Peter Flanigan wrote:
 Cliff Green wrote:
 When a session expires in the app I'm putting together, the user is sent 
 back to the login screen at the next request, as expected.  What I'd 
 like to do is stuff something like 'Session Expired' into 
 $c-stash-{error_msg} and have it displayed, letting the user know what 
 just happened.
 
 Read up on Catalyst::Plugin::Session::flash

No, don't. We stole that from rails because it seemed like a good idea at
the time.

It isn't. It's evil, horrible, inefficient, and if you think you wanted it,
you didn't (multi tab issues, refresh issues, race conditions, dead kittens
etc.).

If you really want transient data of that ilk, stuff it in $c-cache under
a key starting with the session id.

... if I write up an outline of how you'd generalise that, anybody fancy
having a go at hacking it together?

-- 
  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] noob question about session timeouts

2008-11-15 Thread Matt S Trout
On Sun, Nov 02, 2008 at 04:00:13PM -0500, Cliff Green wrote:
 When a session expires in the app I'm putting together, the user is sent 
 back to the login screen at the next request, as expected.  What I'd 
 like to do is stuff something like 'Session Expired' into 
 $c-stash-{error_msg} and have it displayed, letting the user know what 
 just happened.
 
 I've tried things like
  unless ($c-session_expires) {
 $c-stash-{error_msg} = 'Session Expired!';
  }
 
 in, variously, Root.pm and Login.pm but of course it doesn't work.
 
 Alternatively, it would be nice to know how to use something along the 
 lines of
  $c-stash-{error_msg} = $c-session_delete_reason;

That accessor is only set if the session was deleted this request, so why
not just do

if ($c-session_delete_reason) {

?

-- 
  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] [META] Advent calendar

2008-11-15 Thread Matt S Trout
On Wed, Nov 05, 2008 at 05:50:42AM -0800, J. Shirley wrote:
 On Tue, Nov 4, 2008 at 9:47 PM, Kieren Diment [EMAIL PROTECTED] wrote:
  On Tue, Nov 04, 2008 at 04:19:38PM -0600, Jonathan Rockway wrote:
  * On Tue, Nov 04 2008, Dermot wrote:
   Is there going to be an advent calendar for this year?
 
  Sure, why not?
 
 
  It's been in planning for a while.
  http://dev.catalyst.perl.org/wiki/advent08plan
 
  Please feel free to add suggestions as they arise.
 
 
 I've done something remarkably similar to the streaming FLV stuff, but
 don't have the source.  I do, however, have an encoding script I wrote
 ages ago to convert to FLV via mencoder.

We've been starting to put videos up on http://www.shadowcat.co.uk/ - I can
write up what we did if people find it sufficiently exciting.

-- 
  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] [META] Advent calendar

2008-11-15 Thread Matt S Trout
On Tue, Nov 04, 2008 at 10:14:11PM +, Dermot wrote:
 Is there going to be an advent calendar for this year?

No, there isn't.

Instead, we're going to rename Catalyst to AliMojo::Mojo::Mojo for maximum
naming confusion to the stupid and fuck off down the pub.

... no, really, of course there'll be an advent calendar. What entry are
you going to write?

-- 
  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] Re: recommendation

2008-11-15 Thread Matt S Trout
On Mon, Nov 10, 2008 at 09:40:13PM +0200, Octavian Rasnita wrote:
 although it's not what you asked, i'll comment that i've had great luck
 doing this the other way round: i write the classes (with a lot of help
 from an emacs template*) and generate a DDL script from those.  in
 addition to making table creation trivial, sqlt-diff produces scripts
 which (usually) do a fine job of upgrading from one version to another.
 
 see create_ddl_dir() here: http://tinyurl.com/5vgwcj and sqlt-diff here:
 http://tinyurl.com/6ql6wo for details.
 
 i'm much better at writing perl classes than DDL though, so it was
 obvious that this was the right thing for me in a 50 table, 10 view
 database.  no doubt your mileage will vary.
 
 
 k.
 
 This could be also a good solution, but unfortunately it gives so many 
 errors that it would be more simple to update the DBIC classes manually.
 I've just tried create_ddl_dir again to see if it works better now, but I 
 needed to make more tens of corrections for a database with only 10 simple 
 tables.

This approach *is* best practice and it *does* work fine for SQLite, MySQL
and Postgres at least.

If you need to make tens of corrections, one of two things is happening:

(1) you've found a bug and should have reported it but didn't

(2) you did something wrong

Either way, please get on the dbix-class list and report what code you have
and we can tell you which it is.

-deploy *is* best practice, it *does* work and it's going to be marked
non-experimental for 08100.

-- 
  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] recommendation

2008-11-15 Thread Matt S Trout
On Mon, Nov 10, 2008 at 08:46:21PM +0200, Octavian Rasnita wrote:
 However, if I need to use DBIx::Class::DigestColumns, I don't know how to 
 add the following statement in a BEGIN block after it was already created 
 by the Catalyst helper without the digest_check_method key:
 
  __PACKAGE__-add_columns(
'password' = {
  data_type = 'char',
  size  = 32,
  digest_check_method = 'check_password',
  }

You can call add_columns again with the extra info.

DBIx::Class doesn't mind.

-- 
  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, MVCs and other MVCs

2008-11-15 Thread Matt S Trout
On Tue, Nov 04, 2008 at 05:56:51PM +1100, Adam Clarke wrote:
 Our first experiences of trying to use  
 it were quite frustrating - there were zillions of dependencies to be  
 met and this could take a fair bit of perseverance since they would  
 often fail to install for reasons which were difficult to determine. I  
 believe this situation has improved significantly.

If you have a rig capable of installing both XS and non-XS CPAN modules
at all, Catalyst -should- install cleanly.

If it doesn't, we want to hear about it. Or at least I do.

I was highly amused to see that Mark Stosberg (CGI::App maint) recently
complained that Catalyst had far too many dependencies and he didn't like
that ... having counted them against a SUCCESSFUL INSTALL.

-- 
  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] Running multiple instances on an application

2008-11-15 Thread Matt S Trout
On Tue, Nov 04, 2008 at 01:24:22PM +0100, Christian Lackas wrote:
 Hi Everybody,
 
 I would like to have multiple (20-50) instances of a Catalyst
 application running using FastCGI. Since this would result in quite a
 few preforked processes, I wondered if it is possible to just use one
 set of FastCGI processes and have different config files for different
 domain names.  In the configuration I would then have the connect string
 for the different database, local folders, etc...

Not out of the box but with ACCEPT_CONTEXT on your model (see
Catalyst::Component::InstancePerContext for a nice wrapper for this) it
shouldn't be too difficult.

 Can I re-load a config file at the very beginning of request handling?
 And does a Catalyst::Model::DBIC re-connect for every request or keep
 the connection open for the life-time of the process?

Lifetime of the process by default but that's because the DBIC $schema
lasts the lifetime of the process. If you have your own per-context stuff
then you can control the lifetime however you like.

-- 
  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] Feature Request: Parameter Junctions

2008-11-13 Thread Matt S Trout
On Wed, Oct 22, 2008 at 02:34:19AM -0700, Ovid wrote:
 There's an idea I've toyed with for Perl 6's CGI.pm and I think it might 
 prove useful for Catalyst:  allow junctions for request parameters.  Consider 
 the following:
 
   # ?sport=football
   my $params = $c-request-query_parameters;
   # { sport = 'football' }
 
 But if there are multiple paramters:
 
   # ?sport=football;sport=seal%20clubbing
   my $params = $c-request-query_parameters;
   # { sport = [ 'football', 'seal clubbing' ] }
 
 Because multiple parameters are supplied, the data structure changes!  All an 
 attacker needs to do is is tack on a duplicate parameter to a query string a 
 see if the code crashes.  Worse, if there are already multiple parameters, 
 the attacker can restrict them to a single parameters and you'll likely fail 
 when you attempt to dereference:
 
   @ {$params-{sport} }
 
 I think this could be eliminated by using an 'any' junction:
 
   my $sport = $c-request-get_param('sport');

my $sport = Perl6::Junction::any($c-req-param('sport'));

TADA.

-- 
  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] test server running off of ipv6?

2008-11-13 Thread Matt S Trout
On Thu, Oct 23, 2008 at 11:31:39AM -0700, marcus.baker wrote:
 
 I'm running off of a linode ubuntu image, ipv6 is compiled into the kernel.
 
 When running my app_server.pl, it's binding to ipv4.  Via netstat -ntl:
 tcp0  0 0.0.0.0:30000.0.0.0:*   LISTEN
 
 From reading around it seems like there's some situation where linux
 machines can't listen to ipv4 and ipv6 at the same time.  Again, it seems
 that ipv6 support is compiled in so I can't disable it via the modprobe
 aliases and would rather not bother recompiling (although it looks like I
 may have to).
 
 I'm wondering if there's been any attempt to get the test server going on
 ipv6?  I attempted altering Catalyst::Engine::HTTP to use IO::Socket::INET6
 instead of IO::Socket::INET, seemed to get it listening a bit but then it
 seemed like there were other pieces of code that also need to be updated to
 work on ipv6 and didn't want to get to far into it without seeing if
 progress had been made elsewhere.

I don't know of any work in that direction but I'm sure we'd love to see
somebody give it a go - consider starting a thread on catalyst-dev about
this.

Also, please subscribe to the list rather than using nabble - we tend to
have to block them every so often when they forget what read only is and
start letting spam through.

-- 
  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: SimpleDB - Auth configuration made easy

2008-11-13 Thread Matt S Trout
On Mon, Oct 27, 2008 at 11:57:00PM -0600, Jason Kuri wrote:
 You can get clear passwords with no warnings by dropping SimpleDB for
 configuration purposes and using a 'standard' auth config that looks
 like this:

Which hides the badness.

Frankly I'd like to see -all- of authentication warn on cleartext passwords
unless you add some (preferably long) config option like
insecure_password_storage_ok. The best thing about this is it makes it
obvious to a -maintainer- that their predecessor did this.

Remember that the person who benefits from seeing that that option has
been turned on may not be the person who originally turned it on.

-- 
  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] how do i truss an catalyst FCGI worker process?

2008-11-13 Thread Matt S Trout
On Wed, Oct 29, 2008 at 02:50:17PM +0300, Oleg Pronin wrote:
 Hi.
 
 I need to inspect my fcgi process, so i tried to do
 truss -p fcgi_worker_pid
 But fcgi process immediately exits when truss just starts.
 
 Does anyone know why does it happen and how to get it to work?

truss a separate copy fired up without -n against the same socket - then
you won't have the proc manager involved and the process won't exit. Since
it'll be sharing the socket with the rest of the fcgi procs it'll get its share 
of requests just the same, so the data should be just as valid.

-- 
  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: Off Topic: Re: [Catalyst] [Announce] MojoMojo 0.999021 has been released to CPAN

2008-11-13 Thread Matt S Trout
On Sun, Nov 02, 2008 at 10:10:21AM +0200, Ali M. wrote:
 There is another project by Sebastien Riedel, and its called Mojo,
 just one Mojo.
 
 I think the people working on MojoMojo, should contact Sebastien and
 work out the naming thing, because it sometimes gets confusing
 following the news about either.

Sebastian well knows, he founded the Catalyst project back in the day and
was here when MojoMojo was first started (which was at least 3 years ago, I
think - before I joined the project, anyway).

If you think he should rename Mojo, please feel free to email him off list
- but please don't clutter the Catalyst list with something that's nothing to
do with Catalyst -or- MojoMojo.

-- 
  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] Water the grass roots, please

2008-11-12 Thread Matt S Trout
Perlbuzz was kind enough to post an article by jshirley providing a
different view of Catalyst; I've lobbed it at reddit:

http://www.reddit.com/r/programming/comments/7czb5/populist_not_dictatorial_the_catalyst_web/

-- 
  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: SimpleDB - Auth configuration made easy

2008-10-27 Thread Matt S Trout
On Mon, Oct 27, 2008 at 03:51:49PM -0700, Darren Duncan wrote:
 Zbigniew Lukasiak wrote:
 * Your passwords are stored in the 'password' field in your users
 table and are not encrypted.
 
 This is always a bad idea.  If someone ever gets direct database access, 
 they now know each user's mindset as to how they choose passwords

This is the catalyst list, not the stating the fucking obvious list.

-- 
  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] Success stories please

2008-10-05 Thread Matt S Trout
http://perlbuzz.com/2008/10/whats-the-state-of-perl-web-frameworks.html

Shout out your support please, let's show the wider world that we're -the-
real MVC option right now. And be honest - I don't think anybody thinks the
docs are perfect or the learning curve's as shallow as it could be, but that
doesn't mean Catalyst isn't still awesome.

-- 
  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, DBIx::Class and Moose training in the UK

2008-10-01 Thread Matt S Trout
On Tue, Sep 30, 2008 at 12:37:22PM -0400, Carlos Arenas wrote:
 i am very much interested.
 
 do you have pricing info available?  and what is the profile for
 attendees of both types of sessions?

I'll reply to this off-list tomorrow; I'm trying to keep discussion of
details off the mailing list since this isn't really a forum for me to
advertise shadowcat's services so I'm trying to make people aware we're
doing stuff while keeping traffic to a minimum :)

-- 
  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, DBIx::Class and Moose training in the UK

2008-10-01 Thread Matt S Trout
On Wed, Oct 01, 2008 at 08:48:33AM +0100, Dermot wrote:
 I would be interested. I would be nervous that I do not have the same
 level of skill or development exposure as some of the others. *Have I
 just voided my application*. We start an in-house project in the next
 month and I have recommended using Cat/Postgres so I want to get up to
 speed. I did enquiry with Mark Keating but he didn't get back to me.
 :-/

I think he might have been fighting VAT returns the past day or two so
he'll get back to you as soon as he has a minute.

If you re-send cc mst -at- shadowcat.co.uk I'll make sure he replies.

-- 
  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] fcgid

2008-09-30 Thread Matt S Trout
On Mon, Sep 29, 2008 at 09:46:42AM -0400, John Lee wrote:
 Matt S Trout wrote:
  fcgid is designed for shared hosting. it's basically useless for dedicated
  setups.
  
  I ask this, because it seems that it works better than fastcgi, it is 
  maintained and prefered, but I can't see why.
  
  mod_fastcgi is maintained, just minimally and quietly, and it works
  perfectly.
  
  For dedicated setups it's the only option; I dunno who you think prefers
  fcgid but I'm certainly not one of them.
  
 
 Hmm, now I'm all confused.  We'd recently switched to mod_fcgid from
 handling fastcgi with lighttpd, due to its better process management.
 However, I'm always akin to trying new things, so this piques my
 curiosity around mod_fastcgi.
 
 What's the general concensus in the catalyst community nowadays?  Is
 mod_fastcgi preferred at large over mod_fcgid these days? 

You shouldn't let your fastcgi module do process management at all, anyway,
that's what FCGI::ProcManager is for - and by having the fastcgi stuff
external you can, as Peter Karmen points out, bounce the application
separately. Not only that but you can do zero-downtime upgrades by starting
the new version on the same socket -before- stopping the old version.

 I saw a post
 from Jonathan Rockaway almost two years ago noting that mod_fastcgi is
 crufty and slightly broken, while mod_fcgid seems to be more sane,

*shrug*

Jon's an apps dev. I'm ex-operations and design system deployment strategies
on a regular basis. His opinion doesn't count in my world, I don't let client
developers anywhere near systems stuff if I can help it :)

Note though that fcgid -is- more sane for shared hosting and for the web
server doing process management.

But as noted above, for dedicated production deployments you don't want that
anyway, and mod_fastcgi isn't broken at all, it's just picky about its config
sometimes :)

Also, mod_fastcgi isn't maintained as actively. But that's because it
already works, so they just put out the occasional bugfix release :)

-- 
  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] Catalyst, DBIx::Class and Moose training in the UK

2008-09-30 Thread Matt S Trout
Shadowcat are looking to start offering training in Catalyst, DBIx::Class
and Moose usage, both introductory sessions and more advanced workshop-style
classes. The intended format would be two-day classes on site in Lancaster
(we'll either arrange accommodation or people can organise their own if
they prefer) with a maximum class size of about 10 to ensure there's plenty
of space for one on one time during exercises etc.

Planned time frame for this is to have the first round of classes in Q12009.

If anybody's interested in this, please send mail to mst -at- shadowcat.co.uk
(or just reply to this mail with comments)

-- 
  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] mix authentication stores

2008-09-30 Thread Matt S Trout
On Tue, Sep 30, 2008 at 08:58:04PM +0200, Stephan Jennewein wrote:
 Hi,
 
 is it possible to use ldap to authenticate and dbic (a database) to handle 
 the 
 user role relation ? So that it works like it resides all in one storage 
 backend.
 If yes how do I configure that in the $application.conf ?

LDAP credential.

DBIx::Class store.

See authentication docs for how to configure each.

-- 
  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] mix authentication stores

2008-09-30 Thread Matt S Trout
On Tue, Sep 30, 2008 at 02:26:41PM -0500, Jonathan Hall wrote:
 Not directly... it's not even possible in DBIC to have relationships 
 between different databases, which is essentially what you're talking 
 about doing.

Unless you count mysql as a database in which case -table('otherdb.foo')
works just fine.

But yeah, DBIC's relationships are specifically things that can be JOINed.

LDAP doesn't count. Fortunately, see my point about store and credential
being different in auth as a possible approach. I'm poking Jay Kuri to
elaborate and/or tell me I'm talking crap :)

-- 
  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] DBIx::Class and Catalyst - Trying to make sense of it all.

2008-09-29 Thread Matt S Trout
On Sun, Sep 28, 2008 at 10:15:25AM -0400, Leanan Sidhe wrote:
 First, I apologize for the completely noob tone of this email.  I've read
 through the perl docs for DBIx::Class, and various Catalyst parts, but I'm
 having problems understanding how DBIx::Class stuff is slightly different in
 Catalyst.
 
 For example, in the DBI docs, I constantly see the following:
 
 $schema-resultset('table_name')-search();

No you don't.

The argument to resultset is the source name, which is by default the last
part of the class name.

So for My::Schema::Foo, it'd be $schema-resultset('Foo'), the table name
could be 'tbl_foobar_baz' or whatever for all DBIx::Class cares so long as
you pass that to -table.

 in Catalyst, this seems to be
 $c-model('table_model_package')-search();

No. Basically for each valid argument to $schema-resultset,
Catalyst::Model::DBIC::Schema sets it up so that

$c-model('NameOfModel::${arg_to_resultset}') is a shortcut to
$c-model('NameOfModel')-schema-resultset($arg_to_resultset).

 I get that and it's not too rough.
 
 But then where I get hung up is that I have a few table relationships I want
 to query.  Say I have the following tables / relationships:
 
 users:
   user_id
   user_name
   pass
 
 cards:
   card_id
   card_name
   card_description
   set_id
 
 sets:
   set_id
   set_name
 
 user_cards:
   id
   user_id
   card_id
 
 A card has a set
 A set has many cards
 A card has many user_cards
 A user_card has a user
 A user_card has a card
 
 Now, say I want to have a page that lists out all the cards a user has.
 Right now I have one user, so I'm not doing much on the user id.  Ok, that's
 simple, I just do:
 
 my $user_cards = $c-model('Model::for::UserCards');
 my $cards = $user_cards-search_related('cards');

That's completely wrong.

What you want is:

my $user = $c-model('ModelName::User')-find($user_id);

my $cards = $user-cards;

If you're using Catalyst::Authentication::Store::DBIx::Class you can do

my $user = $c-user-obj;

to get the DBIC object for the user.

If you want more information on using DBIx::Class, please post to the
DBIx::Class list - the $c-model shortcut for $schema-resultset is the
-only- thing that's different between normal DBIC usage and DBIC under
Catalyst, and that's not so much a difference as an extra handy feature :)

-- 
  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] fcgid

2008-09-27 Thread Matt S Trout
On Sun, Sep 14, 2008 at 03:00:48PM +0300, Octavian Rasnita wrote:
 Hi,
 
 I understand that comparing it with mod_perl, fast CGI has the advantage of 
 allowing us to restart the applications without restarting the server.
 But I have also understood that fcgid don't allow using the app as an 
 external server.
 
 If this is true, than which is the advantage of fcgid?

fcgid is designed for shared hosting. it's basically useless for dedicated
setups.

 I ask this, because it seems that it works better than fastcgi, it is 
 maintained and prefered, but I can't see why.

mod_fastcgi is maintained, just minimally and quietly, and it works
perfectly.

For dedicated setups it's the only option; I dunno who you think prefers
fcgid but I'm certainly not one of them.

-- 
  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] Slow template processing on debian lenny

2008-09-27 Thread Matt S Trout
On Mon, Sep 15, 2008 at 02:17:22PM +0530, Terence Monteiro wrote:
 Hi,
 
 I've been using TT for years and enjoy the features it provides. In one of
 my Catalyst applications, I'm processing a template which generates HTML to
 give me a table with counts taken from a hash. I'm using a lot of nested
 FOREACH to generate the table.
 
 On my machine, an ubuntu hardy, it works fast - about 2.5 seconds to
 process the template. On a production server using debian lenny, it used to
 take around the same amount of time. But recently, I upgraded it to libperl
 5.10 and updated the different Perl modules including Template and
 Catalyst::View::TT. After this upgrade, the same template takes 25 seconds
 on average to process. The times I am mentioning are the times taken on the
 server side, as shown by the Catalyst application debug logs.

Use Devel::NYTProf to find out what specific piece of code causes the
slowness.

Currently you're just waving a torch around in a 20 mile wide pitch black
cave - sure, there's illumination involved, but not of anything relevant to
your problem.

-- 
  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] getting database handles and run arbitrary SQL

2008-09-27 Thread Matt S Trout
On Wed, Sep 24, 2008 at 12:15:08AM -0700, theshz wrote:
 Hi, I'm new to Catalyst, just went through the Tutorial, everything worked 
 fine. But for my reporting application (part of a bigger application where 
 CRUD will be more often), I need to run some complicated querries. I did find 
 the Arbitray SQL article in DBIx's FAQ, but I don't even know how to get to 
 DBIx, if that's the right way, more specifically, 
 
 Is it possible to get the database handle and run SQL directly as in DBI? I 
 read that from Schema I can get its storage, which is the db handle. But from 
 a Controller, how do I get the schema object, or the db handle? If the DBIx 
 is the correct way to go (which seems a lengthy way to just run a query), 
 do I do $c-model('Some::Model')-resultset?

If you aren't planning to use DBIx::Class at all, I'd recommend
Catalyst::Model::DBI

If you're using DBIx::Class, I'd recommend abstracting the query away behind
a resultset method - something like

sub my_custom_query {
  my ($self, @args) = @_;
  my $code = sub {
my $dbh = shift;
run query here
  };
  $self-result_source-schema-storage-dbh_do($code);
}

If this example isn't sufficient, you should be asking on the dbix-class
list, not here.

-- 
  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] Chained Regexes

2008-09-27 Thread Matt S Trout
On Wed, Sep 24, 2008 at 07:10:38AM -0700, Ovid wrote:
 Pursuant to a refactoring issue I explained at 
 http://use.perl.org/~Ovid/journal/37525, it would be nice if I could mix 
 regexes with Chained actions.  There are some nice refactoring potential.  
 Plus, by allowing me to apply a regex to a CaptureArg or Arg, I could get 
 404s for free.  Having to write this manually is a bit disappointing.

The solution here is to implement match_captures to do for captures what
match on action objects already does for args.

Having done that, your action class can do pretty much whatever the hell it
wants, regexps or db lookups or etc.

-- 
  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] How to send raw HTTP response

2008-09-27 Thread Matt S Trout
On Thu, Sep 25, 2008 at 08:35:14PM +0200, Christian Lackas wrote:
 Hi Everybody,
 
 is it possible for a controller method to directly produce the raw HTTP 
 response?
 My application generates a (potentially large)) ZIP file on the fly,
 which I don't want to store (on disk or in memory) but rather send it
 directly to the client while producing it.
 
 In a CGI script I use Archive::Zip such as
 
 print CGI::header(...);
 $ZIP-writeToFileHandle(*STDOUT);
 for my $f (@files) {
 $ZIP-addFile($f, basename($f));
 }
 
 How can I achieve something similar under Catalyst?

Just call $c-write($chunk) with each chunk of data as you get it.

Catalyst will automatically send headers before the first chunk for you.

Do -not- rely on STDOUT being an appropriate filehandle to print to, that's
an accident of the engine design and could easily go away.

-- 
  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] Multiple DB, single instance of Cat

2008-09-24 Thread Matt S Trout
On Thu, Sep 11, 2008 at 11:58:31PM +0100, Nigel Stuckey wrote:
 Matt
 
 I stand corrected on DBIx! Yes, indeed I mean DBIx::Class.
 
 The code is in and works, but has a couple of issues. Firstly, it  
 creates new classes and carries out a DB connect every time there is  
 a request. Is there a way to make it more efficient by caching the  
 classes and DB connects once there is a successful authentication?

It should only be creating a new $schema object, see below.

No reasony you can't do

__PACKAGE__-mk_accessors('connection_cache');

and then set that to {} somewhere early and keep the $schema objects in
there.

I didn't do this in my example because (1) IT WAS A SIMPLE EXAMPLE (2)
writing caching code is simple, except you need to handle cache expiry
and stuff and I didn't have time to write example code for all of that :)
 
 Secondly, there are loads of 'ACCEPT_CONTEXT redefined' messages, one  
 per DB table defined to the DBIC model. When initialising, I have to  
 give the 'dynamic' model an initial configuration to allow Catalyst o  
 start.

Ah, the class creation and stuff shouldn't be happening. That's me being
silly, what you want to do is

my $new = bless({ %$self }, ref($self));

to bypass the initialisation phase.

 Once the code is working I will pop it on the wiki.

-- 
  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] Race condition in Catalyst::Plugin::Session and Catalyst::Engine::Apache (possibly other engines too)

2008-09-24 Thread Matt S Trout
On Wed, Sep 10, 2008 at 06:59:21PM -0400, Sergio Salvi wrote:
 There is a race condition in C::P::Session when using
 C::Engine::Apache (and probably other engines too):
 
 I have a simple controller action (let's call it /save) that gets data
 submitted from an HTML form via POST, process that request, stores
 some stuff in the session and flash and then redirects with HTTP 303
 to another action (/display).
 
 The /display action then displays the regular submit successful
 message that was set on the previous action by using $c-flash. The
 problem is that the browser is GETting /display before /save is
 finished storing the session and flash rows in the database. Then, of
 course, /display thinks nothing has happened and doesn't display the
 data from flash.
 
 After a bunch of debugging and stack traces :), I figured out the
 problem is that C::P::Session's finalize() calls $c-NEXT::finalize()
 before calling $c-finalize_session, so
 C::Engine::Apache-finalize_body() gets executed *before* the session
 is flushed in the database, making the browser access /display even
 though the session may not be stored yet:

This was changed by Bill Moseley in order to fix a bunch of other bugs.

Have a look at the ChangeLog - maybe we could provide an option to reverse
the order or find another approach?

-- 
  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] One (central) app, one schema, X databases

2008-09-24 Thread Matt S Trout
On Wed, Sep 10, 2008 at 10:42:35AM +0100, Chisel Wright wrote:
 I'm just in the initial planning phase of a project.
 
 The basic idea is to have X locations running App::Location, each with a
 local database that has a App::Location::Schema.
 
 Everything's the same, just different data in the locations.
 
 We'd like to have a centralised tool to manage App::Location #1 ...
 App::Location #X - App::Central
 
 App::Central may have it's own App::Central::Schema, but it should also
 be able to interact with App::Location::Schema #1 ..
 App::Location::Schema #X.

If you only need one location at once, use the approach I was discussing
in an earlier thread for multiple users.

If you need multiple, maybe add an ACCEPT_CONTEXT onto your M::DBIC::Schema 
that takes a location name, and then modify 

*{${classname}::ACCEPT_CONTEXT} = sub {   
shift;  
shift-model($model_name)-resultset($moniker); 
}   

in M::DBIC::Schema itself to do -model($model_name, @_) then you can do

$c-model('DB::Foo', 'location1');

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

2008-09-24 Thread Matt S Trout
On Sat, Sep 13, 2008 at 10:09:26PM -0500, Jonathan Rockway wrote:
 * On Sat, Sep 13 2008, Zbigniew Lukasiak wrote:
  Hi there,
 
  I did not see how it looked like at the channel a few days ago - but I
  hope that my irc client malfunction did not offend someone too severly
  (unlike that famous wardrobe of some US pop singer).  And that the
  bane for my home machine is not eternal and can be released soon.
 
 You're unbanned now.  In the future, just /msg an op (usually mst) and
 they will take care of it (especially if it's because your client
 malfunctioned).

Yeah. The problem was the malfunction meant I also couldn't effectively
/msg you to say it was just a tempban.

And then I was off to IPW and had no internet and forgot to unban you
before I left because I suck :)

-- 
  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] Database contents not displayed after hitting pagerefresh

2008-09-10 Thread Matt S Trout
On Wed, Sep 03, 2008 at 04:03:27PM +0530, SHARATH GOPINATH RAO,  Chennai wrote:
 
 Matt: So it works on the first request but not on the second?
 
 Yes, it works on the first request and not on second. But, after
 changing it to this: $data = $c-model('Ttrack::Ttrack')-search();
 it's working fine, although any more suggestions are welcome.

It is *not* working, you've just papered over the underlying problem.

Please debug as I suggested otherwise in a few months your app is going to
break again.

-- 
  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] Intermittent blank pages

2008-09-03 Thread Matt S Trout
On Thu, Aug 28, 2008 at 05:44:31PM +0200, Tobias Kremer wrote:
 Quoting [EMAIL PROTECTED]:
  Tobias Kremer [EMAIL PROTECTED] wrote on 08/28/2008 09:02:24 AM:
   Quoting Sebastian Willert [EMAIL PROTECTED]:
Are you using Perlbal in front of FastCGI? Perlbal is prone to deliver
blank pages if the back-end times out. Unfortunately I haven't found
a way to avoid this behavior, but maybe someone on the list can help
out ...
   No, we're using lighttpd and nothing changed on that front during the
  last two
   days :(
  Are they delivered instantly or after a long pause?
 
 Instantly.
 
 I just noticed that shortly after a series of those errors appear in the error
 log, the process gets killed off (and restarted) by daemontools' softlimit due
 to memory constraints.

You might want to load Catalyst::Plugin::AutoRestart as well so the processes
restart themselves gracefully at the end of a request before it hits the
softlimit.

I notice downthread you've solved the underlying problem, but adding
AutoRestart into your setup would mean that if something similar goes wrong
again you'll avoid the firing blanks problem.

-- 
  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] Database contents not displayed after hitting page refresh

2008-09-03 Thread Matt S Trout
On Wed, Sep 03, 2008 at 09:04:23AM +0200, Emmanuel Quevillon wrote:
 You need to perform a search in your 'ShowData' function to get data
 returned by the Resultset of your model 'Ttrack::Ttrack'.
 At this time, $data is only a resultset object without any data in it.
 Replace :
 
 my $data = $c-model('Ttrack::Ttrack');
 
 with
 
 my $data = $c-model('Ttrack::Ttrack')-search();

No, don't do that.

Those two lines are exactly equivalent except that -search will cause
a completely pointless clone of the resultset.

$c-model('Ttrack::Ttrack') is -already- a resultset for the whole table.

That's why there's something in there to search on.

-- 
  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] Database contents not displayed after hitting page refresh

2008-09-03 Thread Matt S Trout
On Tue, Sep 02, 2008 at 09:48:08PM -0700, cranky wrote:
 
 Hi, I'm a newbie to catalyst. I have built a small app, similar to the one in
 catalyst manual (basic CRUD). I have a page wherein a table displays its
 contents after getting it from the database (SQLite3), the problem is, it
 doesn't display the contents after I refresh the page.

So it works on the first request but not on the second?

-- 
  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] Database contents not displayed after hitting pagerefresh

2008-09-03 Thread Matt S Trout
On Wed, Sep 03, 2008 at 04:03:27PM +0530, SHARATH GOPINATH RAO,  Chennai wrote:
 
 Matt: So it works on the first request but not on the second?
 
 Yes, it works on the first request and not on second. But, after
 changing it to this: $data = $c-model('Ttrack::Ttrack')-search();
 it's working fine, although any more suggestions are welcome.

You have an ancient version of something then that's caching the resultset.

Upgrade Catalyst::Model::DBIC::Schema and DBIx::Class.

-search() is just a copy constructor. Emanuelle doesn't know what the fuck
he's talking about.

-- 
  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] Intermittent blank pages

2008-09-03 Thread Matt S Trout
On Wed, Sep 03, 2008 at 01:45:47PM +0300, Octavian Rasnita wrote:
 From: Matt S Trout [EMAIL PROTECTED]
  You might want to load Catalyst::Plugin::AutoRestart as well so the 
  processes
  restart themselves gracefully at the end of a request before it hits the
  softlimit.
 
 Do you know if there is a similar solution that can be used under Windows?

Write one and send it to the authors, I'm sure they'd be happy to take 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] Duplicate entries with C::P::Session::Store::DBIC and MySQL - new findings

2008-08-27 Thread Matt S Trout
On Wed, Aug 27, 2008 at 10:41:11AM +0200, Tobias Kremer wrote:
 Quoting Moritz Onken [EMAIL PROTECTED]:
  Am 27.08.2008 um 10:19 schrieb Tobias Kremer:
   Ok, a second glance (after the first coffee) revealed that the
   separation is indeed there :) The question is, why?
 
  Just guessing:
  not every request has its own session object. There are users with no
  session attached to them.
 
 That was my first guess, too. But AFAICT each and every user receives a 
 session
 on its first visit - logged-in or not.

Only if you write to $c-session.

But if you write to $c-flash, then you have to create a cookie, so I guess
you're effectively creating a session anyway.

So as long as you have to write to one of the two to create a session, I
don't really see a problem.

-- 
  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] Win32, Data::Alias, bad idea or my bad?

2008-08-26 Thread Matt S Trout
On Tue, Aug 26, 2008 at 03:20:14PM +0200, Kai Andresen wrote:
 Hello all,
 
 I've been trying to get a nice litle Catalyst application to run on
 developers win32 machines the recent week.
 
 Strawberry, ActiveState and Cygwin. All fail on something, but they all fail
 on building Data::Alias, which both Configloader and RenderView depends
 upon.
 
 Mostly I've tried builds of perl 5.10, but I also tried Strawberry 5.8.8,
 only to have Data::Alias demanding = 5.8.9

Looking at the CPAN testers results it -should- build under 5.10.0 - there
are a couple of PASS results for 1.07 there on

http://cpantesters.perl.org/show/Data-Alias.html

It's required by Data::Vistor as a dependency, but only for a specific
feature which I -don't- think we actually turn on. It'd suggest you try
forcing Data::Visitor, see if everything else installs ok, and if so
don't worry about it and we'll try and arrange a Data::Visitor release
that makes the dependency optional.

-- 
  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/


  1   2   3   4   >