X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FEngine.pm;h=0152ebf61f65ee16ab47a4873fb66d4531ba5bc9;hb=29bb04adc1fd0050a029b50aec57264aad24c1d5;hp=ee4477a8243fd09dc904777e39b3a06700e32823;hpb=d5c1270360c155009fa138b6f0630044304f3c86;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm index ee4477a..0152ebf 100644 --- a/lib/Catalyst/Engine.pm +++ b/lib/Catalyst/Engine.pm @@ -744,18 +744,29 @@ header. The amount of input data that has already been read. -=head2 $self->run($c) +=head2 $self->run($app, $server) -Start the engine. Implemented by the various engine classes. +Start the engine. Builds a PSGI application and calls the +run method on the server passed in.. =cut sub run { my ($self, $app, $server, @args) = @_; + $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)); } +=head2 build_psgi_app ($app, @args) + +Builds and returns a PSGI application closure, wrapping it in the reverse proxy +middleware if the using_frontend_proxy config setting is set. + +=cut + sub build_psgi_app { my ($self, $app, @args) = @_;