You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by lg...@apache.org on 2013/06/22 18:41:49 UTC
svn commit: r1495753 - /httpd/httpd/trunk/docs/manual/mod/mod_lua.xml.fr
Author: lgentis
Date: Sat Jun 22 16:41:49 2013
New Revision: 1495753
URL: http://svn.apache.org/r1495753
Log:
Update.
Modified:
httpd/httpd/trunk/docs/manual/mod/mod_lua.xml.fr
Modified: httpd/httpd/trunk/docs/manual/mod/mod_lua.xml.fr
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/docs/manual/mod/mod_lua.xml.fr?rev=1495753&r1=1495752&r2=1495753&view=diff
==============================================================================
--- httpd/httpd/trunk/docs/manual/mod/mod_lua.xml.fr (original)
+++ httpd/httpd/trunk/docs/manual/mod/mod_lua.xml.fr Sat Jun 22 16:41:49 2013
@@ -1,7 +1,7 @@
<?xml version="1.0"?>
<!DOCTYPE modulesynopsis SYSTEM "../style/modulesynopsis.dtd">
<?xml-stylesheet type="text/xsl" href="../style/manual.fr.xsl"?>
-<!-- English Revision: 1490095:1495665 (outdated) -->
+<!-- English Revision : 1495666 -->
<!-- French translation : Lucien GENTIS -->
<!-- Reviewed by : Vincent Deffontaines -->
@@ -770,14 +770,20 @@ local hash = r:sha1("This is a test") --
r:escape(string) -- Echappe une chaîne de type URL.
local url = "http://foo.bar/1 2 3 & 4 + 5"
-local escaped = r:escape(url) -- returns 'http%3a%2f%2ffoo.bar%2f1+2+3+%26+4+%2b+5'
+local escaped = r:escape(url) -- renvoie 'http%3a%2f%2ffoo.bar%2f1+2+3+%26+4+%2b+5'
</highlight>
<highlight language="lua">
r:unescape(string) -- Déséchappe une chaîne de type URL.
local url = "http%3a%2f%2ffoo.bar%2f1+2+3+%26+4+%2b+5"
-local unescaped = r:escape(url) -- returns 'http://foo.bar/1 2 3 & 4 + 5'
+local unescaped = r:unescape(url) -- renvoie 'http://foo.bar/1 2 3 & 4 + 5'
+</highlight>
+
+<highlight language="lua">
+r:construct_url(string) -- Construit une URL à partir d'un URI
+
+local url = r:construct_url(r.uri)
</highlight>
<highlight language="lua">
@@ -946,7 +952,7 @@ r:state_query(string) -- Interroge le se
</highlight>
<highlight language="lua">
-r:stat(filename) -- Exécute stat() sur un fichier, et renvoie
+r:stat(filename [,wanted]) -- Exécute stat() sur un fichier, et renvoie
une table contenant des informations à propos de ce fichier.
local info = r:stat("/var/www/foo.txt")
@@ -956,7 +962,7 @@ end
</highlight>
<highlight language="lua">
-r:regex(string, pattern, [drapeaux]) -- Exécute une recherche à base
+r:regex(string, pattern [,flags]) -- Exécute une recherche à base
d'expression rationnelle sur une chaîne, et renvoie les
éventuelles correspondances trouvées.
@@ -1013,6 +1019,52 @@ function handle(r)
r:puts("La donnée en cache est : ", foo)
end
</highlight>
+<highlight language="lua">
+r:htpassword(string [,algorithm [,cost]]) -- Génère un hash de mot de passe à partir d'une chaîne.
+ -- algorithm: 0 = APMD5 (défaut), 1 = SHA, 2 = BCRYPT, 3 = CRYPT.
+ -- cost: ne s'utilise qu'avec l'algorythme BCRYPT (défaut = 5).
+</highlight>
+
+<highlight language="lua">
+r:mkdir(dir [,mode]) -- Crée un répertoire et définit son mode via le paramètre optionnel mode.
+</highlight>
+
+<highlight language="lua">
+r:mkrdir(dir [,mode]) -- Crée des répertoires de manière récursive et définit leur mode via le paramètre optionnel mode.
+</highlight>
+
+<highlight language="lua">
+r:rmdir(dir) -- Supprime un répertoire.
+</highlight>
+
+<highlight language="lua">
+r:touch(file [,mtime]) -- Définit la date de modification d'un fichier à la date courante ou à la valeur optionnelle mtime en msec.
+</highlight>
+
+<highlight language="lua">
+r:get_direntries(dir) -- Renvoie une table contenant toutes les entrées de répertoires.
+
+-- Renvoie un chemin sous forme éclatée en chemin, fichier, extension
+function split_path(path)
+ return path:match("(.-)([^\\/]-%.?([^%.\\/]*))$")
+end
+
+function handle(r)
+ local cwd, _, _ = split_path(r.filename)
+ for _, f in ipairs(r:get_direntries(cwd)) do
+ local info = r:stat(cwd .. f)
+ if info then
+ local mtime = os.date(fmt, info.mtime / 1000000)
+ local ftype = (info.filetype == 2) and "[dir] " or "[file]"
+ r:puts( ("%s %s %10i %s\n"):format(ftype, mtime, info.size, f) )
+ end
+ end
+end
+</highlight>
+
+<highlight language="lua">
+r.date_parse_rfc(string) -- Interprète une chaîne date/heure et renvoie l'équivalent en secondes depuis epoche.
+</highlight>
</section>