From 179e5a57f5310cf92aa2236afb901aa529a93a6f Mon Sep 17 00:00:00 2001 From: Daniel Gruno Date: Mon, 6 Aug 2012 09:40:11 +0000 Subject: [PATCH] Fix some typos, scrap some functions, change some arguments and add a new function, as per sf's email. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1369761 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/developer/lua.xml | 187 ++++++---------------------------- 1 file changed, 29 insertions(+), 158 deletions(-) diff --git a/docs/manual/developer/lua.xml b/docs/manual/developer/lua.xml index 3d0fb282e2..4aee28f996 100644 --- a/docs/manual/developer/lua.xml +++ b/docs/manual/developer/lua.xml @@ -418,7 +418,7 @@ end
Example 5: Overlays using LuaMapHandler -LuaMaphandler ^/portal/([a-z]+)/ /path/to/lua/script.lua handle_$1 +LuaMapHandler ^/portal/([a-z]+)/ /path/to/lua/script.lua handle_$1
@@ -818,10 +818,6 @@ print(unescaped) -- prints "This is a test"
apache2.port
-apache2.getenv -
-apache2.setenv -
apache2.options
apache2.allowoverrides @@ -830,8 +826,6 @@ print(unescaped) -- prints "This is a test"
apache2.add_input_filter
-apache2.add_output_filter -
apache2.get_basic_auth_pw
apache2.get_limit_req_body @@ -842,12 +836,10 @@ print(unescaped) -- prints "This is a test"
apache2.some_auth_required
-apache2.context_document_root -
-apache2.context_prefix -
apache2.set_context_prefix
+apache2.get_server_name_for_url +
apache2.set_keepalive
apache2.make_etag @@ -898,39 +890,6 @@ apache2.add_input_filter(r, "SPAM_FILTER") -- Check input for spam..?

 

-
-apache2.add_output_filter( - request_rec<em> r</em>,  string<em> filter</em> - ) - -

-Adds an output filter to the request -

-

-Arguments: -

- - - - - - - - - - - - - -
ArgumentDescription
rThe mod_lua request handle
filterThe name of the filter handler to add
-

-Example: -

- -apache2.add_input_filter(r, "INCLUDES") -- Turn out output into an SSI-enabled document. - -

 

-
apache2.allowoverrides( request_rec<em> r</em> @@ -1024,52 +983,6 @@ The current Authorization type used in the request </p> <p> </p> </section> -<section id="apache2.context_document_root"> -<title>apache2.context_document_root( - request_rec<em> r</em> - ) - -

-Get the context_document_root for a request. This is a generalization of the document root, which is too limited in the presence of mappers like mod_userdir and mod_alias. The context_document_root is the directory on disk that maps to the context_prefix URI prefix. -

-

-Arguments: -

- - - - - - - - - -
ArgumentDescription
rThe mod_lua request handle
-

 

-
-
-apache2.context_prefix( - request_rec<em> r</em> - ) - -

-Get the context_prefix for a request. The context_prefix URI prefix maps to the context_document_root on disk. -

-

-Arguments: -

- - - - - - - - - -
ArgumentDescription
rThe mod_lua request handle
-

 

-
apache2.flush( request_rec<em> r</em> @@ -1165,7 +1078,7 @@ r:puts("You can't upload files bigger than ", limit, " bytes!") </section> <section id="apache2.get_server_name"> <title>apache2.get_server_name( - + request_rec<em> r</em> )

@@ -1174,7 +1087,16 @@ Returns the current server name from the request

Arguments:

-

None

+ + + + + + + + + +
ArgumentDescription
rThe mod_lua request handle

Return value(s):
@@ -1189,13 +1111,14 @@ r:puts("The ServerName is set to: ", name)

 

-
-apache2.getenv( - request_rec<em> r</em>,  string<em> key</em> +<section id="apache2.get_server_name_for_url"> +<title>apache2.get_server_name_for_url( + request_rec<em> r</em> )

-Returns the value of an environment variable +Get the current server name from the request for the purposes of using in a URL. +If the server name is an IPv6 literal address, it will be returned in URL format (e.g., "[fe80::1]").

Arguments: @@ -1209,25 +1132,7 @@ Returns the value of an environment variable r The mod_lua request handle - -key -key - -

-Return value(s): -
-The queried value -

-

-Example: -

- -local env = apache2.getenv("HTTP_HOST") -if env and env:len() > 0 then - r:puts("HTTP_HOST equals ", env) -end -

 

@@ -1372,7 +1277,7 @@ end
apache2.requestbody( - request_rec<em> r</em>,  string<em> filename</em> + request_rec<em> r</em>,  number<em> size</em>,  string<em> filename</em> )

@@ -1391,8 +1296,12 @@ Reads the request body. If a filename is specified, the request body will be wri The mod_lua request handle +size +The maximum size allowed, or 0/nil for unlimited size + + filename -filename +The file to save the output to, or nil to return it as a string

@@ -1405,10 +1314,10 @@ The number of bytes written if a filename was specified, otherwise it returns th

if tonumber(r.headers_in['Content-Length'] or 0) < 10000 then - local smallfile = apache2.requestbody(r) -- fetch a small file into memory + local smallfile = apache2.requestbody(r, 10000) -- fetch a small file into memory r:puts("I saved the uploaded file in memory") else - local read = apache2.requestbody(r, "/path/to/tmp") + local read = apache2.requestbody(r, 0, "/path/to/tmp") r:puts("I saved the uploaded file in a temp directory. Total bytes written was: ", read) end @@ -1612,43 +1521,6 @@ True if keepalive can be set, false otherwise

 

-
-apache2.setenv( - request_rec<em> r</em>,  string<em> key</em>,  string<em> val</em> - ) - -

-Sets the value of an environment variable -

-

-Arguments: -

- - - - - - - - - - - - - - - - - -
ArgumentDescription
rThe mod_lua request handle
keykey
valval
-

-Example: -

- -apache2.setenv("FOO_VAL", "bar and stuff") - -

 

-
apache2.some_auth_required( request_rec<em> r</em> @@ -1732,7 +1604,7 @@ True if the expression evaluates as true, false if the expression doesn't evalua </p> <highlight language="lua"> if apache2.expr("%{REQUEST_URI} =~ /force-gzip") then - apache2.add_output_filter(r, "DEFLATE") + r:addoutputfilter("DEFLATE") end </highlight> <p> </p> @@ -2322,7 +2194,7 @@ Kills off a server process. This has no other use than to show how dangerous mod )

-Opens up a new database connection. +Opens up a new database connection. See the DB functions for mod_pLua for more info on this.

Arguments: @@ -2540,5 +2412,4 @@ r:puts("delayed")

 

- -- 2.40.0