Re: [Catalyst] Mason + DBI + Catalyst?

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

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

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

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

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


Re: [Catalyst] Multiple instances of same app with 5.80 under mod_perl

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

I doubt it.

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

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

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

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


Re: [Catalyst] Lighttpd and mod_perlite

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

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

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

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

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


Re: [Catalyst] Best practice: How to build app parts reusable?

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

Just have your controller base class set:

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

in a begin or auto or whatever action.

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

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

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


Re: [Catalyst] Action attributes

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

A patch that let you do something like

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

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

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

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

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


[Catalyst] Re: Lighttpd and mod_perlite

2009-06-08 Thread Aristotle Pagaltzis
* Matt S Trout dbix-cl...@trout.me.uk [2009-06-08 21:00]:
 Shadowcat's clients tend to end up on $webserver + FastCGI
 or $proxy + Prefork depending on their requirements.

What sort of requirements does FastCGI cover better in your
experience?

Regards,
-- 
Aristotle Pagaltzis // http://plasmasturm.org/

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

2009-06-08 Thread Hans Dieter Pearcey
On Mon, Jun 08, 2009 at 11:09:24PM +0200, Aristotle Pagaltzis wrote:
 What sort of requirements does FastCGI cover better in your
 experience?

I don't know what Matt has in mind, but doing zero-downtime restarts with
FastCGI over a unix socket is pretty easy because of filesystem semantics.

hdp.

___
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] [Announce] App::ForExample: Helper to generate Catalyst configurations

2009-06-08 Thread Robert Krimen
Last Tuesday, during a SFPUG Catalyst talk, I announced App::ForExample

 http://search.cpan.org/perldoc?App::ForExample
 http://search.cpan.org/dist/App-ForExample

This is the tool I've written to help with the deployment stage of
publishing a Catalyst application. It will
generate configurations for Apache, lighttpd, nginx:

App::ForExample is a command-line tool for generating sample configurations.
It is not designed to do configuration
management, but rather as a guide to get you 80% of the way there

Besides the usual Apache, lighttpd, nginx, and FastCGI configurations,
App::ForExample can create a FastCGI start-stop script and a monit
configuration for monitoring those processes

Here is some typical usage:

   # To output a FastCGI (ExternalServer)/Apache configuration (with monit
stub and start-stop script), run:
   for-example catalyst/fastcgi apache2 standalone --package My::App
--hostname example.com --output my-app

   # The above command would have created the following:

   my-app.apache2  The Apache2 virtual host configuration (hosted at
(www.)example.com)
   my-app.start-stop   The start/stop script to launch the FastCGI
process
   my-app.monitA monit stub used for monitoring the FastCGI
process

   # This will generate a basic, stripped-down monit configuration (monitrc)
suitable for a non-root user:
   for-example monit --home $HOME/monit --output $HOME/monit/monitrc

   # A mod_perl configuration for Catalyst:
   for-example catalyst/mod_perl --package Project::Xyzzy --hostname
xyzzy.com --home Project-Xyzzy

A tutorial for Apache2 with FastCGI on Ubuntu:

http://search.cpan.org/perldoc?App::ForExample#Apache2_with_FastCGI_on_Ubuntu

You can install App::ForExample by using CPAN:

cpan -i App::ForExample

If that doesn't work properly, you can find help at:

http://sial.org/howto/perl/life-with-cpan/
http://sial.org/howto/perl/life-with-cpan/macosx/ # Help on Mac OS X
http://sial.org/howto/perl/life-with-cpan/non-root/ # Help with a
non-root account

The source repository is:

http://github.com/robertkrimen/App-ForExample/tree/master

Rob
___
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] App::ForExample: Helper to generate Catalyst configurations

2009-06-08 Thread Devin Austin
you++.

I was just thinking about something like this as a hmmm i don't feel like
thinking, i want catalyst to do that for me.

