Matt S Trout wrote:
PS - On a side note, is it possible to change which plugins are loaded depending on whether Catalyst is launched from myapp_server.pl or myapp_fastcgi.pl? This would be helpful...

in MyApp.pm

sub setup_plugins {
  my ($class, $plugins_arrayref) = @_;
  <do something based on $class->engine>
  $class->next::method($plugins_arrayref);
}

FYI, here is how I ended up writing this:

 sub setup_plugins {
   my ($c, $plugins_arrayref) = @_;

   if ($c->engine_class) {
     if ($c->engine_class eq 'Catalyst::Engine::CGI') {
       push @$plugins_arrayref, 'Static::Simple';
     } elsif ($c->engine_class eq 'Catalyst::Engine::FastCGI') {
       push @$plugins_arrayref, 'Compress::Deflate';
     }
   }

   $c->NEXT::setup_plugins($plugins_arrayref);

 }

I try not to muck around too much with this stuff unless I have to, so it took me a little while to figure exactly how to write this.

Thanks again Matt!

- Jim

_______________________________________________
List: [email protected]
Listinfo: http://lists.rawmode.org/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/[email protected]/
Dev site: http://dev.catalyst.perl.org/

Reply via email to