From: Christian Hansen Date: Tue, 24 May 2005 12:04:56 +0000 (+0000) Subject: added MYAPP_HOME and CATALYST_HOME environment variables X-Git-Tag: 5.7099_04~1369 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=895b2303b18c8761c46a9e0190b254594ec40654 added MYAPP_HOME and CATALYST_HOME environment variables --- diff --git a/Changes b/Changes index fdedccc..1b6da8c 100644 --- a/Changes +++ b/Changes @@ -3,6 +3,7 @@ This file documents the revision history for Perl extension Catalyst. 5.21 2005-00-00 00:00:00 - fixed a bug in https detection - fixed auto chain finally + - added MYAPP_HOME and CATALYST_HOME environment variables 5.20 2005-05-18 19:52:00 - improved uploads and parameters diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 040d81c..03dcf18 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -284,6 +284,35 @@ sub import { # Find home my $home = Catalyst::Utils::home($caller); + + if ( my $h = $ENV{CATALYST_HOME} ) { + + $home = $h if -d $h; + + unless ( -e _ ) { + $caller->log->warn(qq/CATALYST_HOME does not exist "$h"/); + } + + unless ( -e _ && -d _ ) { + $caller->log->warn(qq/CATALYST_HOME is not a directory "$h"/); + } + } + + if ( my $h = $ENV{ uc($caller) . '_HOME' } ) { + + $home = $h if -d $h; + + unless ( -e _ ) { + my $e = uc($caller) . '_HOME'; + $caller->log->warn(qq/$e does not exist "$h"/) + } + + unless ( -e _ && -d _ ) { + my $e = uc($caller) . '_HOME'; + $caller->log->warn(qq/$e is not a directory "$h"/); + } + } + if ( $caller->debug ) { $home ? ( -d $home ) diff --git a/lib/Catalyst/Engine/FastCGI.pm b/lib/Catalyst/Engine/FastCGI.pm index 077e765..506927b 100644 --- a/lib/Catalyst/Engine/FastCGI.pm +++ b/lib/Catalyst/Engine/FastCGI.pm @@ -55,9 +55,9 @@ sub prepare_parameters { =cut sub prepare_request { - my ( $c, $fastcgi, @arguments ) = @_; + my ( $c, $request, @arguments ) = @_; CGI::_reset_globals(); - $c->SUPER::prepare_request($fastcgi); + $c->SUPER::prepare_request($request); $c->Catalyst::Engine::CGI::prepare_request(@arguments); } diff --git a/lib/Catalyst/Engine/FastCGI/Base.pm b/lib/Catalyst/Engine/FastCGI/Base.pm index e3315dc..a2650b8 100644 --- a/lib/Catalyst/Engine/FastCGI/Base.pm +++ b/lib/Catalyst/Engine/FastCGI/Base.pm @@ -36,8 +36,8 @@ This class overloads some methods from C. =cut sub prepare_request { - my ( $c, $fastcgi ) = @_; - $c->fastcgi($fastcgi); + my ( $c, $request ) = @_; + $c->fastcgi($request); } =item $c->run