[Catalyst-commits] r13028 - in Catalyst-Runtime/5.80/branches/psgi/lib: . Catalyst

t0m at dev.catalyst.perl.org t0m at dev.catalyst.perl.org
Mon Mar 8 00:56:38 GMT 2010


Author: t0m
Date: 2010-03-08 00:56:38 +0000 (Mon, 08 Mar 2010)
New Revision: 13028

Modified:
   Catalyst-Runtime/5.80/branches/psgi/lib/Catalyst.pm
   Catalyst-Runtime/5.80/branches/psgi/lib/Catalyst/Engine.pm
   Catalyst-Runtime/5.80/branches/psgi/lib/Catalyst/ScriptRole.pm
Log:
Don't break the calling convention for the run method by making the server the last argument, ignore Engine::HTTP, prepend Catalyst::Engine if needed. This all makes TWMC somewhat less broken.

Modified: Catalyst-Runtime/5.80/branches/psgi/lib/Catalyst/Engine.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/psgi/lib/Catalyst/Engine.pm	2010-03-08 00:40:21 UTC (rev 13027)
+++ Catalyst-Runtime/5.80/branches/psgi/lib/Catalyst/Engine.pm	2010-03-08 00:56:38 UTC (rev 13028)
@@ -752,12 +752,14 @@
 =cut
 
 sub run {
-    my ($self, $app, $server, @args) = @_;
+    my ($self, $app, @args) = @_;
+    my $server = pop @args if blessed $args[-1];
     $server ||= Plack::Loader->auto(); # We're not being called from a script,
                                        # so auto detect what backend to run on.
                                        # This does *NOT* cover mod_perl.
     # FIXME - Do something sensible with the options we're passed
-    $server->run($self->build_psgi_app($app, @args));
+    my $psgi = $self->build_psgi_app($app, @args);
+    $server->run($psgi);
 }
 
 =head2 build_psgi_app ($app, @args)

Modified: Catalyst-Runtime/5.80/branches/psgi/lib/Catalyst/ScriptRole.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/psgi/lib/Catalyst/ScriptRole.pm	2010-03-08 00:40:21 UTC (rev 13027)
+++ Catalyst-Runtime/5.80/branches/psgi/lib/Catalyst/ScriptRole.pm	2010-03-08 00:56:38 UTC (rev 13028)
@@ -72,7 +72,7 @@
     else {
         $server = Plack::Loader->auto($self->_plack_loader_args);
     }
-    $app->run($server, $self->_application_args);
+    $app->run($self->_application_args, $server);
 }
 
 1;

Modified: Catalyst-Runtime/5.80/branches/psgi/lib/Catalyst.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/psgi/lib/Catalyst.pm	2010-03-08 00:40:21 UTC (rev 13027)
+++ Catalyst-Runtime/5.80/branches/psgi/lib/Catalyst.pm	2010-03-08 00:56:38 UTC (rev 13028)
@@ -2378,7 +2378,11 @@
     unless ($engine) {
         $engine = $class->engine_class;
     }
+    $engine = 'Catalyst::Engine::' . $engine
+        unless $engine =~ /^Catalyst::Engine/;
 
+    $engine = 'Catalyst::Engine' if $engine eq 'Catalyst::Engine::HTTP';
+
     Class::MOP::load_class($engine);
 
     # check for old engines that are no longer compatible




More information about the Catalyst-commits mailing list