]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
ap_expr related fixes and enhancements
authorStefan Fritsch <sf@apache.org>
Sun, 21 Nov 2010 17:39:52 +0000 (17:39 +0000)
committerStefan Fritsch <sf@apache.org>
Sun, 21 Nov 2010 17:39:52 +0000 (17:39 +0000)
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1037510 13f79535-47bb-0310-9956-ffa450edef68

docs/manual/convenience.map
docs/manual/expr.html.en
docs/manual/expr.xml
docs/manual/mod/mod_include.html.en
docs/manual/mod/mod_include.xml
docs/manual/mod/mod_setenvif.html.en
docs/manual/mod/mod_setenvif.xml
docs/manual/mod/mod_ssl.html.en
docs/manual/mod/mod_ssl.xml

index fe43bbe39ab1bff62101dbb3b5013e73666be539..06638c1956ee432678f2d76933f61b78921bbace 100644 (file)
@@ -111,8 +111,8 @@ bufferedlogs        mod/mod_log_config.html#bufferedlogs
 buffersize     mod/mod_buffer.html#buffersize
 cachedefaultexpire     mod/mod_cache.html#cachedefaultexpire
 cachedetailheader      mod/mod_cache.html#cachedetailheader
-cachedirlength mod/mod_disk_cache.html#cachedirlength
-cachedirlevels mod/mod_disk_cache.html#cachedirlevels
+cachedirlength mod/mod_cache_disk.html#cachedirlength
+cachedirlevels mod/mod_cache_disk.html#cachedirlevels
 cachedisable   mod/mod_cache.html#cachedisable
 cacheenable    mod/mod_cache.html#cacheenable
 cachefile      mod/mod_file_cache.html#cachefile
@@ -128,14 +128,14 @@ cachelock mod/mod_cache.html#cachelock
 cachelockmaxage        mod/mod_cache.html#cachelockmaxage
 cachelockpath  mod/mod_cache.html#cachelockpath
 cachemaxexpire mod/mod_cache.html#cachemaxexpire
-cachemaxfilesize       mod/mod_disk_cache.html#cachemaxfilesize
+cachemaxfilesize       mod/mod_cache_disk.html#cachemaxfilesize
 cacheminexpire mod/mod_cache.html#cacheminexpire
-cacheminfilesize       mod/mod_disk_cache.html#cacheminfilesize
+cacheminfilesize       mod/mod_cache_disk.html#cacheminfilesize
 cachenegotiateddocs    mod/mod_negotiation.html#cachenegotiateddocs
 cachequickhandler      mod/mod_cache.html#cachequickhandler
-cachereadsize  mod/mod_disk_cache.html#cachereadsize
-cachereadtime  mod/mod_disk_cache.html#cachereadtime
-cacheroot      mod/mod_disk_cache.html#cacheroot
+cachereadsize  mod/mod_cache_disk.html#cachereadsize
+cachereadtime  mod/mod_cache_disk.html#cachereadtime
+cacheroot      mod/mod_cache_disk.html#cacheroot
 cachestaleonerror      mod/mod_cache.html#cachestaleonerror
 cachestoreexpired      mod/mod_cache.html#cachestoreexpired
 cachestorenostore      mod/mod_cache.html#cachestorenostore
@@ -190,6 +190,7 @@ dumpiooutput        mod/mod_dumpio.html#dumpiooutput
 enableexceptionhook    mod/mpm_common.html#enableexceptionhook
 enablemmap     mod/core.html#enablemmap
 enablesendfile mod/core.html#enablesendfile
+error  mod/core.html#error
 errordocument  mod/core.html#errordocument
 errorlog       mod/core.html#errorlog
 errorlogformat mod/core.html#errorlogformat
@@ -429,6 +430,7 @@ sessioninclude      mod/mod_session.html#sessioninclude
 sessionmaxage  mod/mod_session.html#sessionmaxage
 setenv mod/mod_env.html#setenv
 setenvif       mod/mod_setenvif.html#setenvif
+setenvifexpr   mod/mod_setenvif.html#setenvifexpr
 setenvifnocase mod/mod_setenvif.html#setenvifnocase
 sethandler     mod/core.html#sethandler
 setinputfilter mod/core.html#setinputfilter
