X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FEngine.pm;h=e6c5d6256f21a81548b07958a952e3c3bb25c31d;hb=4b0f97fc6eb94b7d347403cecbf9a71ec5322e37;hp=67993f199e8988c9f2c308bbf336ed4bb88ecb22;hpb=9560b708797123875e4743b5dac70c69fbc4a3ef;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm index 67993f1..e6c5d62 100644 --- a/lib/Catalyst/Engine.pm +++ b/lib/Catalyst/Engine.pm @@ -752,11 +752,14 @@ run method on the server passed in.. =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 mod_perl or whatever + # 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)