On Sat, 20 Jul 2002, Jeremy Mates wrote:

> What started out with an issue with (deep breath)
> Apache::AxKit::StyleChooser::UserAgent has turned into a more general
> issue for me with AxKit: %ENV does not appear to be populated with the
> keys one would expect at the time the StyleChooser modules are run.
>
> All the solutions I have found thus far involve fiddling around with
> the code for AxKit.  %ENV can be populated in AxKit.pm (e.g. under the
> fast_handler sub) or inside hander for the module in question:
>
> use Apache::Request;
> $r->subprocess_env;
> %ENV=%{$r->subprocess_env};
>
> This introduces some overhead, according to the modperl book (p.498).
>
> The other approach is to replace the %ENV calls in the modules in
> question with a lookup on the $r object, as appropriate.  For example,
> $r->header_in('User-Agent') can be used in lieu of HTTP_USER_AGENT.
>
> Is there a better way I have missed?  I tried fiddling with PerlSetEnv
> and similar (which pass through undefined variables) and making sure
> PerlSetupEnv was enabled.  Generic modperl modules outside of AxKit
> have %ENV properly setup, which leads me to believe the StyleChooser
> modules are getting run before the content handler phase.

As you've discovered, by default AxKit no longer sets up the ENV. To get
the same setup as mod_perl enjoys you need to stop bypassing mod_perl
(which we do with SetHandler/AddHandler axkit), and instead use the "slow"
handler, which you enable with SetHandler perl-script, PerlHandler AxKit.

-- 
<!-- Matt -->
<:->Get a smart net</:->


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to