超越PHP PHP动态 | 经典文章 | CLASS | 相关下载 | 常见问题 | FORUM | WIKI | 在线手册
Site search:    
<apache_lookup_uriapache_request_headers>
Last updated: Fri, 22 Jun 2007

apache_note

(PHP 3>= 3.0.2, PHP 4 , PHP 5)

apache_note -- 取得或设置 apache 请求记录

说明

string apache_note ( string note_name [, string note_value])

apache_note() 是用于 Apache 的函数,可以取得或者设置请求 notes 表中的值。如果只有一个参数调用,则返回记录 note_name 的当前值。如果用两个参数调用,则将记录 note_name 的值设为 note_value 并返回记录 note_name 的前一个值。




add a note add a note User Contributed Notes
apache_note
leon at leonatkinson dot com
12-Sep-1999 06:48
This function is a wrapper for Apache's table_get and table_set. It
edits the table of notes that exists during a request.  The table's
purpose is to allow Apache modules to communicate.  Here are some
further details I found in the mailing list archives:


Rasmus wrote:


The main use for apache_note() is to pass information
from one module to another within the same request.  I haven`t seen an
actual implementation that uses this yet, but it is quite possible for
someone to write a module which performs some sort of action at one of the
other stages of the request and stores some information in the Apache note
table which will then be available to PHP when the request reaches the
content-handling stage. Or, one could have a logging module that reads
something from the Apache Note table set by PHP.


David Sklar wrote:

You can use it to facilitate communication between modules that act on the
request at different stages. I use it to record userids in logfiles. In
some PHP that gets auto_prepend-ed, I do a


apache_note(`sessionID`,$sessionID);


(where $sessionID has been slurped out of a cookie and processed)


and then, in my httpd.conf, part of my LogFormat is


"%{sessionID}n"


so that sessionID gets written to the logfile.


If you have other modules that process the request before or after PHP
does (authentication, fixups, whatever..) you can have them talk to PHP or
PHP talk to them through the notes table.


<apache_lookup_uriapache_request_headers>
 Last updated: Fri, 22 Jun 2007
view source | feedback | send page | sitemap | aboutus   
Copyright ® 2002-2003 PHPE.NET. All rights reserved
Last updated:2002-11-22