From: Andy Grundman Date: Fri, 16 Dec 2005 05:55:28 +0000 (+0000) Subject: Fixed engine detection to allow custom mod_perl engines X-Git-Tag: 5.7099_04~771 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=9b0a3e0fc295d2d2b0af184f4ed1d05db41fc2c4 Fixed engine detection to allow custom mod_perl engines --- diff --git a/Changes b/Changes index 5a631ad..7e5fde6 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,7 @@ This file documents the revision history for Perl extension Catalyst. 5.62 + - Fixed engine detection to allow custom mod_perl engines. - Static::Simple: Fixed bug in ignore_dirs under win32. - Display version numbers of loaded plugins. (Curtis Poe) - Added class and method for caught exception messages. diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 5f6d50b..7310d71 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -1559,7 +1559,7 @@ sub setup_engine { $engine = 'Catalyst::Engine::' . $ENV{ uc($class) . '_ENGINE' }; } - if ( !$engine && $ENV{MOD_PERL} ) { + if ( $ENV{MOD_PERL} ) { # create the apache method { @@ -1575,21 +1575,25 @@ sub setup_engine { if ( $software eq 'mod_perl' ) { - if ( $version >= 1.99922 ) { - $engine = 'Catalyst::Engine::Apache2::MP20'; - } - - elsif ( $version >= 1.9901 ) { - $engine = 'Catalyst::Engine::Apache2::MP19'; - } - - elsif ( $version >= 1.24 ) { - $engine = 'Catalyst::Engine::Apache::MP13'; - } + if ( !$engine ) { + + if ( $version >= 1.99922 ) { + $engine = 'Catalyst::Engine::Apache2::MP20'; + } + + elsif ( $version >= 1.9901 ) { + $engine = 'Catalyst::Engine::Apache2::MP19'; + } + + elsif ( $version >= 1.24 ) { + $engine = 'Catalyst::Engine::Apache::MP13'; + } + + else { + Catalyst::Exception->throw( message => + qq/Unsupported mod_perl version: $ENV{MOD_PERL}/ ); + } - else { - Catalyst::Exception->throw( message => - qq/Unsupported mod_perl version: $ENV{MOD_PERL}/ ); } # install the correct mod_perl handler