Skip Menu |

This queue is for tickets about the Catalyst-Runtime CPAN distribution.

Report information
The Basics
Id: 44443
Status: resolved
Priority: 0/
Queue: Catalyst-Runtime

People
Owner: bobtfish [...] bobtfish.net
Requestors: dekimsey [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 5.8000_06
Fixed in: (no value)



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__
On Fri Mar 20 12:16:02 2009, dekimsey wrote: Show quoted text
> The attached patch file simply updates the environment.
The attached patch _globally_ _replaces_ the environment, which is at least going to break the restarter in some situations. The environment should already be placed in $c->engine->env by prepare_request method as it already exists in Engine::CGI, and should be accessible from there.
On Tue Apr 28 16:52:00 2009, BOBTFISH wrote: Show quoted text
> The environment should already be placed in $c->engine->env by > prepare_request method as it already exists in Engine::CGI, and should > be accessible from there.
I'm going to close this, as I don't think there is a bug here. However if the proposed solution doesn't work for you (or you would like to provide a doc patch to clarify that this is available), then please feel free to re-open. Cheers t0m