Return-Path: X-Original-To: apmail-httpd-cvs-archive@www.apache.org Delivered-To: apmail-httpd-cvs-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 0C9DECD50 for ; Sat, 22 Jun 2013 16:42:14 +0000 (UTC) Received: (qmail 51925 invoked by uid 500); 22 Jun 2013 16:42:12 -0000 Delivered-To: apmail-httpd-cvs-archive@httpd.apache.org Received: (qmail 51882 invoked by uid 500); 22 Jun 2013 16:42:11 -0000 Mailing-List: contact cvs-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: dev@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list cvs@httpd.apache.org Received: (qmail 51875 invoked by uid 99); 22 Jun 2013 16:42:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 22 Jun 2013 16:42:10 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 22 Jun 2013 16:42:09 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id DA61C2388A2C; Sat, 22 Jun 2013 16:41:49 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1495753 - /httpd/httpd/trunk/docs/manual/mod/mod_lua.xml.fr Date: Sat, 22 Jun 2013 16:41:49 -0000 To: cvs@httpd.apache.org From: lgentis@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20130622164149.DA61C2388A2C@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org 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 @@ - + @@ -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' 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 se -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. +