Integrate Frederik Ekengren and Leon Atkinson user notes on apache_note()

Add examples and see also


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@249453 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Mehdi Achour 2007-12-31 00:32:08 +00:00
parent bd4176288b
commit e18b239894
4 changed files with 128 additions and 13 deletions

View file

@ -1,6 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<!-- splitted from ./en/functions/apache.xml, last change in rev 1.2 -->
<!-- $Revision: 1.6 $ -->
<refentry xml:id="function.apache-note" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>apache_note</refname>
@ -15,10 +14,13 @@
<methodparam choice="opt"><type>string</type><parameter>note_value</parameter></methodparam>
</methodsynopsis>
<para>
<function>apache_note</function> is an Apache-specific function
which gets and sets values in a request's
Apache-specific function which gets and sets values in a request's
<literal>notes</literal> table.
</para>
<para>
The main use for <function>apache_note</function> is to pass information
from one module to another within the same request.
</para>
</refsect1>
<refsect1 role="parameters">
@ -56,6 +58,71 @@
If the note cannot be retrieved, &false; is returned.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Passing information between PHP and Perl</title>
<programlisting role="php">
<![CDATA[
<?php
apache_note('name', 'Fredrik Ekengren');
// Call perl script
virtual("/perl/some_script.pl");
$result = apache_note("resultdata");
?>
]]>
</programlisting>
<programlisting role="perl">
<![CDATA[
# 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);
]]>
</programlisting>
</example>
</para>
<para>
<example>
<title>Logging values in access.log</title>
<programlisting role="php">
<![CDATA[
<?php
apache_note('sessionID', session_id());
?>
]]>
</programlisting>
<programlisting role="apache">
<![CDATA[
# "%{sessionID}n" can be used in the LogFormat directive
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>virtual</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<!-- $Revision: 1.5 $ -->
<refentry xml:id="function.apache-reset-timeout" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>apache_reset_timeout</refname>
@ -35,6 +35,17 @@
&reftitle.notes;
&note.sm.disabled;
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>set_time_limit</function></member>
<member><function>ignore_user_abort</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.11 $ -->
<!-- $Revision: 1.12 $ -->
<!-- splitted from ./en/functions/apache.xml, last change in rev 1.2 -->
<refentry xml:id="function.getallheaders" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
@ -58,11 +58,31 @@
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>getallheadres</function> example</title>
<programlisting role="php">
<![CDATA[
<?php
foreach (getallheaders() as $name => $value) {
echo "$name: $value\n";
}
?>
]]>
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
&note.apache.nsapi-module;
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.15 $ -->
<!-- $Revision: 1.16 $ -->
<!-- splitted from ./en/functions/apache.xml, last change in rev 1.20 -->
<refentry xml:id="function.virtual" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
@ -67,7 +67,7 @@
<row>
<entry>4.0.6</entry>
<entry>
This function may be used on PHP files. However, it is typically
This function may be used on PHP files. However, it is typically
better to use <function>include</function> or
<function>require</function> for PHP files.
</entry>
@ -78,14 +78,21 @@
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
See <function>apache_note</function> for an example.
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
<warning>
<para>
The query string can be passed to the included file but
<varname>$_GET</varname> is copied from the parent script and only
<varname>$_SERVER['QUERY_STRING']</varname> is filled with the passed
query string. The query string may only be passed when using Apache 2.
The query string can be passed to the included file but
<varname>$_GET</varname> is copied from the parent script and only
<varname>$_SERVER['QUERY_STRING']</varname> is filled with the passed
query string. The query string may only be passed when using Apache 2.
The requested file will not be listed in the Apache access log.
</para>
</warning>
@ -97,6 +104,16 @@
</note>
&note.apache.nsapi-module;
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>apache_note</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file