@@ -488,6 +490,7 @@ sslverifydepth      mod/mod_ssl.html#sslverifydepth
 startservers   mod/mpm_common.html#startservers
 startthreads   mod/mpm_common.html#startthreads
 substitute     mod/mod_substitute.html#substitute
+suexec mod/mod_unixd.html#suexec
 suexecusergroup        mod/mod_suexec.html#suexecusergroup
 threadlimit    mod/mpm_common.html#threadlimit
 threadsperchild        mod/mpm_common.html#threadsperchild
index 6aeba3415aeb5033f13ff152c1756618eac84a33..a3d74ac47d772bcb7c73803ddbaad0d3858208ef 100644 (file)
@@ -33,6 +33,7 @@
 <li><img alt="" src="./images/down.gif" /> <a href="#binop">Binary operators</a></li>
 <li><img alt="" src="./images/down.gif" /> <a href="#unnop">Unary operators</a></li>
 <li><img alt="" src="./images/down.gif" /> <a href="#functions">Functions</a></li>
+<li><img alt="" src="./images/down.gif" /> <a href="#other">Other</a></li>
 </ul></div>
 <div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div>
 <div class="section">
@@ -57,12 +58,12 @@ comp        ::= stringcomp
               | word "<strong>!~</strong>" regex
 
 
-stringcomp  ::= word "<strong>==</strong>" word | word "<strong>eq</strong>" word
-              | word "<strong>!=</strong>" word | word "<strong>ne</strong>" word
-              | word "<strong>&lt;</strong>"  word | word "<strong>lt</strong>" word
-              | word "<strong>&lt;=</strong>" word | word "<strong>le</strong>" word
-              | word "<strong>&gt;</strong>"  word | word "<strong>gt</strong>" word
-              | word "<strong>&gt;=</strong>" word | word "<strong>ge</strong>" word
+stringcomp  ::= word "<strong>==</strong>" word
+              | word "<strong>!=</strong>" word
+              | word "<strong>&lt;</strong>"  word
+              | word "<strong>&lt;=</strong>" word
+              | word "<strong>&gt;</strong>"  word
+              | word "<strong>&gt;=</strong>" word
 
 integercomp ::= word "<strong>-eq</strong>" word | word "<strong>eq</strong>" word
               | word "<strong>-ne</strong>" word | word "<strong>ne</strong>" word
@@ -79,6 +80,7 @@ word        ::= word "<strong>.</strong>" word
               | "<strong>'</strong>" string "<strong>'</strong>"
               | "<strong>"</strong>" string "<strong>"</strong>"
               | variable
+              | rebackref
               | function
 
 string      ::= stringpart
@@ -86,6 +88,7 @@ string      ::= stringpart
 
 stringpart  ::= cstring
               | variable
+              | rebackref
 
 cstring     ::= ...
 digit       ::= [0-9]+
@@ -93,6 +96,8 @@ digit       ::= [0-9]+
 variable    ::= "<strong>%{</strong>" varname "<strong>}</strong>"
               | "<strong>%{</strong>" funcname "<strong>:</strong>" funcargs "<strong>}</strong>"
 
+rebackref   ::= "<strong>$</strong>" [0-9]
+
 function     ::= funcname "<strong>(</strong>" word "<strong>)</strong>"
 
 listfunction ::= listfuncname "<strong>(</strong>" word "<strong>)</strong>"
@@ -302,9 +307,40 @@ listfunction ::= listfuncname "<strong>(</strong>" word "<strong>)</strong>"
     Functions names are not case sensitive.
     Modules may register additional functions.</p>
 
