ref.outcontrol: new doc style

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@237780 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Mehdi Achour 2007-06-15 19:09:20 +00:00
parent 1346e1bc34
commit e78f5f335a
17 changed files with 784 additions and 338 deletions

View file

@ -1,45 +1,43 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.6 $ -->
<!-- splitted from ./en/functions/outcontrol.xml, last change in rev 1.1 -->
<!-- $Revision: 1.7 $ -->
<refentry id="function.flush">
<refnamediv>
<refname>flush</refname>
<refpurpose>Flush the output buffer</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>void</type><methodname>flush</methodname>
<void/>
</methodsynopsis>
<simpara>
Flushes the output buffers of PHP and whatever backend PHP is
using (CGI, a web server, etc). This effectively tries to push
all the output so far to the user's browser.
</simpara>
<para>
<function>flush</function> has no effect on the buffering
scheme of your web server or the browser on the client
side.
Flushes the output buffers of PHP and whatever backend PHP is using (CGI,
a web server, etc). This effectively tries to push all the output so far
to the user's browser.
</para>
<para>
<function>flush</function> has no effect on the buffering scheme of your
web server or the browser on the client side.
Thus you need to call both <function>ob_flush</function> and
<function>flush</function> to flush the output buffers.
</para>
<para>
Several servers, especially on Win32, will still buffer
the output from your script until it terminates before
transmitting the results to the browser.
Several servers, especially on Win32, will still buffer the output from
your script until it terminates before transmitting the results to the
browser.
</para>
<para>
Server modules for Apache like mod_gzip may do buffering of their own
that will cause <function>flush</function> to not result in data being
sent immediately to the client.
Server modules for Apache like mod_gzip may do buffering of their own that
will cause <function>flush</function> to not result in data being sent
immediately to the client.
</para>
<para>
Even the browser may buffer its input before displaying it.
Netscape, for example, buffers text until it receives an
end-of-line or the beginning of a tag, and it won't render
tables until the &lt;/table&gt; tag of the outermost table is
seen.
Even the browser may buffer its input before displaying it. Netscape, for
example, buffers text until it receives an end-of-line or the beginning of
a tag, and it won't render tables until the &lt;/table&gt; tag of the
outermost table is seen.
</para>
<para>
Some versions of Microsoft Internet Explorer will only start to display
@ -48,6 +46,14 @@
page.
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.void;
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file

View file

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<!-- splitted from ./en/functions/outcontrol.xml, last change in rev 1.20 -->
<!-- $Revision: 1.4 $ -->
<refentry id="function.ob-clean">
<refnamediv>
<refname>ob_clean</refname>
<refpurpose>Clean (erase) the output buffer</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>void</type><methodname>ob_clean</methodname>
<void/>
@ -19,12 +19,26 @@
This function does not destroy the output buffer like
<function>ob_end_clean</function> does.
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
See also <function>ob_flush</function>,
<function>ob_end_flush</function> and
<function>ob_end_clean</function>.
&return.void;
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>ob_flush</function></member>
<member><function>ob_end_flush</function></member>
<member><function>ob_end_clean</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file

View file

