1
0
mirror of https://github.com/php/doc-en.git synced 2026-03-23 23:32:18 +01:00

bzip2 : fix XML by converting para to simpara tags via script

This commit is contained in:
Gina Peter Banyard
2026-01-25 15:08:45 +00:00
parent b621a6e473
commit 5fdeb11b13
14 changed files with 95 additions and 105 deletions

View File

@@ -1,17 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<book xml:id="book.bzip2" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<book xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="book.bzip2">
<?phpdoc extension-membership="bundledexternal" ?>
<title>Bzip2</title>
<!-- {{{ preface -->
<preface xml:id="intro.bzip2">
&reftitle.intro;
<para>
<simpara>
The bzip2 functions are used to transparently read and write bzip2 (.bz2)
compressed files.
</para>
</simpara>
</preface>
<!-- }}} -->
@@ -20,7 +19,6 @@
&reference.bzip2.reference;
</book>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
@@ -41,4 +39,3 @@ vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View File

@@ -1,14 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<section xml:id="bzip2.installation" xmlns="http://docbook.org/ns/docbook">
<section xmlns="http://docbook.org/ns/docbook" xml:id="bzip2.installation">
&reftitle.install;
<para>
<simpara>
<acronym>Bzip2</acronym> support in PHP is not enabled by default. You will
need to use the <option role="configure">--with-bz2[=DIR]</option>
configuration option when compiling PHP to enable bzip2 support.
</para>
</simpara>
</section>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

View File

@@ -1,12 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<chapter xml:id="bzip2.examples" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="bzip2.examples">
&reftitle.examples;
<para>
<simpara>
This example opens a temporary file and writes a test string to
it, then prints out the contents of the file.
</para>
</simpara>
<example>
<title>Small bzip2 Example</title>
<programlisting role="php">
@@ -31,7 +30,7 @@ $bz = bzopen($filename, "r");
// read 10 characters
echo bzread($bz, 10);
// output until end of the file (or the next 1024 char) and close it.
// output until end of the file (or the next 1024 char) and close it.
echo bzread($bz);
bzclose($bz);
@@ -41,7 +40,6 @@ bzclose($bz);
</programlisting>
</example>
</chapter>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
@@ -62,4 +60,3 @@ vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View File

@@ -11,9 +11,9 @@
<type>bool</type><methodname>bzclose</methodname>
<methodparam><type>resource</type><parameter>bz</parameter></methodparam>
</methodsynopsis>
<para>
<simpara>
Closes the given bzip2 file pointer.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
@@ -21,19 +21,19 @@
<varlistentry>
<term><parameter>bz</parameter></term>
<listitem>
<para>
<simpara>
The file pointer. It must be valid and must point to a file
successfully opened by <function>bzopen</function>.
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
&return.success;
</para>
</simpara>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;

View File

@@ -13,10 +13,10 @@
<methodparam choice="opt"><type>int</type><parameter>block_size</parameter><initializer>4</initializer></methodparam>
<methodparam choice="opt"><type>int</type><parameter>work_factor</parameter><initializer>0</initializer></methodparam>
</methodsynopsis>
<para>
<simpara>
<function>bzcompress</function> compresses the given string and returns
it as bzip2 encoded data.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
@@ -24,42 +24,42 @@
<varlistentry>
<term><parameter>data</parameter></term>
<listitem>
<para>
<simpara>
The string to compress.
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>block_size</parameter></term>
<listitem>
<para>
<simpara>
Specifies the blocksize used during compression and should be a number
from 1 to 9 with 9 giving the best compression, but using more
resources to do so.
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>work_factor</parameter></term>
<listitem>
<para>
<simpara>
Controls how the compression phase behaves when presented with worst
case, highly repetitive, input data. The value can be between 0 and
250 with 0 being a special case.
</para>
<para>
</simpara>
<simpara>
Regardless of the <parameter>work_factor</parameter>, the generated
output is the same.
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
The compressed string, or an error number if an error occurred.
</para>
</simpara>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;

View File

@@ -12,10 +12,10 @@
<methodparam><type>string</type><parameter>data</parameter></methodparam>
<methodparam choice="opt"><type>bool</type><parameter>use_less_memory</parameter><initializer>&false;</initializer></methodparam>
</methodsynopsis>
<para>
<simpara>
<function>bzdecompress</function> decompresses the given string containing
bzip2 encoded data.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
@@ -23,32 +23,32 @@
<varlistentry>
<term><parameter>data</parameter></term>
<listitem>
<para>
<simpara>
The string to decompress.
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>use_less_memory</parameter></term>
<listitem>
<para>
<simpara>
If &true;, an alternative decompression algorithm will be used which
uses less memory (the maximum memory requirement drops to around 2300K)
but works at roughly half the speed.
</para>
<para>
</simpara>
<simpara>
See the <link xlink:href="&url.bzip2;">bzip2 documentation</link> for more
information about this feature.
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
The decompressed string, or &false; or an error number if an error occurred.
</para>
</simpara>
</refsect1>
<refsect1 role="changelog">

View File

@@ -11,10 +11,10 @@
<type>int</type><methodname>bzerrno</methodname>
<methodparam><type>resource</type><parameter>bz</parameter></methodparam>
</methodsynopsis>
<para>
<simpara>
Returns the error number of any bzip2 error returned by the given file
pointer.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
@@ -22,19 +22,19 @@
<varlistentry>
<term><parameter>bz</parameter></term>
<listitem>
<para>
<simpara>
The file pointer. It must be valid and must point to a file
successfully opened by <function>bzopen</function>.
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
Returns the error number as an integer.
</para>
</simpara>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;

View File

