]> granicus.if.org Git - apache/commitdiff
add another example filter, try to clarify how parameters to the filter
authorJeff Trawick <trawick@apache.org>
Wed, 26 Jun 2002 19:54:53 +0000 (19:54 +0000)
committerJeff Trawick <trawick@apache.org>
Wed, 26 Jun 2002 19:54:53 +0000 (19:54 +0000)
program are specified

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@95892 13f79535-47bb-0310-9956-ffa450edef68

docs/manual/mod/mod_ext_filter.html.en
docs/manual/mod/mod_ext_filter.xml

index 0148f613ed511c9ffa6a78129b0969bdbd0382fc..ebf0d1bb7eeeafe2ad2e09d019c913fc5bf7ca3d 100644 (file)
@@ -2,9 +2,9 @@
           XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
                 This file is generated from xml source: DO NOT EDIT
           XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
-        --><title>mod_ext_filter- Apache HTTP Server</title><link href="../style/manual.css" type="text/css" rel="stylesheet"/></head><body><blockquote><div align="center"><img src="../images/sub.gif" alt="[APACHE DOCUMENTATION]"/><h3>Apache HTTP Server Version 2.0</h3></div><h1 align="center">Apache Module mod_ext_filter</h1><table cellspacing="1" cellpadding="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td valign="top"><span class="help">Description:</span></td><td>Pass the response body
+        --><title>mod_ext_filter- Apache HTTP Server</title><link href="../style/manual.css" type="text/css" rel="stylesheet"/></head><body><blockquote><div align="center"><img src="../images/sub.gif" alt="[APACHE DOCUMENTATION]"/><h3>Apache HTTP Server Version 2.0</h3></div><h1 align="center">Apache Module mod_ext_filter</h1><table cellspacing="1" cellpadding="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td nowrap="nowrap" valign="top"><span class="help">Description:</span></td><td>Pass the response body
     through an external program before delivery to the
-    client</td></tr><tr><td><a href="module-dict.html#Status" class="help">Status:</a></td><td>Experimental</td></tr><tr><td><a href="module-dict.html#ModuleIdentifier" class="help">Module&nbsp;Identifier:</a></td><td>ext_filter_module</td></tr></table></td></tr></table><h2>Summary</h2>
+    client</td></tr><tr><td nowrap="nowrap"><a href="module-dict.html#Status" class="help">Status:</a></td><td>Experimental</td></tr><tr><td nowrap="nowrap"><a href="module-dict.html#ModuleIdentifier" class="help">Module&nbsp;Identifier:</a></td><td>ext_filter_module</td></tr></table></td></tr></table><h2>Summary</h2>
     <p>This is an <strong>experimental</strong> module and should
     be used with care. Test your <code><a href="mod_ext_filter.html">mod_ext_filter</a></code>
     configuration carefully to ensure that it performs the desired
 </code></td></tr></table></blockquote>
 
 
+<h3>Using sed to replace text in the response</h3>
+<blockquote><table cellpadding="10"><tr><td bgcolor="#eeeeee"><code>
+<pre>
+  # mod_ext_filter directive to define a filter which replaces text in
+  # the response
+  ExtFilterDefine fixtext mode=output cmd="/bin/sed s/verdana/arial/g" intype=text/html
+
+  &lt;Location /&gt;
+
+  # core directive to cause the fixtext filter to be run on output
+  # output
+  SetOutputFilter fixtext
+
+  &lt;/Location&gt;
+</pre>
+</code></td></tr></table></blockquote>
+
+
 <hr/><h2><a name="ExtFilterDefine">ExtFilterDefine</a> <a name="extfilterdefine">Directive</a></h2><table cellpadding="1" cellspacing="0" border="0" bgcolor="#cccccc"><tr><td><table bgcolor="#ffffff"><tr><td nowrap="nowrap"><strong>Description: </strong></td><td/></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Syntax" class="help">Syntax:</a></td><td>ExtFilterDefine <em>filtername</em> <em>parameters</em></td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Context" class="help">Context:</a></td><td>server config</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Status" class="help">Status:</a></td><td>Experimental</td></tr><tr><td nowrap="nowrap"><a href="directive-dict.html#Module" class="help">Module:</a></td><td>mod_ext_filter</td></tr></table></td></tr></table>
     <p>The <code class="directive">ExtFilterDefine</code> directive defines the
     characteristics of an external filter, including the program to
       <dd>The <code>cmd=</code> keyword allows you to specify the
       external command to run. If there are arguments after the
       program name, the command line should be surrounded in
-      quotation marks.</dd>
+      quotation marks (e.g., <em>cmd="/bin/mypgm arg1 arg2"</em>.
+      Normal shell quoting is not necessary since the program is
+      run directly, bypassing the shell.</dd>
 
       <dt>mode=<em>mode</em></dt>
 
index 986eea8ec105e5a26fc4ae7972691b93403d9617..0899a298133a6b3f79e636413955eeace272a620 100644 (file)
 </example>
 </section>
 
+<section><title>Using sed to replace text in the response</title>
+<example>
+<pre>
+  # mod_ext_filter directive to define a filter which replaces text in
+  # the response
+  ExtFilterDefine fixtext mode=output cmd="/bin/sed s/verdana/arial/g" intype=text/html
+
+  &lt;Location /&gt;
+
+  # core directive to cause the fixtext filter to be run on output
+  # output
+  SetOutputFilter fixtext
+
+  &lt;/Location&gt;
+</pre>
+</example>
+</section>
+
 </section> <!-- Examples -->
 
 <directivesynopsis>
       <dd>The <code>cmd=</code> keyword allows you to specify the
       external command to run. If there are arguments after the
       program name, the command line should be surrounded in
-      quotation marks.</dd>
+      quotation marks (e.g., <em>cmd="/bin/mypgm arg1 arg2"</em>.
+      Normal shell quoting is not necessary since the program is
+      run directly, bypassing the shell.</dd>
 
       <dt>mode=<em>mode</em></dt>