[Catalyst] Apache's <IfDefine>

Ben Vinnerd ben-catalyst at vinnerd.com
Thu Apr 16 06:39:42 GMT 2009


Thanks Charlie. That will do me  :)

Ben


Charlie Garrison wrote:
> Good morning,
>
> On 15/04/09 at 1:24 PM +0100, Ben Vinnerd <ben-catalyst at vinnerd.com> 
> wrote:
>
>> I pass a flag to Apache when i start it up, e.g. -Dhello. Any ideas 
>> how i can check this from within a Catalyst app?
>
> If using mod_perl, then inside your IfDefine block, do a PerlSetEnv 
> (or maybe a PerlSetVar), eg:
>
>     PerlSetEnv SERVER_MODE "test"
>
> And then just check for key %ENV to see if the -D flag was applicable 
> for that request.
>
> The same technique should work with fast_cgi but you'll need to use 
> SetEnv rather than PerlSetEnv (unless fast_cgi has PerlSetEnv 
> equivalent).
>
> Charlie
>



More information about the Catalyst mailing list