@@ -13,10 +13,10 @@
<type>array</type><methodname>bzerror</methodname>
<methodparam><type>resource</type><parameter>bz</parameter></methodparam>
</methodsynopsis>
<para>
<simpara>
Returns the error number and error string of any bzip2 error returned by
the given file pointer.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
@@ -24,21 +24,21 @@
<varlistentry>
<term><parameter>bz</parameter></term>
<listitem>
<para>
<simpara>
The file pointer. It must be valid and must point to a file
successfully opened by <function>bzopen</function>.
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
Returns an associative array, with the error code in the
<literal>errno</literal> entry, and the error message in the
<literal>errstr</literal> entry.
</para>
</simpara>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;

View File

@@ -11,10 +11,10 @@
<type>string</type><methodname>bzerrstr</methodname>
<methodparam><type>resource</type><parameter>bz</parameter></methodparam>
</methodsynopsis>
<para>
<simpara>
Gets the error string of any bzip2 error returned by the given file
pointer.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
@@ -22,19 +22,19 @@
<varlistentry>
<term><parameter>bz</parameter></term>
<listitem>
<para>
<simpara>
The file pointer. It must be valid and must point to a file
successfully opened by <function>bzopen</function>.
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
Returns a string containing the error message.
</para>
</simpara>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;

View File

@@ -11,11 +11,11 @@
<type>bool</type><methodname>bzflush</methodname>
<methodparam><type>resource</type><parameter>bz</parameter></methodparam>
</methodsynopsis>
<para>
<simpara>
This function is supposed to force a write of all buffered bzip2 data for the file pointer
<parameter>bz</parameter>,
but is implemented as null function in libbz2, and as such does nothing.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
@@ -23,19 +23,19 @@
<varlistentry>
<term><parameter>bz</parameter></term>
<listitem>
<para>
<simpara>
The file pointer. It must be valid and must point to a file
successfully opened by <function>bzopen</function>.
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
&return.success;
</para>
</simpara>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;

View File

@@ -12,10 +12,10 @@
<methodparam><type class="union"><type>string</type><type>resource</type></type><parameter>file</parameter></methodparam>
<methodparam><type>string</type><parameter>mode</parameter></methodparam>
</methodsynopsis>
<para>
<simpara>
<function>bzopen</function> opens a bzip2 (<filename>.bz2</filename>) file for reading or
writing.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
@@ -23,28 +23,28 @@
<varlistentry>
<term><parameter>file</parameter></term>
<listitem>
<para>
<simpara>
The name of the file to open, or an existing stream resource.
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>mode</parameter></term>
<listitem>
<para>
<simpara>
The modes <literal>'r'</literal> (read), and <literal>'w'</literal> (write) are supported.
Everything else will cause <function>bzopen</function> to return &false;.
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
If the open fails, <function>bzopen</function> returns &false;, otherwise
it returns a pointer to the newly opened file.
</para>
</simpara>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;

View File

@@ -12,13 +12,13 @@
<methodparam><type>resource</type><parameter>bz</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>length</parameter><initializer>1024</initializer></methodparam>
</methodsynopsis>
<para>
<simpara>
<function>bzread</function> reads from the given bzip2 file pointer.
</para>
<para>
</simpara>
<simpara>
Reading stops when <parameter>length</parameter> (uncompressed) bytes have
been read or EOF is reached, whichever comes first.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
@@ -26,29 +26,29 @@
<varlistentry>
<term><parameter>bz</parameter></term>
<listitem>
<para>
<simpara>
The file pointer. It must be valid and must point to a file
successfully opened by <function>bzopen</function>.
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>length</parameter></term>
<listitem>
<para>
<simpara>
If not specified, <function>bzread</function> will read 1024
(uncompressed) bytes at a time. A maximum of 8192
uncompressed bytes will be read at a time.
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
Returns the uncompressed data, or &false; on error.
</para>
</simpara>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;

View File

@@ -13,10 +13,10 @@
<methodparam><type>string</type><parameter>data</parameter></methodparam>
<methodparam choice="opt"><type class="union"><type>int</type><type>null</type></type><parameter>length</parameter><initializer>&null;</initializer></methodparam>
</methodsynopsis>
<para>
<simpara>
<function>bzwrite</function> writes a string into the given bzip2 file
stream.
</para>
</simpara>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
@@ -24,37 +24,37 @@
<varlistentry>
<term><parameter>bz</parameter></term>
<listitem>
<para>
<simpara>
The file pointer. It must be valid and must point to a file
successfully opened by <function>bzopen</function>.
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>data</parameter></term>
<listitem>
<para>
<simpara>
The written data.
</para>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>length</parameter></term>
<listitem>
<para>
<simpara>
If supplied, writing will stop after <parameter>length</parameter>
(uncompressed) bytes have been written or the end of
<parameter>data</parameter> is reached, whichever comes first.
</para>
</simpara>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
<simpara>
Returns the number of bytes written, or &false; on error.
</para>
</simpara>
</refsect1>
<refsect1 role="changelog">

View File

@@ -1,17 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<chapter xml:id="bzip2.setup" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<chapter xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="bzip2.setup">
&reftitle.setup;
<!-- {{{ Requirements -->
<section xml:id="bzip2.requirements">
&reftitle.required;
<para>
<simpara>
This module uses the functions of the <link xlink:href="&url.bzip2;">bzip2
</link> library by Julian Seward. This module requires bzip2/libbzip2
version &gt;= 1.0.x.
</para>
</simpara>
</section>
<!-- }}} -->
@@ -22,15 +21,14 @@
<!-- {{{ Resources -->
<section xml:id="bzip2.resources">
&reftitle.resources;
<para>
<simpara>
This extension defines one resource type: a file pointer identifying
the bz2-file to work on.
</para>
</simpara>
</section>
<!-- }}} -->
</chapter>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
@@ -51,4 +49,3 @@ vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->