On Mon, Jun 8, 2009 at 3:29 PM, Robert Krimen robertkri...@gmail.comwrote:

 Last Tuesday, during a SFPUG Catalyst talk, I announced App::ForExample

  http://search.cpan.org/perldoc?App::ForExample
  http://search.cpan.org/dist/App-ForExample

 This is the tool I've written to help with the deployment stage of
 publishing a Catalyst application. It will
 generate configurations for Apache, lighttpd, nginx:

 App::ForExample is a command-line tool for generating sample
 configurations. It is not designed to do configuration
 management, but rather as a guide to get you 80% of the way there

 Besides the usual Apache, lighttpd, nginx, and FastCGI configurations,
 App::ForExample can create a FastCGI start-stop script and a monit
 configuration for monitoring those processes

 Here is some typical usage:

# To output a FastCGI (ExternalServer)/Apache configuration (with monit
 stub and start-stop script), run:
for-example catalyst/fastcgi apache2 standalone --package My::App
 --hostname example.com --output my-app

# The above command would have created the following:

my-app.apache2  The Apache2 virtual host configuration (hosted
 at (www.)example.com)
my-app.start-stop   The start/stop script to launch the FastCGI
 process
my-app.monitA monit stub used for monitoring the FastCGI
 process

# This will generate a basic, stripped-down monit configuration
 (monitrc) suitable for a non-root user:
for-example monit --home $HOME/monit --output $HOME/monit/monitrc

# A mod_perl configuration for Catalyst:
for-example catalyst/mod_perl --package Project::Xyzzy --hostname
 xyzzy.com --home Project-Xyzzy

 A tutorial for Apache2 with FastCGI on Ubuntu:


 http://search.cpan.org/perldoc?App::ForExample#Apache2_with_FastCGI_on_Ubuntu

 You can install App::ForExample by using CPAN:

 cpan -i App::ForExample

 If that doesn't work properly, you can find help at:

 http://sial.org/howto/perl/life-with-cpan/
 http://sial.org/howto/perl/life-with-cpan/macosx/ # Help on Mac OS
 X
 http://sial.org/howto/perl/life-with-cpan/non-root/ # Help with a
 non-root account

 The source repository is:

 http://github.com/robertkrimen/App-ForExample/tree/master

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




-- 
Devin Austin
http://www.codedright.net
http://www.dreamhost.com/r.cgi?326568/hosting.html - Host with DreamHost!
___
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/


Re: [Catalyst] Lighttpd and mod_perlite

2009-06-08 Thread Gordon Yeong
If you can, please suggest some links for reference.:) thanks

Regards,
Gordon Yeong



2009/6/1 Nigel Metheringham nigel.methering...@dev.intechnology.co.uk


 However, I, and many others, are using lighttpd with fastcgi with great
 success - there are a number of articles on this including a few advent
 calendar ones.

Nigel.
___
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] App::ForExample: Helper to generate Catalyst configurations

2009-06-08 Thread Chris
On Tue, Jun 9, 2009 at 7:29 AM, Robert Krimenrobertkri...@gmail.com wrote:
 Last Tuesday, during a SFPUG Catalyst talk, I announced App::ForExample


Excellent, Rob! Reduces the barriers to dipping a toe into the
Catalyst waters - well worth it.

- Chris

___
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.pl-generated installer installs MyApp/root in same dir as MyApp/lib/*?

2009-06-08 Thread Robert Buels
The Module::Install code generated by catalyst.pl puts MyApp/root into 
blib/lib/MyApp/root, right alongside all the things from MyApp/lib.  Is 
this actually the Right Thing to do?  Seems fishy to put the templates 
and images and such in the same place as the perl modules.


In the pod for File::ShareDir (which I perused after reading on dhoss's 
blog about where he's thinking of putting the helper templates), I read 
that static data for modules are supposed to go in the module's 'auto' 
directory.  Link: 
http://search.cpan.org/~adamk/File-ShareDir-1.00/lib/File/ShareDir.pm


So, if I understand rightly, shouldn't the MyApp/root be going into 
blib/auto/MyApp/root instead of blib/MyApp/root ?


Rob


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