From 2a463b3cd73c32ee9dcd508248d0194923f435f4 Mon Sep 17 00:00:00 2001 From: Stefan Fritsch Date: Sat, 29 Mar 2014 21:56:19 +0100 Subject: Imported Upstream version 2.4.9 --- docs/manual/expr.html.en | 81 +++++++++++++++++++++++++----------------------- 1 file changed, 42 insertions(+), 39 deletions(-) (limited to 'docs/manual/expr.html.en') diff --git a/docs/manual/expr.html.en b/docs/manual/expr.html.en index 5c3ae459..82121a84 100644 --- a/docs/manual/expr.html.en +++ b/docs/manual/expr.html.en @@ -9,7 +9,7 @@ - @@ -25,17 +25,15 @@  fr 

-

Historically, there are several syntax variants for expressions used to express - a condition in the different modules of the Apache HTTP Server. - There is some ongoing effort to only use a single variant, called ap_expr, - for all configuration directives. - This document describes the ap_expr expression parser. +

Historically, there are several syntax variants for expressions + used to express a condition in the different modules of the Apache + HTTP Server. There is some ongoing effort to only use a single + variant, called ap_expr, for all configuration directives. + This document describes the ap_expr expression parser.

The ap_expr expression is intended to replace most other - expression variants in HTTPD. For example, the deprecated - SSLRequire expressions can be - replaced by Require expr. -

+ expression variants in HTTPD. For example, the deprecated SSLRequire expressions can be replaced + by Require expr.

See also

+

See also

top

Grammar in Backus-Naur Form notation

-

Backus-Naur Form (BNF) is a notation - technique for context-free grammars, often used to describe the syntax of languages used in computing. +

Backus-Naur + Form (BNF) is a notation technique for context-free grammars, + often used to describe the syntax of languages used in computing. In most cases, expressions are used to express boolean values. - For these, the starting point in the BNF is expr. However, a few directives - like LogMessage accept expressions - that evaluate to a string value. For those, the starting point in the BNF is string. + For these, the starting point in the BNF is expr. + However, a few directives like LogMessage accept expressions + that evaluate to a string value. For those, the starting point in + the BNF is string.

-
-expr        ::= "true" | "false"
+
expr        ::= "true" | "false"
               | "!" expr
               | expr "&&" expr
               | expr "||" expr
@@ -119,8 +118,7 @@ rebackref   ::= "$" [0-9]
 
 function     ::= funcname "(" word ")"
 
-listfunction ::= listfuncname "(" word ")"
-
+listfunction ::= listfuncname "(" word ")"
top
@@ -216,8 +214,8 @@ listfunction ::= listfuncname "(" word ")" The DocumentRoot of the current vhost AUTH_TYPE - The configured AuthType - (e.g. "basic") + The configured AuthType (e.g. + "basic") CONTENT_TYPE The content type of the response HANDLER @@ -262,14 +260,16 @@ listfunction ::= listfuncname "(" word ")" The day of the week (starting with 0 for Sunday) TIME - The date and time in the format 20101231235959 + The date and time in the format + 20101231235959 SERVER_SOFTWARE The server version string API_VERSION The date of the API version (module magic number) -

Some modules register additional variables, see e.g. mod_ssl.

+

Some modules register additional variables, see e.g. + mod_ssl.

top
@@ -392,7 +392,8 @@ listfunction ::= listfuncname "(" word ")" "false", or "no" (case insensitive). True otherwise. -R - Same as "%{REMOTE_ADDR} -ipmatch ...", but more efficient + Same as "%{REMOTE_ADDR} -ipmatch ...", but more + efficient @@ -417,7 +418,9 @@ listfunction ::= listfuncname "(" word ")" resp Get HTTP response header reqenv - Lookup request environment variable (as a shortcut, v can be used too to access variables). + Lookup request environment variable (as a shortcut, + v can be used too to access + variables). osenv Lookup operating system environment variable note @@ -461,11 +464,11 @@ listfunction ::= listfuncname "(" word ")" the expression. The req_novary function can be used to prevent names from being added to the Vary header.

-

In addition to string-valued functions, there are also list-valued functions which - take one string as argument and return a wordlist, i.e. a list of strings. The wordlist - can be used with the special -in operator. - Functions names are not case sensitive. - Modules may register additional functions.

+

In addition to string-valued functions, there are also + list-valued functions which take one string as argument and return a + wordlist, i.e. a list of strings. The wordlist can be used with the + special -in operator. Functions names are not case + sensitive. Modules may register additional functions.

There are no built-in list-valued functions. mod_ssl provides PeerExtList. See the description of @@ -478,10 +481,10 @@ listfunction ::= listfuncname "(" word ")"

Example expressions

-

The following examples show how expressions might be used to evaluate requests:

+

The following examples show how expressions might be used to + evaluate requests:

-
-# Compare the host name to example.com and redirect to www.example.com if it matches
+	
# Compare the host name to example.com and redirect to www.example.com if it matches
 <If "%{HTTP_HOST} == 'example.com'">
     Redirect permanent / http://www.example.com/
 </If>
@@ -493,9 +496,8 @@ listfunction ::= listfuncname "(" word ")"
 
 # Only allow access to this content during business hours
 <Directory "/foo/bar/business">
-    Require expr "%{TIME_HOUR} -gt 9 && %{TIME_HOUR} -lt 17"
-</Directory>	
-	
+ Require expr %{TIME_HOUR} -gt 9 && %{TIME_HOUR} -lt 17 +</Directory>
top
@@ -508,7 +510,8 @@ listfunction ::= listfuncname "(" word ")" string contained in string list /regexp/ m#regexp# - Regular expression (the second form allows different delimiters than /) + Regular expression (the second form allows different + delimiters than /) /regexp/i m#regexp#i Case insensitive regular expression @@ -561,7 +564,7 @@ var comments_identifier = 'http://httpd.apache.org/docs/2.4/expr.html'; } })(window, document); //-->