1 package Catalyst::Engine::Loader;
3 use Catalyst::Exception;
4 use namespace::autoclean;
6 extends 'Plack::Loader';
9 my ($orig, $self) = (shift, shift);
10 my $engine = $self->$orig(@_);
11 if ($engine eq 'Standalone') {
12 if ( $ENV{MOD_PERL} ) {
13 my ( $software, $version ) =
14 $ENV{MOD_PERL} =~ /^(\S+)\/(\d+(?:[\.\_]\d+)+)/;
16 $version =~ s/(\.[^.]+)\./$1/g;
18 if ( $software eq 'mod_perl' ) {
19 if ( $version >= 1.99922 ) {
23 elsif ( $version >= 1.9901 ) {
24 Catalyst::Exception->throw( message => 'Plack does not have a mod_perl 1.99 handler' );
25 $engine = 'Apache2::MP19';
28 elsif ( $version >= 1.24 ) {
33 Catalyst::Exception->throw( message =>
34 qq/Unsupported mod_perl version: $ENV{MOD_PERL}/ );
43 __PACKAGE__->meta->make_immutable( inline_constructor => 0 );
51 Catalyst::Engine::Loader - The Catalyst Engine Loader
59 Wrapper on L<Plack::Loader> which resets the ::Engine if you are using some
64 Catalyst Contributors, see Catalyst.pm
68 This library is free software. You can redistribute it and/or modify it under
69 the same terms as Perl itself.