-    <p>There are no built-in list-valued functions. <code class="module"><a href="./mod/mod_ssl.html">mod_ssl</a></code>'s
-    <code class="directive"><a href="./mod/mod_ssl.html#sslrequire">SSLRequire</a></code> provides
-    <code>PeerExtList</code>.</p>
+    <p>There are no built-in list-valued functions. <code class="module"><a href="./mod/mod_ssl.html">mod_ssl</a></code>
+    provides <code>PeerExtList</code>.  See the description of
+    <code class="directive"><a href="./mod/mod_ssl.html#sslrequire">SSLRequire</a></code> for details
+    (but <code>PeerExtList</code> is also usable outside
+    of <code class="directive"><a href="./mod/mod_ssl.html#sslrequire">SSLRequire</a></code>).</p>
+
+</div><div class="top"><a href="#page-header"><img alt="top" src="./images/up.gif" /></a></div>
+<div class="section">
+<h2><a name="other" id="other">Other</a></h2>
+    
+
+    <table class="bordered"><tr class="header"><th>Name</th><th>Alternative</th> <th>Description</th></tr>
+<tr><td><code>-in</code></td>
+        <td><code>in</code></td>
+        <td>string contained in string list</td></tr>
+<tr class="odd"><td><code>/regexp/</code></td>
+        <td><code>m#regexp#</code></td>
+        <td>Regular expression (the second form allows different delimiters than /)</td></tr>
+<tr><td><code>/regexp/i</code></td>
+        <td><code>m#regexp#i</code></td>
+        <td>Case insensitive regular expression</td></tr>
+<tr class="odd"><td><code>$0 ... $9</code></td>
+        <td />
+        <td>Regular expression backreferences</td></tr>
+</table>
+
+    <h3><a name="rebackref" id="rebackref">Regular expression backreferences</a></h3>
+        
+        <p>The strings <code>$0</code> ... <code>$9</code> allow to reference
+        the capture groups form a previously executed, successfully
+        matching regular expressions. They can normally only be used in the
+        same expression as the matching regex, but some modules allow special
+        uses.</p>
+    
 
 </div></div>
 <div class="bottomlang">
index fd672e4007f3e719eba4e8021c7e211de376c07b..a5e046b7adff61afcd1f9dee15cea4b975364735 100644 (file)
@@ -54,12 +54,12 @@ comp        ::= stringcomp
               | word "<strong>!~</strong>" regex
 
 
-stringcomp  ::= word "<strong>==</strong>" word | word "<strong>eq</strong>" word
-              | word "<strong>!=</strong>" word | word "<strong>ne</strong>" word
-              | word "<strong>&lt;</strong>"  word | word "<strong>lt</strong>" word
-              | word "<strong>&lt;=</strong>" word | word "<strong>le</strong>" word
-              | word "<strong>&gt;</strong>"  word | word "<strong>gt</strong>" word
-              | word "<strong>&gt;=</strong>" word | word "<strong>ge</strong>" word
+stringcomp  ::= word "<strong>==</strong>" word
+              | word "<strong>!=</strong>" word
+              | word "<strong>&lt;</strong>"  word
+              | word "<strong>&lt;=</strong>" word
+              | word "<strong>&gt;</strong>"  word
+              | word "<strong>&gt;=</strong>" word
 
 integercomp ::= word "<strong>-eq</strong>" word | word "<strong>eq</strong>" word
               | word "<strong>-ne</strong>" word | word "<strong>ne</strong>" word
@@ -76,6 +76,7 @@ word        ::= word "<strong>.</strong>" word
               | "<strong>'</strong>" string "<strong>'</strong>"
               | "<strong>"</strong>" string "<strong>"</strong>"
               | variable
+              | rebackref
               | function
 
 string      ::= stringpart
@@ -83,6 +84,7 @@ string      ::= stringpart
 
 stringpart  ::= cstring
               | variable
+              | rebackref
 
 cstring     ::= ...
 digit       ::= [0-9]+
@@ -90,6 +92,8 @@ digit       ::= [0-9]+
 variable    ::= "<strong>%{</strong>" varname "<strong>}</strong>"
               | "<strong>%{</strong>" funcname "<strong>:</strong>" funcargs "<strong>}</strong>"
 
+rebackref   ::= "<strong>$</strong>" [0-9]
+
 function     ::= funcname "<strong>(</strong>" word "<strong>)</strong>"
 
 listfunction ::= listfuncname "<strong>(</strong>" word "<strong>)</strong>"
@@ -319,9 +323,43 @@ listfunction ::= listfuncname "<strong>(</strong>" word "<strong>)</strong>"
     Functions names are not case sensitive.
     Modules may register additional functions.</p>
 
