apache_note
apache_note
Get and set apache request notes
**apache_note** string $note_name $note_value
This function is a wrapper for Apache's and
. It edits the table of notes that exists
during a request. The table's purpose is to allow Apache modules to
communicate.
table_get``table_set
The main use for is to pass information
from one module to another within the same request.
apache_note
note_nameThe name of the note.
note_valueThe value of the note.
If is omitted or null, it returns the current value of note
. Otherwise, it
sets the value of note to
and returns the previous value of
note .
If the note cannot be retrieved, false is returned.
note_value``note_name``note_name``note_value``note_name
Voorbeeld: Passing information between PHP and Perl
<?php
apache_note('name', 'Fredrik Ekengren');
// Call perl script
virtual("/perl/some_script.pl");
$result = apache_note("resultdata");
?>
# Get Apache request object
my $r = Apache->request()->main();
# Get passed data
my $name = $r->notes('name');
# some processing
# Pass result back to PHP
$r->notes('resultdata', $result);
Voorbeeld: Logging values in access.log
<?php
apache_note('sessionID', session_id());
?>
# "%{sessionID}n" can be used in the LogFormat directive
virtual