Re: [Catalyst] Bareword "catalyst" not allowed while "strict subs" in use at Makefile.PL line 90.
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] Returning error codes to the user.
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] RunAfterRequest/delayed Catalyst view
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] Oddness with Catalyst::Plugin::Session::Store::DBIC
On Thu, Apr 29, 2010 at 10:04:38PM +0700, Ben van Staveren wrote: > Hi Tom, > >>*Cough* remind me not to answer emails late at night :D > >> > >>Okay I've got the following: > >> > >>Catalyst 5.80022 > >>Static::Simple 0.29 > >>Session 0.27 > >>Session::Store::DBIC 0.11 > > > >Thanks. I'll try to look into this at the NPW hackathon this weekend. > > > Awesome. I'm trying to find a little spare time at $job to take a look > at it as well but I'm pretty new to Catalyst guts (and Moose), so not > really making much progress on fixing the problem. Learning a lot though > so it's all good :D I'm wondering what's creating the session in that action at all. A static file serve shouldn't have to bother doing it. Were I you I'd add some Carp::cluck calls or something in $c->session and friends (you're allowed to crack open your own copy of the Session.pm file - just copy it into lib/Catalyst/Plugin in your checkout first :) Doing that should show you where they're called from, which should tell us what inside the session code is getting hit during a static request and why that's happening. My first guess would be "the code to auto-extend session expiry is being triggered". But I've not dug into the code properly to see if that's it yet. -- 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] Oddness with Catalyst::Plugin::Session::Store::DBIC
On Thu, Apr 29, 2010 at 08:10:29AM +0800, Moritz Onken wrote: > Still the same behaviour. See my reply downthread for how I'd recommend trying to diagnose this. -- 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] Oddness with Catalyst::Plugin::Session::Store::DBIC
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] Dist::Zilla + Catalyst?
(dropping cc to rjbs because really, wtf) On Wed, Apr 28, 2010 at 04:03:30PM +, Ævar Arnfjörð Bjarmason wrote: > It's (at least for me) mainly about removing the duplicate work that > goes into release. The *only* thing that I do when releasing now, aside > from editing the code, is manually updating the Changes file, and I > usually do that as I go. Then it's just `dzil release`. > > Before that I had to maintain a MANIFEST, dependencies in Makefile.PL, > $VERSION in all my files, `git tag $VERSION` && `git push` after > release. > > In addition I had boilerplate like README and LICENSE that either had > to be generated from something else in the distro, or copy/pasted into > every repository. > > I'm willing to bet that you have to fiddle around more than I at > release time :) Quite possibly. I generally edit Changes, make manifest, check it looks right, edit $VERSION, run Makefile.PL, make disttest, check that, make dist, scp it somewhere for other people to check it, make upload. I'm giving serious consideration to using 'dzil release' for that purpose instead, since I rather like that part. I just have no interest in switching away from Makefile.PL and Module::Install for most of that work. > catalyst.pl's behavior (and not being able to change it) is the aspect > of Catalyst that irks me the most. > > When I create a project the first thing I have to do is clean the > boilerplate the install script added. When I create models / views / > controllers with it, I usually have to at least go edit the POD > afterwards to make it sane. > > It would be nice if someone made it pluggable so that you could easily > set your preferred build system / starting template in a global config > somewhere, along with an easy way to use other people's configs or > upload your own from the CPAN. export CATALYST_DEVEL_SHAREDIR=/path/to/my/templates appears to be the operative way to select a different set of templates. Though honestly, the generation stuff is there to get newbie users started. I think I used it for about the first 6 months and then switched to starting applications with 'mkdir' and components with 'vi lib/...'. -- 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?
On Wed, Apr 28, 2010 at 03:20:05PM +, Ævar Arnfjörð Bjarmason wrote: > On Wed, Apr 28, 2010 at 14:30, Matt S Trout wrote: > > 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. > > Thats more a tenet of how Ricardo Signes (the dzil author) likes to > work than a core assumption of Dist::Zilla. Fair point; though if you don't use it that way I'm not really convinced it does anything that Module::Install/etc. doesn't already do just fine. > There's no reason why Catalyst distros cant work with dzil.ini that I > can see. Are there hooks available for catalyst.pl so that it can > generate Dist::Zilla based distros instead of using Module::Install? The whole thing's generated from templates so far as I'm aware - don't see why you couldn't (or if it isn't already exposed why it wouldn't given a trivial patch). But rather the point of catalyst.pl is that it's "one sane way" to do things. I stick to the standard layout for most things in apps I work on not because it's necessarily my favourite, but because it's a common standard that anybody working on Catalyst apps is going to be familiar with. As Stevan says: There's More Than One Way To Do It - But Sometimes Consistency Can Be A Good Thing Too ... -- 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
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] Pre-Moose version of Catalyst and all plugins?
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] unsubsricbe
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] Alternatives to Catalyst ?
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] Dist::Zilla + Catalyst?
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 > > 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/
[Catalyst] And lo, doth the spice flow once more
The mailman queue runner apparently decided to implode over the bank holiday weekend. I've delivered a short sharp blow to the rump with the flat of a chainsaw and it appears to be going again. Apologies for the mail delivery delays. -- 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
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] Best practice: How to build app parts reusable?
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] Lighttpd and mod_perlite
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.uk http://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
On Fri, May 29, 2009 at 11:49:45AM -0500, Stephen Clouse wrote: > On Thu, May 28, 2009 at 5:48 PM, Stephen Clouse > wrote: > > > 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] Mason + DBI + Catalyst?
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.uk http://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?
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] Mason + DBI + Catalyst?
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] Catalyst IPv6 support?
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] Caught exception in engine "Can't call method "header" on an undefined value
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] Doc patch for ConfigLoader.
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] Handling of "keywords" for controller methods
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] Problem with objects
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.uk http://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.
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] Catalyst dynamic SQL model and custom tables
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] My experience porting to CataMoose
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(). > > > > > > > > > > > > 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: > > > > > > > > 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] More natural access to model?
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] More natural access to model?
On Tue, May 12, 2009 at 11:45:01AM +0200, Paweł Tęcza wrote: > Dear Catalyst users, > > It's my first post here, so I would like to say "Hello" to all of us! :) > > I'm writing my first Catalyst application for student registration and I > have the following tables for details about studies at our university: > > CREATE TABLE studies ( > id integer NOT NULL, > unit_id integer, > status integer, > limit_soft integer, > limit_hard integer > ); > > 'id' column is a database study identifier. It's also primary key for > that table. 'unit_id' is an unit identifier of study, 'status' column > says whether registration is open/suspended/closed, 'limit_soft' and > 'limit_hard' are for student number limits. > > CREATE TABLE study_data ( > study_id integer NOT NULL, > lang lang NOT NULL, > name text NOT NULL, > value text > ); > > 'study_id' column is database study identifier (please look at > studies.id column), 'lang' column points language for (name, value) > pair, for example 'pl', 'en', etc. 'name' column is for name of data, > for example 'name', 'description', 'program', 'email', etc. > ('study_id', 'lang', 'name') is a primary key for that table. Finally > 'value' column is for data content. > > I think it's very simple structure and fully understandable for you, > so it doesn't need more comments. Of course, I can also define > table 'study_data' with many columns, for example 'name', 'description', > 'program', 'email', etc. but I think that its simpler structure is > better idea here, because it's more flexible. I can add new type of > data, without changing table definition. 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 ... -- 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?
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/
[Catalyst] Who wants to be rid of the "Unknown Error" w/attributes bug on 5.10?
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] Handling of "keywords" for controller methods
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.uk http://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
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.uk http://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
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 } 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 { }; $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] Howto Catalyst::Plugin::Captcha ?
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] Slow fastcgi: A debugging aid
On Tue, May 05, 2009 at 01:06:52PM +0930, Jon Schutz wrote: > On Mon, 2009-05-04 at 19:56 -0500, Peter Karman wrote: > > > Catalyst::Plugin::AutoRestart > > > > Would I be correct in my reading of the code, that since the exit() > happens in handle_request, the request that triggers the restart does > not get served? No. The first thing this code does is call next::method to do the full normal handle_request processing. I worked with John and John on this plugin; it's rock solid and Shadowcat have used it for almost every client since. -- 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.uk http://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
On Sat, May 02, 2009 at 06:17:19PM +0300, Octavian Râşniţă wrote: > From: "Ash Berlin" > >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
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] Using test database with TWAM?
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] Is there a good solution of file cache? which plugin is recommended?
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?
On Thu, Apr 30, 2009 at 11:42:39AM -0400, Jesse Sheidlower wrote: > > I assume this is more of a general Perl testing question than > a Catalyst question, but > > I finally sat down to write real tests for one of my apps, > with the hopes that I'll do this regularly for everything. I > was using the Tutorial chapter on testing, and the docs for > Test::WWW::Mechanize::Catalyst, for ideas. > > I quickly hit a wall because I couldn't figure out how to run > this with a test database. Since I need to test modification > and deletion stuff, but have real data, I can't just run this > against my actual app. So I figured I would dump the sql from > my production app and have my test program load this into a > database called "test-db" or whatever, having the same format > and schema as the real db, and then just drop the test db at > the end of the test. You want DBIx::Class::Fixtures for the dump/load crap, and DBIC's ->deploy method for the "dump/create the tables" stuff. Hop onto the dbix-class list if you get stuck with that part. > Unfortunately I don't know how to do this from a test script, > and I don't know how to tell TWAM to run a particular app but > with a different DBIC schema (in this case, the identical one > but with a different name, pointing to the test db) Then you want to read the ConfigLoader docs and search for LOCAL_SUFFIX for how to define a testing config. -- 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
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] script/myapp_server -r Can't exec "/usr/bin/perl" every 3 or 4 restarts
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] Which model is better, DBI or DBIC::Schema?
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 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
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 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
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 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] Migrating mod_perl app to Catalyst
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 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
On Mon, Apr 27, 2009 at 12:45:29PM +0100, Mike Glen wrote: > Matt S Trout wrote: > >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? > > > > > I have played around with this for a while and have made some progress. > What seems to be happening is that with every restart @INC is increasing > in size. > New directory paths are being added > These are being created by appending the following to each existing path > /i386-linux-thread-multi > /5.8.5 > /5.8.4 > /5.8.3 > /5.8.2 > /5.8.1 > /5.8.0 > > Each of these new paths are unique so no obvious way I can see to filter > them out > And finding out why @INC is being added to in this way is beyond the > scope of my current knowledge. Let me guess. Red Hat? They do "clever" things like that. 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? -- 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 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?
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 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] unexpected behavior of $c->request->secure and $c->request->base
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 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?
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] how to reuse Catalyst Schema for non-web purposes?
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] script/myapp_server -r Can't exec "/usr/bin/perl" every 3 or 4 restarts
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] Couldn't instantiate component "AddressBook::Model::AddressDB"
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] how to reuse Catalyst Schema for non-web purposes?
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] Perplexed Catalyst newbie
On Mon, Apr 20, 2009 at 09:49:51AM -0700, Sean McAfee wrote: > On Mon, Apr 20, 2009 at 6:29 AM, Matt S Trout wrote: > > > On Sun, Apr 19, 2009 at 09:51:42PM -0700, Sean McAfee wrote: > > > [% FOR a IN as; FOR b IN a.bs; b.cs; ""; END; END %] > > > > b.cs here is equivalent to: > > > > my $val = [ $b->cs ]; > > > > not > > > > my $val = $b->cs; > > > > Where does that happen? I'm pretty intimately familiar with the Template > Toolkit, having written the Python port, so I know that all method calls in > a template occur in scalar context, and so "b.cs" in a template should > indeed translate to "my $val = $b->cs;" on the Perl side. No, all method calls occur in *list* context. This has been true for as long as I've been using TT. It was the reason the _rs methods were introduced to DBIC. You're welcome to write your own code that tests wantarray to verify this - and unless you do so, I'm not going to believe you that your copy does the opposite of what everybody else's has for the past several years :P > So after some finagling, my template now reads: > > [% FOR a IN as; FOR b IN a.bs_rs; !b.cs_rs.defined; ""; END; END %] a.bs_rs returns a RESULTSET. FOR b IN a.bs_rs.all will work. You wanted to be able to do .next so I gave you a resultset. That's not an array. -- 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] deployment with 3-tiered server setup: How to handle config?
On Tue, Apr 21, 2009 at 09:33:04AM +0100, Ben Vinnerd wrote: > I have a file /etc/httpd/host.conf, which contains the line: > PerlSetEnv CATALYST_CONFIG_LOCAL_SUFFIX live/dev/whatever That should really be MYAPP_CONFIG_LOCAL_SUFFIX unless you really intended to affect all Catalyst application. But yes, this is the correct approach - see Catalyst::Plugin::ConfigLoader docs for more information. -- 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)
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)
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] C::Engine::HTTP taking very long
On Tue, Apr 21, 2009 at 10:10:54AM +0200, Ian Wells wrote: > 2009/4/20 Matt S Trout : > > 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] Local action in controller not mapping to template (retry): Solved
On Tue, Apr 21, 2009 at 08:48:46AM +0100, Daniel Hulme wrote: > On Mon, Apr 20, 2009 at 08:20:42AM -0700, Anne Brown wrote: > > As you suggested, I checked the vhosts file and sure enough, the problem was > > with the RewriteRule. I changed this: > > RewriteRule ^([A-Za-z0-9-]+)?$ index.pl/$1 > > to this: > > RewriteRule ^([A-Za-z0-9-/]+)?$ index.pl/$1 > > and problem solved. > > Problem solved, that is, until you try to access an URL with a _ in it, > or with %-encoded characters, or a ~, all of which are common. I'm not > sure what you're trying to exclude from that RewriteRule, but .* seems > like the obvious regex to use. Does somebody want to figure out a good standard one for this and stick it in the deployment section of cookbook and/or 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] C::Engine::HTTP taking very long
On Mon, Apr 20, 2009 at 01:26:57PM +0200, Ian Wells wrote: > 2009/4/20 Andrew Rodland : > > 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] [PATCH] Catalyst::DispatchType::Chained (5.7101, 5.80001)
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] Perplexed Catalyst newbie
On Sun, Apr 19, 2009 at 09:51:42PM -0700, Sean McAfee wrote: > [% FOR a IN as; FOR b IN a.bs; b.cs; ""; 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] Perplexed Catalyst newbie
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] Local action in controller not mapping to template (retry)
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] What's the best way to exclude static requests from needing user to log in?
On Sun, Apr 19, 2009 at 05:53:42PM +0400, Nickolay Platonov wrote: > and I'm using this to implicitly specify which actions in controllers > require authorization: > > #== > #Controller > > sub update :Local :ActionClass('+Travel::Action::AuthorizationRequired') { > my ( $self, $c ) = @_; > > my $token = $c->req->params->{'token'}; > .. > } > > #== > #AuthorizationRequired Action > > sub execute { > my $self = shift; > my ( $controller, $c ) = @_; > > if ( !$c->user_exists() ) { > > $c->stash->{template} = "auth_required.tt2"; > > $c->detach('View::TT'); > } > > $self->NEXT::execute( @_ ); > }; That's a lot of complexity compared to: sub update :Local :AuthorizationRequired { ... } sub auto :Private { # in Root.pm (or use a root chain part to do the same) my ($self, $c) = @_; if ($c->action->attributes->{AuthorizationRequired} && $c->user_exists) { $c->forward('auth_required'); return 0; } } sub auth_required :Private { my ($self, $c) = @_; $c->stash(template => 'auth_required.tt2'); } -- 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?
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/
Re: [Catalyst] upon successful login, how do i get redirect users back to the page they wanted to access previously?
On Sun, Apr 19, 2009 at 07:06:14AM +0900, J. Shirley wrote: > On Sat, Apr 18, 2009 at 10:19 PM, 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/
[Catalyst] Google Summer of Code: mentors, projects
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
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] Water the grass roots, please
On Wed, Nov 12, 2008 at 10:55:41PM +0100, Zbigniew Lukasiak wrote: > On Wed, Nov 12, 2008 at 9:41 PM, Matt S Trout <[EMAIL PROTECTED]> wrote: > > 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/ > > OK - I voted for it. But doesn't it make us seem a bit desperate? I > mean this direct invocation to mailing list subscribers not the > article. There are reddit trolls who downvote anything with perl involved unless it's a "perl5 is dying" article. This is just my way of evening the odds a bit. -- 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
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] Catalyst, MVCs and other MVCs
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] recommendation
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] Re: recommendation
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] [META] Advent calendar
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] [META] Advent calendar
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] noob question about session timeouts
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] noob question about session timeouts
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: Off Topic: Re: [Catalyst] [Announce] MojoMojo 0.999021 has been released to CPAN
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/
Re: [Catalyst] Catalyst::Plugin::XMLRPC/Catalyst::Component::ACCEPT_CONTEXT issue.
On Sat, Nov 01, 2008 at 04:14:02PM -0400, kevin montuori wrote: > > hi all -- i have a trivial catalyst (version 5.7015) application using > the XMLRPC plugin (version 1.0) with two controllers You wanted Catalyst::Plugin::Server::XMLRPC which obsoletes the old XMLRPC plugin. -- 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?
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 > 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: [Catalyst] ANNOUNCE: SimpleDB - Auth configuration made easy
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] test server running off of ipv6?
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] Feature Request: Parameter Junctions
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] Making proxy requests cooperate with uri_for
On Mon, Oct 20, 2008 at 12:23:38PM -0700, Ashley wrote: > This might be a simple question but I've never had to do it before, > Googling for it is difficult, and none of the main docs seems to have > the info. > > I want to run myapp_server.pl script as a proxy as if it were from a > dir. > > This is easily accomplished with > > ProxyPass /from_dir http://localhost:8080/ > ProxyPassReverse /from_dir http://localhost:8080/ > > The problem then is $c->uri_for("/") returns http://localhost/ when > http://localhost/from_dir is what is really needed. Dave Rolsky (autarch) had a proxystuff branch that handled this at one point, but I'm unsure what happened to 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/
[Catalyst] Water the grass roots, please
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
On Mon, Oct 27, 2008 at 02:24:14PM +0100, Zbigniew Lukasiak wrote: > Another question - have you thought about using > http://search.cpan.org/~groditi/DBIx-Class-EncodedColumn-0.2/lib/DBIx/Class/EncodedColumn.pm > (or the older DigestColumn) to simplify the interface? You can pass 'self_check' as password_type already. Requiring the user to set something else up on the model class to be able to use this rather fails at the "simple" part. -- 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
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/
Re: [Catalyst] Success stories please
On Sun, Oct 05, 2008 at 03:08:22PM -0600, Devin Austin wrote: > http://yourspace.codedright.net On the blog dammit! Or add it to catalystsites.org or something ... -- 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
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] mix authentication stores
On Wed, Oct 01, 2008 at 04:58:51PM +0200, Jose Luis Martinez wrote: > Tomas Doran escribió: > > >Unfortunately, there is no such thing as an LDAP credential module on > >CPAN at the moment. > > > > Catalyst::Authentication::Credential::Authen::Simple should do the > trick. > http://search.cpan.org/~jlmartin/Catalyst-Authentication-Credential-Authen-Simple-0.02/lib/Catalyst/Authentication/Credential/Authen/Simple.pm > > becasue Authen::Simple does support LDAP. Fucking awesome. This needs to be more widely publicised, do you think you could do doc patches fr C::P::Authentication and a wiki write up? :) -- 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
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] Catalyst, DBIx::Class and Moose training in the UK
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] mix authentication stores
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] mix authentication stores
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/
[Catalyst] Catalyst, DBIx::Class and Moose training in the UK
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/