perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Adam Prime <adam.pr...@utoronto.ca>
Subject Re: finding "context" in mod_perl handler
Date Tue, 21 Apr 2009 14:57:19 GMT
André Warnier wrote:
> Hi.
> 
> Supposing I have this kind of setup
> 
> <Location /xyz>
>   PerlAuthenhandler My::AuthModule
>   ...
> </Location>
> 
> ...
> 
> <Directory /var/www/some/path>
>   PerlAuthenhandler My::AuthModule
>   ...
> </Directory>
> 
> and a request is made for "/xyz", and as a result the module is called,
> 
> is there some way in My::AuthModule::handler(), by which I can find out 
> that, in *this* instance, I am being called in the "context" of the 
> <Location> directive above, as opposed to the <Directory> case ?
> 
> I mean, I could do something like respectively
>   PerlSetVar context "location:/xyz"
> and
>   PerlSetVar context "dir:/some/path"
> 
> and then check the var in the handler, but there has to be a 
> better/cleaner way, no ?

The first thing i'd try is checking $r->location.  I'm not sure what 
that does for the Directory instance, but in the Location instance it'll 
return '/xyz'.  I don't know of a comparable way to do the same thing 
with Directory directives.

Adam

Mime
View raw message