[Catalyst] Re: A different approach to static content

Christopher H. Laco claco at chrislaco.com
Tue Aug 16 22:36:39 CEST 2005


Probably a moot point anyhow.
It looks like setup does the engine setup before the actions setup.
Maybe in a sick world this might work in the MyApp package:

setup {
	local $ENV{CATALYST_ENGINE} = 'CustomStatic';
	goto &Catalyst::Setup::setup;

	## __PACKAGE__ or Catalyst::Setup?
	???->engine->generate_handlers;
};


This does bring up another point. Were engines ever meant to be created 
by the consumers of Catalyst? If so, I would think that the assumption 
that all engines must start with Catalyst::Engine is a bad thing.

For that matter, shouldn't this:

>     if ( $engine ) {
>         $engine = 'Catalyst::Engine::' . $engine;
>     }
> 
>     if ( $ENV{CATALYST_ENGINE} ) {
>         $engine = 'Catalyst::Engine::' . $ENV{CATALYST_ENGINE};
>     }
> 
>     if ( $ENV{ uc($class) . '_ENGINE' } ) {
>         $engine = 'Catalyst::Engine::' . $ENV{ uc($class) . '_ENGINE' };
>     }
> 
>     if ( ! $engine && $ENV{MOD_PERL} ) {


Really be:

     if ( $engine ) {
         $engine = 'Catalyst::Engine::' . $engine;
     }

     if ( ! $engine && $ENV{CATALYST_ENGINE} ) {
         $engine = 'Catalyst::Engine::' . $ENV{CATALYST_ENGINE};
     }

     if ( ! $engine && $ENV{ uc($class) . '_ENGINE' } ) {
         $engine = 'Catalyst::Engine::' . $ENV{ uc($class) . '_ENGINE' };
     }

     if ( ! $engine && $ENV{MOD_PERL} ) {

Otherwise, whatever engine I set via setup_engine(@_) get's trashed by 
and ENV that may be setup.

-=Chris

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3178 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.rawmode.org/pipermail/catalyst/attachments/20050816/10e176fe/smime.bin


More information about the Catalyst mailing list