=head2 setup_middleware (?@middleware)
-Read configuration information stored in configuration key 'psgi_middleware'
-and invoke L</register_middleware> for each middleware prototype found. See
-under L</CONFIGURATION> information regarding L</psgi_middleware> and how to
-use it to enable L<Plack::Middleware>
+Read configuration information stored in configuration key C<psgi_middleware> or
+from passed @args.
+
+See under L</CONFIGURATION> information regarding C<psgi_middleware> and how
+to use it to enable L<Plack::Middleware>
This method is automatically called during 'setup' of your application, so
you really don't need to invoke it.
$namespace->new(@init_args) :
die "Can't load class $namespace";
} else { ## the string is a partial namespace
- if(Class::Load::try_load_class("Plack::Middleware::$namespace")) { ## Act like Plack::Builder
- return "Plack::Middleware::$namespace"->new(@init_args);
- } elsif(Class::Load::try_load_class("$class::$namespace")) { ## Load Middleware from Project namespace
- return "$class::$namespace"->new(@init_args);
+ if(Class::Load::try_load_class("$class::$namespace")) { ## Load Middleware from Project namespace
+ return "$class::$namespace"->new(@init_args);
+ } elsif(Class::Load::try_load_class("Plack::Middleware::$namespace")) { ## Act like Plack::Builder
+ return "Plack::Middleware::$namespace"->new(@init_args);
}
}