Re: Apache::Dir

2004-05-24 Thread David Wheeler
On May 24, 2004, at 5:35 PM, Stas Bekman wrote: That's not quite click-able, isn't it? :) Stupid Wiki + Mail client. It's the last question here: http://www.masonhq.com/?FAQ:ServerConfiguration Regards, David - To unsubscribe, e-

Re: Apache::Dir

2004-05-24 Thread Stas Bekman
David Wheeler wrote: On May 24, 2004, at 5:26 PM, Geoffrey Young wrote: yeah, that looks and sounds right. cool. Whew! Added to the Mason FAQ: http://www.masonhq.com/?FAQ:ServerConfiguration#h- i_m_using_html__mason___apachehandler_and_i_have___decline_dirs__disable d_and_am_using_a_dhandler

Re: Apache::Dir

2004-05-24 Thread David Wheeler
On May 24, 2004, at 5:26 PM, Geoffrey Young wrote: yeah, that looks and sounds right. cool. Whew! Added to the Mason FAQ: http://www.masonhq.com/?FAQ:ServerConfiguration#h- i_m_using_html__mason___apachehandler_and_i_have___decline_dirs__disable d_and_am_using_a_dhandler_to_handle_directory_

Re: Apache::Dir

2004-05-24 Thread Geoffrey Young
David Wheeler wrote: > On May 24, 2004, at 5:17 PM, Geoffrey Young wrote: > >> ok, that still looks funky. here's where I'm coming from, which may be >> different than where you're coming from :) > > > Heh, okay, sorry for my density. ;-)_ no problem. I'm the dense one most of the time :)

Re: Apache::Dir

2004-05-24 Thread David Wheeler
On May 24, 2004, at 5:17 PM, Geoffrey Young wrote: ok, that still looks funky. here's where I'm coming from, which may be different than where you're coming from :) Heh, okay, sorry for my density. ;-)_ mod_perl is typically set up to handle stuff correctly. the problem exists where mod_perl is

Re: Apache::Dir

2004-05-24 Thread Geoffrey Young
>> I think that 'unless' should be 'if' - if the request is for a directory, >> and if the directory has a trailing slash, set the content handler to be >> perl-script. I think the above logic demorgans out to >> >> if ( ! $r->content_type eq DIR_MAGIC_TYPE || $uri !~ m{/$} ) >> >> which isn't

Re: Apache::Dir

2004-05-24 Thread David Wheeler
On May 24, 2004, at 12:55 PM, Geoffrey Young wrote: <%init>; use Apache::Constants qw(DIR_MAGIC_TYPE); $m->abort(-1) if $r->content_type eq DIR_MAGIC_TYPE && $r->uri !~ m{/$}; -1 is DECLINED, right? For Mason it is, at any rate. If it's the same as DECLINED, I'll use that, instead. sub

Re: Apache::Dir

2004-05-24 Thread Geoffrey Young
> You can add these lines to the top of your dhandler to handle the redirect > yourself: > > <%init>; > use Apache::Constants qw(DIR_MAGIC_TYPE); > $m->abort(-1) if $r->content_type eq DIR_MAGIC_TYPE && $r->uri !~ m{/$}; > -1 is DECLINED, right? > > The status of this problem in mod_p

Re: Apache::Dir

2004-05-21 Thread David Wheeler
r->uri !~ m{/$}; Here Mason declines the request, and therefore so does C. This allows C to handle the request, and C will trigger the appropriate redirection. =item * You can use David Wheeler's Apache::Dir module from CPAN to replicate the directory redirection behavior of C in C. Using

Re: Apache::Dir

2004-05-19 Thread David Wheeler
On May 19, 2004, at 7:53 AM, Larry Leszczynski wrote: At apache 1.3 configure time there is "--permute-module" option, which can swap module ordering: --permute-module=N1:N2 on-the-fly permute module 'N1' with module 'N2' You can either give it the names of two modules to swap, e.g.:

Re: Apache::Dir

2004-05-19 Thread Larry Leszczynski
Hi David - > > that's the way it would work with apache 1.3, except that > > ClearModuleList unloads everything, so you now need an AddModule for > > every module, including mod_cgi, mod_rewrite, mod_auth, etc. > > Oh, too bad there isn't a RemoveModule. Then I could just do: > >RemoveModule m

Re: Apache::Dir

2004-05-18 Thread Geoffrey Young
it statically, so to > speak. yeah. at first I thought about a compile time option. then stas thought we could use macros to pick up on -D switches. then I figured out how to have it directive-oriented, which we all preferred. then we tested the solution on win32 and *boom* > I'm no

Re: Apache::Dir

2004-05-18 Thread David Wheeler
ically, so to speak. I'm not sure how to document this, though; it sounds like mod_perl 2 folks will _have_ to use my Apache::Dir module (now registered to me--thanks Doug!) if they want the mod_dir behavior, while Apache 1 users can use the ClearModules/AddModule solution if they'

Re: Apache::Dir

2004-05-18 Thread David Wheeler
On May 12, 2004, at 4:55 AM, Radoslaw Zielinski wrote: Save the expense of the regexp as well. :-) You underestimate the optimizations of a good regular expression that simply checks a character anchored at the end of a string, my friend: % cat try #!/usr/bin/perl -w use strict; use Benchmark; my

Re: Apache::Dir

2004-05-12 Thread Radoslaw Zielinski
David Wheeler <[EMAIL PROTECTED]> [12-05-2004 01:25]: > On May 11, 2004, at 3:24 PM, Geoffrey Young wrote: [...] >> yeah, you can probably just check for DIR_MAGIC_TYPE here. > Cool, saves the expense of the stat! Here's what I have now: [...] > return DECLINED unless $r->content_type == DIR_MA

Re: Apache::Dir

2004-05-11 Thread Geoffrey Young
;> use Apache::Constants qw(DECLINED DIR_MAGIC_TYPE): >> $r->set_handlers(PerlHandler => sub { return DECLINED }) >>if $r->content_type = DIR_MAGIC_TYPE; > > > This assumes that I want to decline a request for a directory every > time. But I

Re: Apache::Dir

2004-05-11 Thread David Wheeler
assumes that I want to decline a request for a directory every time. But I don't; only if there is no "/" at the end. And that's effectively what I'm doing with my Apache::Dir module, no? It looks like I could recommend that it be used as PerlFixupHandler, though, inste

Re: Apache::Dir

2004-05-11 Thread Geoffrey Young
DIR_MAGIC_TYPE from the handler_rec in mod_perl.c and >> recompile >> >> some of these may not be suitable for something like Bricolage >> support. but >> there are options short of rewriting mod_dir in perl. > > >

Re: Apache::Dir

2004-05-11 Thread David Wheeler
ewriting mod_dir in perl. Here's all that my Apache::Dir does: sub handler { my $r = shift; return DECLINED unless -d $r->filename && $r->uri !~ m{/$}; my $args = $r->args; $r->header_out(Location => $r->uri . '/' . ($args ? "?$args&

Re: Apache::Dir

2004-05-11 Thread Geoffrey Young
David Wheeler wrote: > G'day. > > I recently had a need to have mod_dir in Apache 1.3 work even when I was > using a Perl handler. It turns out that mod_dir does its thing during > the response phase. So I created a quick Perl module to do what I want. > Here's the description: > > This sim

Apache::Dir

2004-05-11 Thread David Wheeler
This is the problem that this module is designed to address. Thanks to mod_perl's ability to stack handlers, you can just make sure that Apache::Dir handles requests before Mason does. Configuration would then look something like this: PerlSetVar MasonDecli