php-doc-en/functions/apache.xml

161 lines
5.3 KiB
XML
Raw Normal View History

<reference id="ref.apache">
<title>Apache-specific functions</title>
<titleabbrev>Apache</titleabbrev>
<refentry id="function.apache-lookup-uri">
<refnamediv>
<refname>apache_lookup_uri</refname>
<refpurpose>Perform a partial request for the specified URI and return all info about it</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>class <function>apache_lookup_uri</function></funcdef>
<paramdef>string <parameter>filename</parameter></paramdef>
</funcsynopsis>
<para>
This performs a partial request for a URI. It goes just far
enough to obtain all the important information about the given
resource and returns this information in a class. The properties
of the returned class are:
<simplelist>
<member>status</member>
<member>the_request</member>
<member>status_line</member>
<member>method</member>
<member>content_type</member>
<member>handler</member>
<member>uri</member>
<member>filename</member>
<member>path_info</member>
<member>args</member>
<member>boundary</member>
<member>no_cache</member>
<member>no_local_copy</member>
<member>allowed</member>
<member>send_bodyct</member>
<member>bytes_sent</member>
<member>byterange</member>
<member>clength</member>
<member>unparsed_uri</member>
<member>mtime</member>
<member>request_time</member>
</simplelist>
</para>
<note>
<simpara>Note: apache_lookup_uri only works when PHP is installed as an Apache module
</simpara>
</note>
</refsect1>
</refentry>
<refentry id="function.apache-note">
<refnamediv>
<refname>apache_note</refname>
<refpurpose>Get and set apache request notes</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>string <function>apache_note</function></funcdef>
<paramdef>string <parameter>note_name</parameter></paramdef>
<paramdef>string <parameter><optional>note_value</optional></parameter></paramdef>
</funcsynopsis>
<para>
<function>apache_note</function> is an Apache-specific function
which gets and sets values in a request's
<literal>notes</literal> table. If called with one argument, it
returns the current value of note
<literal>note_name</literal>. If called with two arguments, it
sets the value of note <literal>note_name</literal> to
<literal>note_value</literal> and returns the previous value of
note <literal>note_name</literal>.</para>
</refsect1>
</refentry>
<refentry id="function.getallheaders">
<refnamediv>
<refname>getallheaders</refname>
<refpurpose>Fetch all HTTP request headers</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>array <function>getallheaders</function></funcdef>
<void/>
</funcsynopsis>
<para>
This function returns an associative array of all the HTTP headers in the
current request.
<note>
<para>
You can also get at the value of the common CGI variables by reading
them from the environment, which works whether or not you are using
PHP as an Apache module. Use <function>phpinfo</function> to see a
list of all of the environment variables defined this way.
</para>
</note>
<example>
<title>getallheaders() Example</title>
<programlisting>
$headers = getallheaders();
while (list($header, $value) = each($headers)) {
echo "$header: $value&lt;br&gt;\n";
}
</programlisting></example>
This example will display all the request headers for the
current request.
<note>
<simpara>
<function>getallheaders</function> is currently only supported
when PHP runs as an <productname>Apache</productname> module.
</simpara>
</note></para>
</refsect1>
</refentry>
<refentry id="function.virtual">
<refnamediv>
<refname>virtual</refname>
<refpurpose>Perform an Apache sub-request</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<funcsynopsis>
<funcdef>int <function>virtual</function></funcdef>
<paramdef>string <parameter>filename</parameter></paramdef>
</funcsynopsis>
<para>
<function>virtual</function> is an Apache-specific function which
is equivalent to &lt;!--#include virtual...--&gt; in mod_include.
It performs an Apache sub-request. It is useful for including CGI
scripts or .shtml files, or anything else that you would parse
through Apache. Note that for a CGI script, the script must
generate valid CGI headers. At the minimum that means it must
generate a Content-type header. For PHP files, you need to use
<function>include</function> or <function>require</function>;
<function>virtual</function> cannot be used to include a
document which is itself a PHP file..</para>
</refsect1>
</refentry>
</reference>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
sgml-parent-document:nil
sgml-default-dtd-file:"../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
-->