@ -1,29 +1,68 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.12 $ -->
<!-- splitted from ./en/functions/outcontrol.xml, last change in rev 1.1 -->
<!-- $Revision: 1.13 $ -->
<refentry id="function.ob-end-clean">
<refnamediv>
<refname>ob_end_clean</refname>
<refpurpose>Clean (erase) the output buffer and turn off output buffering</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>ob_end_clean</methodname>
<void/>
</methodsynopsis>
<para>
This function discards the contents of the topmost output buffer and
turns off this output buffering. If you want to further
process the buffer's contents you have to call
<function>ob_get_contents</function> before
<function>ob_end_clean</function> as the buffer contents are
discarded when <function>ob_end_clean</function> is called.
The function returns &true; when it successfully
discarded one buffer and &false; otherwise. Reasons for failure are first
that you called the function without an active buffer or that for some
reason a buffer could not be deleted (possible for special buffer).
This function discards the contents of the topmost output buffer and turns
off this output buffering. If you want to further process the buffer's
contents you have to call <function>ob_get_contents</function> before
<function>ob_end_clean</function> as the buffer contents are discarded
when <function>ob_end_clean</function> is called.
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success; Reasons for failure are first that you called the
function without an active buffer or that for some reason a buffer could
not be deleted (possible for special buffer).
</para>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
<para>
If the function fails it generates an <constant>E_NOTICE</constant>.
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>4.2.0</entry>
<entry>
The boolean return value was added.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
The following example shows an easy way to get rid of all output buffers:
</para>
@ -41,20 +80,19 @@ ob_end_clean();
</programlisting>
</example>
</para>
<note>
<simpara>
If the function fails it generates an E_NOTICE.
</simpara>
<simpara>
The boolean return value was added in PHP 4.2.0.
</simpara>
</note>
<para>
See also <function>ob_start</function>,
<function>ob_get_contents</function>, and
<function>ob_flush</function>.
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>ob_start</function></member>
<member><function>ob_get_contents</function></member>
<member><function>ob_flush</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file

