Subject: | Engine::FastCGI does not provide environment |
The Engine::FastCGI appears to only partially implement the environment
as provided by FCGI. Specifically it seems as if the environment is
recieved correctly by the module, but is never actually placed into the
Catalyst object for later access. Thereby making the enviornment
completely unaccessible by the application.
In Engine::Catalyst::FastCGI I have written the prepare_request
subroutine where I believe this should have occured. I have overriden
the ENV global variable as that is what FCGI does with our scripts. It
would probably be better to actually stuff the environment into the
catalyst object where appropriate.
The attached patch file simply updates the environment.
Subject: | fastcgi-env.patch |
--- Catalyst/Engine/FastCGI.pm 2009-01-19 15:35:10.000000000 -0500
+++ Catalyst/Engine/FastCGI-env.pm 2009-03-20 12:06:14.000000000 -0400
@@ -239,6 +239,21 @@
}
}
+=head2 $self->prepare_request( )
+
+Overrides our inherited prepare_request method from L<Catalyst::Engine> to
+install the C<%ENV> as passed by L<FCGI>.
+
+=cut
+
+sub prepare_request {
+ my ($e, $c, @arguments) = @_;
+ my %arguments = @arguments;
+ %ENV = %{ $arguments{env} } if exists $arguments{env};
+ return;
+}
+
+
1;
__END__