Re: Apache2

David Wheeler <[email protected]>
Newsgroups gmane.comp.web.mason.devel
Message-ID <[email protected]>
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

Regards,

David
smime.p7s (application/pkcs7-signature, 2.3 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.