perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Philippe M. Chiasson" <go...@ectoplasm.org>
Subject Re: Perl Script using MapToStorageHandler
Date Wed, 01 Mar 2006 22:13:44 GMT
Glenn Martin wrote:
> Actually if i read the documentation correctly, im
> doing it just right. Map to Storage is right before it
> get mapped to a Location/Directory... and thus this is
> where id want to add Directory/Location and Alias
> directives based off of the incomming URI... Im trying
> to control DAV input. Take the URI, translate it to a
> Folder, Check the folders contents to see if it
> matches a Subversion repository and if it does map the
> Location to SVN Dav and that repository otherwise Map
> the Directory to the URI using an Alias and a
> Directory and turn on normal WebDAV... Then return
> Decline to Apache then tries to Match the URI to the
> Modified Config. Which will active the correct module
> for the correct folder...

I hope I understood this correctly, so apologies if I didn't.

> However i need this configuration change to be
> Temporary... Per request only... I need the Alias' or
> Location/Directory sections to no longer exist..

You can't 'remove' configuration directives you've injected
in httpd. And those are very *global* and would affect
much more than the current request.

> What handler do i use? and how do i reset the
> configuration?

You don't reset the configuration, but you simply take a different
approach.

Instead of trying to inject httpd configuration, your MapToStorage handler
needs to emulate Alias/Location directives. For instance, if you needed
to Alias /foo to /var/www/foo, instead of doing what I believe you are currently
doing:

$r->add_config(["Alias /foo /var/www/foo"]);

Simply do what mod_alias would have done...

$r->filename(File::Spec->catfile("/var/www", $r->uri));

And you get pre-request behaviour just like you wanted. And it's tons faster too ;-)

--------------------------------------------------------------------------------
Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
http://gozer.ectoplasm.org/     F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5

Mime
View raw message