required => 1,
);
+has requested_engine => (
+ is => 'ro',
+ isa => 'Str',
+ predicate => 'has_requested_engine',
+);
+
+sub needs_psgi_engine_compat_hack {
+ my ($self) = @_;
+ return $self->has_requested_engine
+ && $self->requested_engine eq 'PSGI';
+}
+
has catalyst_engine_class => (
isa => 'Str',
is => 'rw',
sub _guess_catalyst_engine_class {
my $self = shift;
- my $old_engine = Catalyst::Utils::env_value($self->application_name, 'ENGINE');
+ my $old_engine = $self->has_requested_engine
+ ? $self->requested_engine
+ : Catalyst::Utils::env_value($self->application_name, 'ENGINE');
if (!defined $old_engine) {
return 'Catalyst::Engine';
}
- elsif ($old_engine =~ /^(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 =~ /^(CGI|FCGI|HTTP|Apache.*)$/) {
+ elsif ($old_engine =~ /^(PSGI|CGI|FastCGI|HTTP|Apache.*)$/) {
# Trust autodetect
}
elsif ($old_engine eq "HTTP::Prefork") { # Too bad if you're customising, we don't handle options
This library is free software. You can redistribute it and/or modify it under
the same terms as Perl itself.
+=begin Pod::Coverage
+
+needs_psgi_engine_compat_hack
+
+=end Pod::Coverage
+
=cut