-    <p>There are no built-in list-valued functions. <module>mod_ssl</module>'s
-    <directive module="mod_ssl">SSLRequire</directive> provides
-    <code>PeerExtList</code>.</p>
+    <p>There are no built-in list-valued functions. <module>mod_ssl</module>
+    provides <code>PeerExtList</code>.  See the description of
+    <directive module="mod_ssl">SSLRequire</directive> for details
+    (but <code>PeerExtList</code> is also usable outside
+    of <directive module="mod_ssl">SSLRequire</directive>).</p>
+
+</section>
+
+<section id="other">
+    <title>Other</title>
+
+    <table border="1" style="zebra">
+    <columnspec><column width=".2"/><column width=".2"/><column width=".6"/></columnspec>
+
+    <tr><th>Name</th><th>Alternative</th> <th>Description</th></tr>
+    <tr><td><code>-in</code></td>
+        <td><code>in</code></td>
+        <td>string contained in string list</td></tr>
+    <tr><td><code>/regexp/</code></td>
+        <td><code>m#regexp#</code></td>
+        <td>Regular expression (the second form allows different delimiters than /)</td></tr>
+    <tr><td><code>/regexp/i</code></td>
+        <td><code>m#regexp#i</code></td>
+        <td>Case insensitive regular expression</td></tr>
+    <tr><td><code>$0 ... $9</code></td>
+        <td></td>
+        <td>Regular expression backreferences</td></tr>
+    </table>
+
+    <section id="rebackref">
+        <title>Regular expression backreferences</title>
+        <p>The strings <code>$0</code> ... <code>$9</code> allow to reference
+        the capture groups form a previously executed, successfully
+        matching regular expressions. They can normally only be used in the
+        same expression as the matching regex, but some modules allow special
+        uses.</p>
+    </section>
 
 </section>
 
index e9dc7c62b39c55087008ad7c7776c6c92ada40e3..0660b85cc9a236fabb5f141ad52f469235d63f49 100644 (file)
      be escaped.  This is regardless of their meaning to the regex engine.</p>
     </div>
 
-    <div class="note"><h3>Reference Documentation</h3>
-    <p>See also: <a href="../expr.html">Expressions in Apache HTTP Server</a>,
-    for a complete reference and examples.</p>
-    </div>
+    
 </div>
 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
 <div class="directive-section"><h2><a name="SSIAccessEnable" id="SSIAccessEnable">SSIAccessEnable</a> <a name="ssiaccessenable" id="ssiaccessenable">Directive</a></h2>
index c817ae7b6f9677d9b7fb8de7c001be329689065b..9828384a72d0a637cb755a0a495a5f8939aef89a 100644 (file)
      be escaped.  This is regardless of their meaning to the regex engine.</p>
     </note>
 
+    <!-- mod_include does not use ap_expr, yet
     <note><title>Reference Documentation</title>
     <p>See also: <a href="../expr.html">Expressions in Apache HTTP Server</a>,
     for a complete reference and examples.</p>
     </note>
+    -->
 </section>
 
 <directivesynopsis>
index 2f4b57cd517510aaa3383982943f0d2a94926d7d..7c0373d3a66d8129423c311e3b1316b84c6f1c87 100644 (file)
@@ -280,7 +280,7 @@ for additional examples.
     and applied <em>env-variable</em> in the same fashion as <code class="directive">SetEnvIf</code>.</p>
 
 <div class="example"><p><code>
-    SetEnvIfExpr "tolower(%req['X-Sendfile']) = 'D:\images\very_big.iso')" iso_delivered
+    SetEnvIfExpr "tolower(req('X-Sendfile')) == 'd:\images\very_big.iso')" iso_delivered
 </code></p></div>
 
     <p>This would set the environment variable <code>iso_delivered</code>
@@ -290,7 +290,7 @@ for additional examples.
     example from above for a site with more than one domain:</p>
 
 <div class="example"><p><code>
-    SetEnvIfExpr "${HTTP_REFERER} in www.example.com,example.com,w2.example3.org" intra_site_referral
+    SetEnvIfExpr "${HTTP_REFERER} in { 'www.example.com','example.com','w2.example3.org' }" intra_site_referral
 </code></p></div>
 
 <h3>See also</h3>