View file

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.9 $ -->
<!-- splitted from ./en/functions/outcontrol.xml, last change in rev 1.1 -->
<!-- $Revision: 1.10 $ -->
<refentry id="function.ob-end-flush">
<refnamediv>
<refname>ob_end_flush</refname>
<refpurpose>Flush (send) the output buffer and turn off output buffering</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>ob_end_flush</methodname>
<void/>
@ -19,10 +19,6 @@
<function>ob_get_contents</function> before
<function>ob_end_flush</function> as the buffer contents are
discarded after <function>ob_end_flush</function> is called.
The function returns &true; when it successfully
discarded one buffer and &false; otherwise. Reasons for failure are first
that you called the function without an active buffer or that for some
reason a buffer could not be deleted (possible for special buffer).
</para>
<note>
<simpara>
@ -30,13 +26,57 @@
that <function>ob_get_flush</function> returns the buffer as a string.
</simpara>
</note>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
The following example shows an easy way to flush and end all output
buffers:
&return.success; Reasons for failure are first that you called the
function without an active buffer or that for some reason a buffer could
not be deleted (possible for special buffer).
</para>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
<para>
If the function fails it generates an <constant>E_NOTICE</constant>.
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>4.2.0</entry>
<entry>
The boolean return value was added.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>ob_end_flush</function> example</title>
<para>
The following example shows an easy way to flush and end all output
buffers:
</para>
<programlisting role="php">
<![CDATA[
<?php
@ -46,22 +86,21 @@
</programlisting>
</example>
</para>
<note>
<simpara>
If the function fails it generates an E_NOTICE.
</simpara>
<simpara>
The boolean return value was added in PHP 4.2.0.
</simpara>
</note>
<para>
See also <function>ob_start</function>,
<function>ob_get_contents</function>,
<function>ob_get_flush</function>,
<function>ob_flush</function> and
<function>ob_end_clean</function>.
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>ob_start</function></member>
<member><function>ob_get_contents</function></member>
<member><function>ob_get_flush</function></member>
<member><function>ob_flush</function></member>
<member><function>ob_end_clean</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file

View file

@ -1,36 +1,49 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<!-- splitted from ./en/functions/outcontrol.xml, last change in rev 1.20 -->
<!-- $Revision: 1.4 $ -->
<refentry id="function.ob-flush">
<refnamediv>
<refname>ob_flush</refname>
<refpurpose>Flush (send) the output buffer</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>void</type><methodname>ob_flush</methodname>
<void/>
</methodsynopsis>
<para>
This function will send the contents of the output buffer (if
any). If you want to further
process the buffer's contents you have to call
<function>ob_get_contents</function> before
<function>ob_flush</function> as the buffer contents are
discarded after <function>ob_flush</function> is called.
This function will send the contents of the output buffer (if any). If you
want to further process the buffer's contents you have to call
<function>ob_get_contents</function> before <function>ob_flush</function>
as the buffer contents are discarded after <function>ob_flush</function>
is called.
</para>
<para>
This function does not destroy the output buffer like
<function>ob_end_flush</function> does.
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
See also <function>ob_get_contents</function>,
<function>ob_clean</function>,
<function>ob_end_flush</function> and
<function>ob_end_clean</function>.
&return.void;
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>ob_get_contents</function></member>
<member><function>ob_clean</function></member>
<member><function>ob_end_flush</function></member>
<member><function>ob_end_clean</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file

View file

@ -1,23 +1,37 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.3 $ -->
<!-- $Revision: 1.4 $ -->
<refentry id="function.ob-get-clean">
<refnamediv>
<refname>ob_get_clean</refname>
<refpurpose>Get current buffer contents and delete current output buffer</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>ob_get_clean</methodname>
<void/>
</methodsynopsis>
<para>
This will return the contents of the output buffer and end output
buffering. If output buffering isn't active then &false; is returned.
Gets the current buffer contents and delete current output buffer.
</para>
<para>
<function>ob_get_clean</function> essentially executes both
<function>ob_get_contents</function> and
<function>ob_end_clean</function>.
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the contents of the output buffer and end output buffering.
If output buffering isn't active then &false; is returned.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>A simple <function>ob_get_clean</function> example</title>
@ -36,9 +50,7 @@ var_dump($out);
?>
]]>
</programlisting>
<para>
Our example will output:
</para>
&example.outputs;
<screen>
<![CDATA[
@ -48,11 +60,18 @@ string(11) "hello world"
</screen>
</example>
</para>
<para>
See also <function>ob_start</function> and
<function>ob_get_contents</function>.
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>ob_get_contents</function></member>
<member><function>ob_start</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file

View file

@ -1,21 +1,32 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<!-- splitted from ./en/functions/outcontrol.xml, last change in rev 1.5 -->
<!-- $Revision: 1.5 $ -->
<refentry id="function.ob-get-contents">
<refnamediv>
<refname>ob_get_contents</refname>
<refpurpose>Return the contents of the output buffer</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>ob_get_contents</methodname>
<void/>
</methodsynopsis>
<para>
This will return the contents of the output buffer without clearing it
or &false;, if output buffering isn't active.
Gets the contents of the output buffer without clearing it.
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
This will return the contents of the output buffer or &false;, if output
buffering isn't active.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>A simple <function>ob_get_contents</function> example</title>
@ -39,24 +50,27 @@ var_dump($out1, $out2);
?>
]]>
</programlisting>
<para>
Our example will output:
</para>
&example.outputs;
<screen>
<![CDATA[
string(6) "Hello "
string(11) "Hello World"
]]>
</screen>
</example>
</para>
<para>
See also <function>ob_start</function> and
<function>ob_get_length</function>.
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>ob_start</function></member>
<member><function>ob_get_length</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file

View file

@ -1,12 +1,13 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.5 $ -->
<!-- $Revision: 1.6 $ -->
<refentry id="function.ob-get-flush">
<refnamediv>
<refname>ob_get_flush</refname>
<refpurpose>Flush the output buffer, return it as a string and turn off output buffering</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>ob_get_flush</methodname>
<void/>
@ -14,8 +15,6 @@
<para>
<function>ob_get_flush</function> flushes the output buffer, return
it as a string and turns off output buffering.
<function>ob_get_flush</function> returns &false; if no buffering is
active.
</para>
<note>
<simpara>
@ -23,6 +22,17 @@
that this function returns the buffer as a string.
</simpara>
</note>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the output buffer or &false; if no buffering is active.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>ob_get_flush</function> example</title>
@ -54,12 +64,19 @@ Array
</screen>
</example>
</para>
<para>
See also <function>ob_end_clean</function>,
<function>ob_end_flush</function> and
<function>ob_list_handlers</function>.
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>ob_end_clean</function></member>
<member><function>ob_end_flush</function></member>
<member><function>ob_list_handlers</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file

