perl-test-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r170626 - in /perl/Apache-Test/trunk: Changes lib/Apache/TestConfig.pm lib/Apache/TestConfigParse.pm
Date Tue, 17 May 2005 17:57:50 GMT
Author: stas
Date: Tue May 17 10:57:48 2005
New Revision: 170626

URL: http://svn.apache.org/viewcvs?rev=170626&view=rev
Log:
When adding TypesConfig directives (either inherited from the global
httpd.conf or from the locally generated mime.types) make sure to
enclose it in <IfModule mod_mime.c>..</IfModule>, since mod_mime might
be unavailable.

Modified:
    perl/Apache-Test/trunk/Changes
    perl/Apache-Test/trunk/lib/Apache/TestConfig.pm
    perl/Apache-Test/trunk/lib/Apache/TestConfigParse.pm

Modified: perl/Apache-Test/trunk/Changes
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/trunk/Changes?rev=170626&r1=170625&r2=170626&view=diff
==============================================================================
--- perl/Apache-Test/trunk/Changes (original)
+++ perl/Apache-Test/trunk/Changes Tue May 17 10:57:48 2005
@@ -8,7 +8,10 @@
 
 =item 1.24-dev
 
-
+When adding TypesConfig directives (either inherited from the global
+httpd.conf or from the locally generated mime.types) make sure to
+enclose it in <IfModule mod_mime.c>..</IfModule>, since mod_mime might
+be unavailable. [Stas]
 
 
 

Modified: perl/Apache-Test/trunk/lib/Apache/TestConfig.pm
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/trunk/lib/Apache/TestConfig.pm?rev=170626&r1=170625&r2=170626&view=diff
==============================================================================
--- perl/Apache-Test/trunk/lib/Apache/TestConfig.pm (original)
+++ perl/Apache-Test/trunk/lib/Apache/TestConfig.pm Tue May 17 10:57:48 2005
@@ -1283,7 +1283,11 @@
             print $fh $self->types_config_template;
             close $fh;
         }
-        $self->postamble(TypesConfig => qq("$types"));
+        $self->postamble(<<EOI);
+<IfModule mod_mime.c>
+    TypesConfig "$types"
+</IfModule>
+EOI
     }
 }
 

Modified: perl/Apache-Test/trunk/lib/Apache/TestConfigParse.pm
URL: http://svn.apache.org/viewcvs/perl/Apache-Test/trunk/lib/Apache/TestConfigParse.pm?rev=170626&r1=170625&r2=170626&view=diff
==============================================================================
--- perl/Apache-Test/trunk/lib/Apache/TestConfigParse.pm (original)
+++ perl/Apache-Test/trunk/lib/Apache/TestConfigParse.pm Tue May 17 10:57:48 2005
@@ -50,11 +50,27 @@
 #where to add config, default is preamble
 my %spec_postamble = map { $_, 'postamble' } qw(TypesConfig);
 
+# need to enclose the following directives into <IfModule
+# mod_foo.c>..</IfModule>, since mod_foo might be unavailable
+my %ifmodule = (
+    TypesConfig => 'mod_mime.c',
+);
+
 sub spec_add_config {
     my($self, $directive, $val) = @_;
 
     my $where = $spec_postamble{$directive} || 'preamble';
-    $self->$where($directive => $val);
+
+    if (my $ifmodule = $ifmodule{TypesConfig}) {
+        $self->postamble(<<EOI);
+<IfModule $ifmodule>
+    $directive $val
+</IfModule>
+EOI
+    }
+    else {
+        $self->$where($directive => $val);
+    }
 }
 
 # resolve relative files like Apache->server_root_relative



Mime
View raw message