Merge branch 'psgi' into origin/psgi
John Napiorkowski [Sat, 7 May 2011 01:48:18 +0000 (21:48 -0400)]
TODO
lib/Catalyst.pm
lib/Catalyst/EngineLoader.pm
lib/Catalyst/ScriptRunner.pm
lib/Catalyst/Upgrading.pod

diff --git a/TODO b/TODO
index e866d70..3e499fe 100644 (file)
--- a/TODO
+++ b/TODO
@@ -31,13 +31,14 @@ http://github.com/willert/catalyst-plugin-log4perl-simple/tree
 ###  Blockers
 
   * Test all the options work on all of the scripts
-  * Fix nginx / lighttpd middlewares so that they are generic, or can somehow 
+  * Fix nginx middlewares so that they are generic, or can somehow
     be used by people with their own .psgi files
   * Fix a sane / nicer way to do custom engines.
 
 ###  Nice to have
 
-  * <@rafl> i've been thinking of maybe providing MyApp->apply_default_middlewares($psgi_app)
+  * <@rafl> i've been thinking of maybe providing
+    MyApp->apply_default_middlewares($psgi_app)
   * Capture arguments that the plack engine component was run with somewhere,
     to more easily support custom args from scripts (e.g. Gitalist's 
     --git_dir)
index 596422c..03ce6ab 100644 (file)
@@ -2685,14 +2685,12 @@ documentation on how to upgrade from Catalyst::Engine::PSGI.
 EOW
     }
 
-    return $app->_wrapped_legacy_psgi_app($app->psgi_app);
+    return $app->apply_default_middlewares($app->psgi_app);
 }
 
-# Note - this is for back compatibility. Catalyst should not know or care about
-#        how it's deployed. The recommended way of configuring this is now to
-#        use the ReverseProxy middleware yourself if you want it in a .psgi
-#        file.
-sub _wrapped_legacy_psgi_app {
+# FIXME - document me
+
+sub apply_default_middlewares {
     my ($app, $psgi_app) = @_;
 
     $psgi_app = Plack::Middleware::Conditional->wrap(
index 22b6ff0..f2b999a 100644 (file)
@@ -82,9 +82,12 @@ around guess => sub {
     my $old_engine = Catalyst::Utils::env_value($self->application_name, 'ENGINE');
     if (!defined $old_engine) { # Not overridden
     }
-    elsif ($old_engine =~ /^(PSGI|CGI|HTTP|Apache.*)$/) {
+    elsif ($old_engine =~ /^(PSGI|CGI|Apache.*)$/) {
         # Trust autodetect
     }
+    elsif ($old_engine eq 'HTTP') {
+        $engine = 'Standalone';
+    }
     elsif ($old_engine eq 'FastCGI') {
         $engine = 'FCGI';
     }
index 247ce30..06b36b5 100644 (file)
@@ -6,7 +6,7 @@ use File::Spec;
 use namespace::autoclean;
 
 sub run {
-    my ($self, $class, $scriptclass) = @_;
+    my ($self, $class, $scriptclass, %args) = @_;
     my $classtoload = "${class}::Script::$scriptclass";
 
     lib->import(File::Spec->catdir($FindBin::Bin, '..', 'lib'));
@@ -17,7 +17,7 @@ sub run {
         $classtoload = "Catalyst::Script::$scriptclass";
         Class::MOP::load_class($classtoload);
     }
-    $classtoload->new_with_options( application_name => $class )->run;
+    $classtoload->new_with_options( application_name => $class, %args )->run;
 }
 
 __PACKAGE__->meta->make_immutable;
index 56a5258..fee1edd 100644 (file)
@@ -175,6 +175,17 @@ XXX Should this be here or elsewhere?
 
 =head2 Running with plackup?
 
+=head2 Tests in 5.89
+
+Tests should generally work the same in Catalyst 5.89, however there are some differences.
+
+Previously, if using L<Catalyst::Test> and doing local requests (against a local server),
+if the application threw an exception then this exception propagated into the test.
+
+This behaviour has been removed, and now a 500 response will be returned to the test.
+This change unifies behaviour, to make local test requests behave similarly to remote 
+requests.
+
 =head1 Upgrading to Catalyst 5.80
 
 Most applications and plugins should run unaltered on Catalyst 5.80.