if (!defined $old_engine) {
return 'Catalyst::Engine';
}
- elsif ($old_engine =~ /^(PSGI|CGI|FCGI|HTTP|Apache.*)$/) {
+ elsif ($old_engine =~ /^(PSGI|CGI|FastCGI|HTTP|Apache.*)$/) {
return 'Catalyst::Engine';
}
else {
my $old_engine = Catalyst::Utils::env_value($self->application_name, 'ENGINE');
if (!defined $old_engine) { # Not overridden
}
- elsif ($old_engine =~ /^(PSGI|CGI|FCGI|HTTP|Apache.*)$/) {
+ elsif ($old_engine =~ /^(PSGI|CGI|FastCGI|HTTP|Apache.*)$/) {
+>>>>>>> Fix bug stopping fastcgi script working
# Trust autodetect
}
elsif ($old_engine eq "HTTP::Prefork") { # Too bad if you're customising, we don't handle options
--- /dev/null
+use strict;
+use warnings;
+use Test::More;
+use Catalyst::EngineLoader;
+
+my $cases = {
+ FastCGI => {
+ expected_catalyst_engine_class => 'Catalyst::Engine',
+ ENV => { CATALYST_ENGINE => 'FastCGI' },
+ },
+ CGI => {
+ expected_catalyst_engine_class => 'Catalyst::Engine',
+ ENV => { CATALYST_ENGINE => 'CGI' },
+ },
+ Apache1 => {
+ expected_catalyst_engine_class => 'Catalyst::Engine',
+ ENV => { CATALYST_ENGINE => 'Apache1' },
+ },
+};
+
+foreach my $name (keys %$cases) {
+ local %ENV = %{ $cases->{$name}->{ENV} };
+ my $loader = Catalyst::EngineLoader->new(application_name => "TestApp");
+ if (my $expected = $cases->{$name}->{expected_catalyst_engine_class}) {
+ is $loader->catalyst_engine_class, $expected, $name . " catalyst_engine_class";
+ }
+}
+
+done_testing;