this doesnt need to be a compile time requirement
[catagits/Catalyst-Runtime.git] / lib / Catalyst.pm
index 1b3dfaf..c0683b8 100644 (file)
@@ -2594,12 +2594,13 @@ sub setup_engine {
     }
 
     if ($ENV{MOD_PERL}) {
+        require 'Catalyst/Engine/Loader.pm';
+        my $apache = Catalyst::Engine::Loader->auto;
         # FIXME - Immutable
         $class->meta->add_method(handler => sub {
             my $r = shift;
             my $app = $class->psgi_app;
-            use Plack::Handler::Apache2;
-            Plack::Handler::Apache2->call_app($r, $app);
+            $apache->call_app($r, $app);
         });
     }