Changeset 464

Show
Ignore:
Timestamp:
07/17/2005 10:07:53 AM (3 years ago)
Author:
jan
Message:

fixed LUA code examples

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/lighttpd-1.3.x/doc/cml.txt

    r458 r464  
    103103  cwd = request["CWD"] 
    104104 
    105   output_include = { b + "_cache.html" } 
     105  output_include = { b .. "_cache.html" } 
    106106 
    107107  trigger_handler = "index.php" 
    108108 
    109   if file_mtime(b + "../lib/php/menu.csv") > file_mtime(cwd + "_cache.html") or 
    110      file_mtime(b + "templates/jk.tmpl")   > file.mtime(cwd + "_cache.html") 
    111      file.mtime(b + "content.html")        > file.mtime(cwd + "_cache.html") then 
     109  if file_mtime(b .. "../lib/php/menu.csv") > file_mtime(cwd .. "_cache.html") or 
     110     file_mtime(b .. "templates/jk.tmpl")   > file.mtime(cwd .. "_cache.html") 
     111     file.mtime(b .. "content.html")        > file.mtime(cwd .. "_cache.html") then 
    112112     return 1 
    113113  else  
     
    145145  cwd = request["CWD"] 
    146146    
    147   output_include = { cwd + "head.html",  
    148                      cwd + "menu.html", 
    149                      cwd + "spacer.html", 
    150                      cwd + "db-content.html", 
    151                      cwd + "spacer2.html", 
    152                      cwd + "news.html", 
    153                      cwd + "footer.html" } 
     147  output_include = { cwd .. "head.html",  
     148                     cwd .. "menu.html", 
     149                     cwd .. "spacer.html", 
     150                     cwd .. "db-content.html", 
     151                     cwd .. "spacer2.html", 
     152                     cwd .. "news.html", 
     153                     cwd .. "footer.html" } 
    154154   
    155155  return 0 
     
    160160============ 
    161161 
    162 You need `lua <http://www.lua.org/>`_ and should install `<libmemcache-1.3.x http://people.freebsd.org/~seanc/libmemcache/>`  
    163 and have to configure lighttpd with: :: 
     162You need `lua <http://www.lua.org/>`_ and should install `libmemcache-1.3.x <http://people.freebsd.org/~seanc/libmemcache/>`_ and have to configure lighttpd with: :: 
    164163 
    165164  ./configure ... --with-lua --with-memcache 
     
    212211the standard error-page use ``server.errorfile-prefix``. 
    213212 
    214 Examples 
    215 ======== 
    216  
    217 Using the memcache-udf for MySQL we can do: :: 
    218  
    219   output_contenttype = "text/html" 
    220   output_include = { "cache-hit.html" } 
    221  
    222   trigger_handler = "generate.php" 
    223  
    224   if get["page"] == memcache_get_string("123") then 
    225     return 0 
    226   else 
    227     return 1 
    228   end 
    229  
    230 In MySQL you do: :: 
    231  
    232   SELECT memcache_set("127.0.0.1:11211", "123", "12"); 
    233  
    234 or to retrieve a value: :: 
    235  
    236    SELECT memcache_get("127.0.0.1:11211", "123"); 
    237  
    238 You can get the mysql udf at `jan's mysql page <http://jan.kneschke.de/projects/mysql/udf/>`_.