View file

@ -1,21 +1,32 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.6 $ -->
<!-- splitted from ./en/functions/outcontrol.xml, last change in rev 1.22 -->
<!-- $Revision: 1.7 $ -->
<refentry id="function.ob-get-length">
<refnamediv>
<refname>ob_get_length</refname>
<refpurpose>Return the length of the output buffer</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>int</type><methodname>ob_get_length</methodname>
<void/>
</methodsynopsis>
<para>
This will return the length of the contents in the output buffer
or &false;, if output buffering isn't active.
This will return the length of the contents in the output buffer.
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the length of the output buffer contents or &false; if no
buffering is active.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>A simple <function>ob_get_length</function> example</title>
@ -39,23 +50,26 @@ echo $len1 . ", ." . $len2;
?>
]]>
</programlisting>
<para>
Our example will output:
</para>
&example.outputs;
<screen>
<![CDATA[
6, 11
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
See also <function>ob_start</function> and
<function>ob_get_contents</function>.
<simplelist>
<member><function>ob_start</function></member>
<member><function>ob_get_contents</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file

View file

@ -1,26 +1,40 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<!-- splitted from ./en/functions/outcontrol.xml, last change in rev 1.11 -->
<!-- $Revision: 1.5 $ -->
<refentry id="function.ob-get-level">
<refnamediv>
<refname>ob_get_level</refname>
<refpurpose>Return the nesting level of the output buffering mechanism</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>int</type><methodname>ob_get_level</methodname>
<void/>
</methodsynopsis>
<para>
This will return the level of nested output buffering handlers
or zero if output buffering is not activated.
</para>
<para>
See also <function>ob_start</function> and
<function>ob_get_contents</function>.
Returns the nesting level of the output buffering mechanism.
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Returns the level of nested output buffering handlers or zero if output
buffering is not active.
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>ob_start</function></member>
<member><function>ob_get_contents</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file

View file

@ -1,29 +1,50 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.4 $ -->
<!-- $Revision: 1.5 $ -->
<refentry id="function.ob-get-status">
<refnamediv>
<refname>ob_get_status</refname>
<refpurpose>Get status of output buffers</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>array</type><methodname>ob_get_status</methodname>
<methodparam choice="opt"><type>bool</type> <parameter>full_status</parameter> <initializer>FALSE</initializer></methodparam>
</methodsynopsis>
<para>
<function>ob_get_status</function> returns status information on
either the top level output buffer or all active output buffer levels
if <parameter>full_status</parameter> is set to &true;.
<function>ob_get_status</function> returns status information on either
the top level output buffer or all active output buffer levels if
<parameter>full_status</parameter> is set to &true;.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>full_status</parameter></term>
<listitem>
<para>
&true; to return all active output buffer levels. If &false, or not
set, only the top level output buffer is returned.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
If called without the <parameter>full_status</parameter> parameter
or with <parameter>full_status</parameter> = &false; a simple array
with the following elements is returned:
</para>
<example>
<title>Simple <function>ob_get_status</function> output</title>
<screen>
<informalexample>
<screen>
<![CDATA[
Array
(
[level] => 2
@ -32,9 +53,9 @@ Array
[name] => URL-Rewriter
[del] => 1
)
</screen>
</example>
<para>
]]>
</screen>
</informalexample>
<segmentedlist>
<title>Simple <function>ob_get_status</function> results</title>
<segtitle>Key</segtitle><segtitle>Value</segtitle>
@ -51,10 +72,9 @@ Array
The output level is used as key of the top level array and each array
element itself is another array holding status information
on one active output level.
</para>
<example>
<title>Full <function>ob_get_status</function> output</title>
<screen>
<informalexample>
<screen>
<![CDATA[
Array
(
[0] => Array
@ -81,8 +101,10 @@ Array
)
)
</screen>
</example>
]]>
</screen>
</informalexample>
</para>
<para>
The full output contains these additional elements:
<segmentedlist>
@ -93,11 +115,18 @@ Array
<seglistitem><seg>blocksize</seg><seg>...</seg></seglistitem>
</segmentedlist>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
See also <function>ob_get_level</function> and
<function>ob_list_handlers</function>.
<simplelist>
<member><function>ob_get_level</function></member>
<member><function>ob_list_handlers</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file

View file

@ -1,42 +1,86 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.13 $ -->
<!-- splitted from ./en/functions/outcontrol.xml, last change in rev 1.1 -->
<!-- $Revision: 1.14 $ -->
<refentry id="function.ob-gzhandler">
<refnamediv>
<refname>ob_gzhandler</refname>
<refpurpose>ob_start callback function to gzip output buffer</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>string</type><methodname>ob_gzhandler</methodname>
<methodparam><type>string</type><parameter>buffer</parameter></methodparam>
<methodparam><type>int</type><parameter>mode</parameter></methodparam>
</methodsynopsis>
<note>
<para>
<function>ob_gzhandler</function> requires the <link linkend="ref.zlib">zlib</link>
extension.
</para>
</note>
<para>
<function>ob_gzhandler</function> is intended to be used as a
callback function for <function>ob_start</function> to help
facilitate sending gz-encoded data to web browsers that support
compressed web pages. Before <function>ob_gzhandler</function>
actually sends compressed data, it determines what type of
content encoding the browser will accept ("gzip", "deflate" or
none at all) and will return its output accordingly. All
browsers are supported since it's up to the browser to send the
correct header saying that it accepts compressed web pages.
If a browser doesn't support compressed pages this function returns
&false;.
<function>ob_gzhandler</function> is intended to be used as a callback
function for <function>ob_start</function> to help facilitate sending
gz-encoded data to web browsers that support compressed web pages.
Before <function>ob_gzhandler</function> actually sends compressed data,
it determines what type of content encoding the browser will accept
("gzip", "deflate" or none at all) and will return its output accordingly.
All browsers are supported since it's up to the browser to send the
correct header saying that it accepts compressed web pages. If a browser
doesn't support compressed pages this function returns &false;.
</para>
<note>
<para>
<parameter>mode</parameter> was added in PHP 4.0.5.
</para>
</note>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>buffer</parameter></term>
<listitem>
<para>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>mode</parameter></term>
<listitem>
<para>
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>4.0.5</entry>
<entry>
The <parameter>mode</parameter> parameter was added.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>ob_gzhandler</function> example</title>
@ -56,22 +100,37 @@ ob_start("ob_gzhandler");
</programlisting>
</example>
</para>
</refsect1>
<refsect1 role="notes">
&reftitle.notes;
<note>
<para>
You cannot use both <function>ob_gzhandler</function> and
<link linkend="ini.zlib.output-compression">
zlib.output_compression</link>. Also note that
using <link linkend="ini.zlib.output-compression">
<function>ob_gzhandler</function> requires the <link
linkend="ref.zlib">zlib</link> extension.
</para>
</note>
<note>
<para>
You cannot use both <function>ob_gzhandler</function> and <link
linkend="ini.zlib.output-compression">zlib.output_compression</link>.
Also note that using <link linkend="ini.zlib.output-compression">
zlib.output_compression</link> is preferred over
<function>ob_gzhandler</function>.
</para>
</note>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
See also
<function>ob_start</function> and
<function>ob_end_flush</function>.
<simplelist>
<member><function>ob_start</function></member>
<member><function>ob_end_flush</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file

View file

@ -1,30 +1,60 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.5 $ -->
<!-- splitted from ./en/functions/outcontrol.xml, last change in rev 1.1 -->
<!-- $Revision: 1.6 $ -->
<refentry id="function.ob-implicit-flush">
<refnamediv>
<refname>ob_implicit_flush</refname>
<refpurpose>Turn implicit flush on/off</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>void</type><methodname>ob_implicit_flush</methodname>
<methodparam choice="opt"><type>int</type><parameter>flag</parameter></methodparam>
</methodsynopsis>
<para>
<function>ob_implicit_flush</function> will turn implicit
flushing on or off (if no <parameter>flag</parameter> is given,
it defaults to on). Implicit flushing will result in a flush
operation after every output call, so that explicit calls to
<function>flush</function> will no longer be needed.
</para>
<para>
See also <function>flush</function>,
<function>ob_start</function>, and
<function>ob_end_flush</function>.
<function>ob_implicit_flush</function> will turn implicit flushing on or
off. Implicit flushing will result in a flush operation after every output
call, so that explicit calls to <function>flush</function> will no longer
be needed.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>flag</parameter></term>
<listitem>
<para>
&true; to turn implicit flushing on, &false; otherwise.
Defaults to &true;.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.void;
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>flush</function></member>
<member><function>ob_start</function></member>
<member><function>ob_end_flush</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file

View file

@ -1,24 +1,35 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.7 $ -->
<!-- $Revision: 1.8 $ -->
<refentry id="function.ob-list-handlers">
<refnamediv>
<refname>ob_list_handlers</refname>
<refpurpose>List all output handlers in use</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>array</type><methodname>ob_list_handlers</methodname>
<void/>
</methodsynopsis>
<para>
This will return an array with the output handlers in use (if any). If
<link
linkend="ini.output-buffering">output_buffering</link> is
enabled or an anonymous function was used with
<function>ob_start</function>, <function>ob_list_handlers</function> will
return "default output handler".
Lists all output handlers in use.
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
This will return an array with the output handlers in use (if any). If
<link linkend="ini.output-buffering">output_buffering</link> is enabled or
an anonymous function was used with <function>ob_start</function>,
<function>ob_list_handlers</function> will return "default output
handler".
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>ob_list_handlers</function> example</title>
@ -61,14 +72,20 @@ Array
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
See also
<function>ob_end_clean</function>,
<function>ob_end_flush</function>,
<function>ob_get_flush</function>,
<function>ob_start</function>.
<simplelist>
<member><function>ob_end_clean</function></member>
<member><function>ob_end_flush</function></member>
<member><function>ob_get_flush</function></member>
<member><function>ob_start</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file

View file

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.21 $ -->
<!-- splitted from ./en/functions/outcontrol.xml, last change in rev 1.1 -->
<!-- $Revision: 1.22 $ -->
<refentry id="function.ob-start">
<refnamediv>
<refname>ob_start</refname>
<refpurpose>Turn on output buffering</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>ob_start</methodname>
<methodparam choice="opt"><type>callback</type><parameter>output_callback</parameter></methodparam>
@ -15,52 +15,17 @@
<methodparam choice="opt"><type>bool</type><parameter>erase</parameter></methodparam>
</methodsynopsis>
<para>
This function will turn output buffering on. While output
buffering is active no output is sent from the script (other than
headers), instead the output is stored in an internal buffer.
This function will turn output buffering on. While output buffering is
active no output is sent from the script (other than headers), instead the
output is stored in an internal buffer.
</para>
<para>
The contents of this internal buffer may be copied into a string
variable using <function>ob_get_contents</function>. To output
what is stored in the internal buffer, use
<function>ob_end_flush</function>. Alternatively,
<function>ob_end_clean</function> will silently discard the
buffer contents.
The contents of this internal buffer may be copied into a string variable
using <function>ob_get_contents</function>. To output what is stored in
the internal buffer, use <function>ob_end_flush</function>. Alternatively,
<function>ob_end_clean</function> will silently discard the buffer
contents.
</para>
<para>
An optional <parameter>output_callback</parameter> function may
be specified. This function takes a string as a parameter and
should return a string. The function will be called when
<function>ob_end_flush</function> is called, or when the output
buffer is flushed to the browser at the end of the request. When
<parameter>output_callback</parameter> is called, it will receive
the contents of the output buffer as its parameter and is
expected to return a new output buffer as a result, which will be
sent to the browser. If the <parameter>output_callback</parameter> is not
a callable function, this function will return &false;.
If the callback function has two parameters, the second parameter is filled
with a bit-field consisting of
<constant>PHP_OUTPUT_HANDLER_START</constant>,
<constant>PHP_OUTPUT_HANDLER_CONT</constant> and
<constant>PHP_OUTPUT_HANDLER_END</constant>.
If <parameter>output_callback</parameter> returns &false; original input
is sent to the browser.
</para>
<note>
<para>
In PHP 4.0.4, <function>ob_gzhandler</function> was introduced
to facilitate sending gz-encoded data to web browsers that
support compressed web pages. <function>ob_gzhandler</function>
determines what type of content encoding the browser will accept
and will return its output accordingly.
</para>
</note>
<note>
<para>
Before PHP 4.3.2 this function did not return &false; in case the passed
<parameter>output_callback</parameter> can not be executed.
</para>
</note>
<warning>
<para>
Some web servers (e.g. Apache) change the working directory of a script
@ -69,17 +34,6 @@
callback function.
</para>
</warning>
<para>
If the optional parameter <parameter>chunk_size</parameter> is passed, the
callback function is called on every first newline after
<parameter>chunk_size</parameter> bytes of output.
The <parameter>output_callback</parameter> parameter may be bypassed by
passing a &null; value.
</para>
<para>
If the optional parameter <parameter>erase</parameter> is set to &false;,
the buffer will not be deleted until the script finishes (as of PHP 4.3.0).
</para>
<para>
Output buffers are stackable, that is, you may call
<function>ob_start</function> while another
@ -89,19 +43,122 @@
functions are active, output is being filtered sequentially
through each of them in nesting order.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<function>ob_end_clean</function>,
<function>ob_end_flush</function>, <function>ob_clean</function>,
<function>ob_flush</function> and <function>ob_start</function>
may not be called from a callback function. If you call them from
callback function, the behavior is undefined. If you would like to
delete the contents of a buffer, return "" (a null string) from callback
function.
You can't even call functions using the output buffering functions like
<literal>print_r($expression, true)</literal> or
<literal>highlight_file($filename, true)</literal> from a callback
function.
<variablelist>
<varlistentry>
<term><parameter>output_callback</parameter></term>
<listitem>
<para>
An optional <parameter>output_callback</parameter> function may be
specified. This function takes a string as a parameter and should
return a string. The function will be called when
<function>ob_end_flush</function> is called, or when the output buffer
is flushed to the browser at the end of the request. When
<parameter>output_callback</parameter> is called, it will receive the
contents of the output buffer as its parameter and is expected to
return a new output buffer as a result, which will be sent to the
browser. If the <parameter>output_callback</parameter> is not a
callable function, this function will return &false;.
</para>
<para>
If the callback function has two parameters, the second parameter is
filled with a bit-field consisting of
<constant>PHP_OUTPUT_HANDLER_START</constant>,
<constant>PHP_OUTPUT_HANDLER_CONT</constant> and
<constant>PHP_OUTPUT_HANDLER_END</constant>.
</para>
<para>
If <parameter>output_callback</parameter> returns &false; original
input is sent to the browser.
</para>
<para>
The <parameter>output_callback</parameter> parameter may be bypassed
by passing a &null; value.
</para>
<para>
<function>ob_end_clean</function>, <function>ob_end_flush</function>,
<function>ob_clean</function>, <function>ob_flush</function> and
<function>ob_start</function> may not be called from a callback
function. If you call them from callback function, the behavior is
undefined. If you would like to delete the contents of a buffer,
return "" (a null string) from callback function.
You can't even call functions using the output buffering functions like
<literal>print_r($expression, true)</literal> or
<literal>highlight_file($filename, true)</literal> from a callback
function.
</para>
<note>
<para>
In PHP 4.0.4, <function>ob_gzhandler</function> was introduced to
facilitate sending gz-encoded data to web browsers that support
compressed web pages. <function>ob_gzhandler</function> determines
what type of content encoding the browser will accept and will return
its output accordingly.
</para>
</note>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>chunk_size</parameter></term>
<listitem>
<para>
If the optional parameter <parameter>chunk_size</parameter> is passed, the
callback function is called on every first newline after
<parameter>chunk_size</parameter> bytes of output.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>erase</parameter></term>
<listitem>
<para>
If the optional parameter <parameter>erase</parameter> is set to &false;,
the buffer will not be deleted until the script finishes (as of PHP 4.3.0).
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>4.3.2</entry>
<entry>
This function was changed to return &false; in case the passed
<parameter>output_callback</parameter> can not be executed.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>User defined callback function example</title>
@ -130,9 +187,7 @@ ob_end_flush();
?>
]]>
</programlisting>
<para>
Would produce:
</para>
&example.outputs;
<screen>
<![CDATA[
<html>
@ -144,16 +199,24 @@ ob_end_flush();
</screen>
</example>
</para>
<para>
See also <function>ob_get_contents</function>,
<function>ob_end_flush</function>,
<function>ob_end_clean</function>,
<function>ob_implicit_flush</function>,
<function>ob_gzhandler</function>, <function>ob_iconv_handler</function>
<function>mb_output_handler</function>, and
<function>ob_tidyhandler</function>.
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>ob_get_contents</function></member>
<member><function>ob_end_clean</function></member>
<member><function>ob_end_flush</function></member>
<member><function>ob_implicit_flush</function></member>
<member><function>ob_gzhandler</function></member>
<member><function>ob_iconv_handler</function></member>
<member><function>mb_output_handler</function></member>
<member><function>ob_tidyhandler</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file

View file

@ -1,12 +1,13 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.10 $ -->
<!-- $Revision: 1.11 $ -->
<refentry id="function.output-add-rewrite-var">
<refnamediv>
<refname>output_add_rewrite_var</refname>
<refpurpose>Add URL rewriter values</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>output_add_rewrite_var</methodname>
<methodparam><type>string</type><parameter>name</parameter></methodparam>
@ -31,6 +32,41 @@
not active already.
</simpara>
</note>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>name</parameter></term>
<listitem>
<para>
The variable name.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>value</parameter></term>
<listitem>
<para>
The variable value.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>output_add_rewrite_var</function> example</title>
@ -71,13 +107,19 @@ Array
</screen>
</example>
</para>
<para>
See also
<function>output_reset_rewrite_vars</function>,
<function>ob_flush</function> and
<function>ob_list_handlers</function>.
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>output_reset_rewrite_vars</function></member>
<member><function>ob_flush</function></member>
<member><function>ob_list_handlers</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file

View file

@ -1,12 +1,13 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.7 $ -->
<!-- $Revision: 1.8 $ -->
<refentry id="function.output-reset-rewrite-vars">
<refnamediv>
<refname>output_reset_rewrite_vars</refname>
<refpurpose>Reset URL rewriter values</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>bool</type><methodname>output_reset_rewrite_vars</methodname>
<void/>
@ -17,6 +18,17 @@
function or the session mechanism (if <literal>session.use_trans_sid</literal>
was set on <function>session_start</function>).
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success;
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>output_reset_rewrite_vars</function> example</title>
@ -43,14 +55,20 @@ echo '<a href="file.php">link</a>';
</screen>
</example>
</para>
<para>
See also
<function>output_add_rewrite_var</function>,
<function>ob_flush</function>,
<function>ob_list_handlers</function> and
<function>session_start</function>.
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>output_add_rewrite_var</function></member>
<member><function>ob_flush</function></member>
<member><function>ob_list_handlers</function></member>
<member><function>session_start</function></member>
</simplelist>
</para>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file