From fe5b2c6264c896c25d76b68fd13abc3ad2f94371 Mon Sep 17 00:00:00 2001 From: Lucien Gentis Date: Sat, 22 Jun 2013 16:41:49 +0000 Subject: [PATCH] Update. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1495753 13f79535-47bb-0310-9956-ffa450edef68 --- docs/manual/mod/mod_lua.xml.fr | 62 +++++++++++++++++++++++++++++++--- 1 file changed, 57 insertions(+), 5 deletions(-) diff --git a/docs/manual/mod/mod_lua.xml.fr b/docs/manual/mod/mod_lua.xml.fr index 4535e8af3c..a58906a270 100644 --- a/docs/manual/mod/mod_lua.xml.fr +++ b/docs/manual/mod/mod_lua.xml.fr @@ -1,7 +1,7 @@ - + @@ -770,14 +770,20 @@ local hash = r:sha1("This is a test") -- returns a54d88e06612d820bc3be72877c74f2 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' 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' + + + +r:construct_url(string) -- Construit une URL à partir d'un URI + +local url = r:construct_url(r.uri) @@ -946,7 +952,7 @@ r:state_query(string) -- Interroge le serveur à propos de son -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 -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 + +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). + + + +r:mkdir(dir [,mode]) -- Crée un répertoire et définit son mode via le paramètre optionnel mode. + + + +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. + + + +r:rmdir(dir) -- Supprime un répertoire. + + + +r:touch(file [,mtime]) -- Définit la date de modification d'un fichier à la date courante ou à la valeur optionnelle mtime en msec. + + + +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 + + + +r.date_parse_rfc(string) -- Interprète une chaîne date/heure et renvoie l'équivalent en secondes depuis epoche. + -- 2.49.0