@@ -300,7 +300,6 @@ for a complete reference and more examples.</li>
 <li><code class="directive">&lt;If&gt;</code> can be used to achive similar
 results.</li>
 <li><code class="module"><a href="../mod/mod_filter.html">mod_filter</a></code></li>
-<li><code class="module"><a href="../mod/mod_include&gt;.html">mod_include&gt;</a></code></li>
 </ul>
 </div>
 <div class="top"><a href="#page-header"><img alt="top" src="../images/up.gif" /></a></div>
index ef639a0a2c7155b880e08993281e9626b0e839c8..b0062c27ee21ec096e42bfa62d84c78f14123b08 100644 (file)
@@ -275,7 +275,7 @@ for additional examples.
     >SetEnvIf</directive>.</p>
 
 <example>
-    SetEnvIfExpr "tolower(%req['X-Sendfile']) = 'D:\images\very_big.iso')" iso_delivered
+    SetEnvIfExpr "tolower(req('X-Sendfile')) == 'd:\images\very_big.iso')" iso_delivered
 </example>
 
     <p>This would set the environment variable <code>iso_delivered</code>
@@ -285,7 +285,7 @@ for additional examples.
     example from above for a site with more than one domain:</p>
 
 <example>
-    SetEnvIfExpr "${HTTP_REFERER} in www.example.com,example.com,w2.example3.org" intra_site_referral
+    SetEnvIfExpr "${HTTP_REFERER} in { 'www.example.com','example.com','w2.example3.org' }" intra_site_referral
 </example>
 </usage>
 
@@ -294,7 +294,6 @@ for a complete reference and more examples.</seealso>
 <seealso><directive type="section">If</directive> can be used to achive similar
 results.</seealso>
 <seealso><module>mod_filter</module></seealso>
-<seealso><module>mod_include></module></seealso>
 </directivesynopsis>
 
 <directivesynopsis>
index 5810bf2189ab3ff9558137d43ec0c5d4189bf5d6..a042e176583948899c867ea53d10b1baf08afe6d 100644 (file)
@@ -1596,15 +1596,9 @@ function ::= funcname "<strong>(</strong>" funcargs "<strong>)</strong>"
 </pre>
 </blockquote>
 <p>For <code>varname</code> any of the variables described in <a href="#envvars">Environment Variables</a> can be used.  For
-<code>funcname</code> the following functions are available:</p>
-<ul>
-<li><code>file(</code><em>filename</em><code>)</code>
-    <p>
-    This function takes one string argument and expands to the contents of the
-    file. This is especially useful for matching this contents against a
-    regular expression, etc.</p>
-</li>
-</ul>
+<code>funcname</code> the available functions are listed in
+the <a href="../expr.html#functions">ap_expr documentation</a>.</p>
+
 <p>Notice that <em>expression</em> is first parsed into an internal machine
 representation and then evaluated in a second step. Actually, in Global and
 Per-Server Class context <em>expression</em> is parsed at startup time and
index ca489fe5cb097dbdf89ff0a893756d68b885578f..13f0a969ea79640fc39304109fcec6620db1a3d2 100644 (file)
@@ -1267,15 +1267,9 @@ function ::= funcname "<strong>(</strong>" funcargs "<strong>)</strong>"
 </blockquote>
 <p>For <code>varname</code> any of the variables described in <a
 href="#envvars">Environment Variables</a> can be used.  For
-<code>funcname</code> the following functions are available:</p>
-<ul>
-<li><code>file(</code><em>filename</em><code>)</code>
-    <p>
-    This function takes one string argument and expands to the contents of the
-    file. This is especially useful for matching this contents against a
-    regular expression, etc.</p>
-</li>
-</ul>
+<code>funcname</code> the available functions are listed in
+the <a href="../expr.html#functions">ap_expr documentation</a>.</p>
+
 <p>Notice that <em>expression</em> is first parsed into an internal machine
 representation and then evaluated in a second step. Actually, in Global and
 Per-Server Class context <em>expression</em> is parsed at startup time and