# Remember to update this in Catalyst::Runtime as well!
-our $VERSION = '5.90030';
+our $VERSION = '5.90042';
sub import {
my ( $class, @arguments ) = @_;
$c->log_response;
if ($c->use_stats) {
- my $elapsed = sprintf '%f', $c->stats->elapsed;
+ my $elapsed = $c->stats->elapsed;
my $av = $elapsed == 0 ? '??' : sprintf '%.3f', 1 / $elapsed;
$c->log->info(
"Request took ${elapsed}s ($av/s)\n" . $c->stats->report . "\n" );
return;
}
+## This exists just to supply a prebuild psgi app for mod_perl and for the
+## build in server support (back compat support for pre psgi port behavior).
+## This is so that we don't build a new psgi app for each request when using
+## the mod_perl handler or the built in servers (http and fcgi, etc).
+
sub _finalized_psgi_app {
my ($app) = @_;
return $app->_psgi_app;
}
+## Look for a psgi file like 'myapp_web.psgi' (if the app is MyApp::Web) in the
+## home directory and load that and return it (just assume it is doing the
+## right thing :) ). If that does not exist, call $app->psgi_app, wrap that
+## in default_middleware and return it ( this is for backward compatibility
+## with pre psgi port behavior ).
+
sub _setup_psgi_app {
my ($app) = @_;
() }
: $_
} @$plugins ];
- unshift @$plugins, $class->_default_plugins;
+ push @$plugins, $class->_default_plugins;
$plugins = Data::OptList::mkopt($plugins || []);
my @plugins = map {
}
}
+sub setup_middleware { }
+
+our @registered_middlewares = ();
+
+## A normalized read only list of PSGI Middleware
+sub registered_middlewares { @registered_middlewares }
+
+## Normalize incoming middleware and hold it
+sub register_middleware {
+ my($self, $mw, @args) = @_;
+
+ if (ref $mw ne 'CODE') {
+ my $mw_class = Plack::Util::load_class($mw, 'Plack::Middleware');
+ $mw = sub { $mw_class->wrap($_[0], @args) };
+ }
+
+ push @registered_middlewares, $mw;
+}
+
+sub apply_registered_middleware { }
+
=head2 $c->stack
Returns an arrayref of the internal execution stack (actions that are