Re: Apache2
Dave Rolsky <[email protected]>
| Newsgroups | gmane.comp.web.mason.devel |
|---|---|
| Message-ID | <[email protected]> |
On Wed, 28 Jul 2004, David Wheeler wrote:
> On Jul 27, 2004, at 10:48 PM, John Williams wrote:
>
> > Finally 2 in ?: style, which are kinda ugly. Suggestions for better
> > style
> > appreciated. This one avoids Apache->request:
>
> Set a constant.
>
> use constant APACHE2 => $mod_perl::VERSION >= 1.99;
>
> Then later...
>
> @@ -581,7 +596,7 @@
> my $allowed_params = $class->allowed_params(%defaults, %params);
>
> if ( exists $allowed_params->{comp_root} and
> - my $req = $r || Apache->request ) # DocumentRoot is only
> available inside requests
> + my $req = $r || (APACHE2 ? undef : Apache->request) ) #
> DocumentRoot
Yeah, that's a bit cleaner, so let's do that if we can't avoid the
conditionals.
-dave
/*=======================
House Absolute Consulting
www.houseabsolute.com
=======================*/
-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click