MFB: Upgrade to the new-reference-structure

- Split reference.xml into book.xml and setup.xml
- Moved from reference.xml to book.xml:
  - The intro text (partintro), and link to constants and the new examples page
- Moved from reference.xml to setup.xml:
  - The rest: requirements, installation, configuration, and resources
- Changed the constants section to be an <appendix>
- Changed the intro ID from <extname>.intro to intro.<extname>


git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@248201 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Philip Olson 2007-12-14 00:56:49 +00:00
parent 8203da51cf
commit 2c1f946927
5 changed files with 210 additions and 116 deletions

69
reference/zlib/book.xml Normal file
View file

@ -0,0 +1,69 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.2 $ -->
<!-- Purpose: compression -->
<!-- Membership: bundled -->
<book xml:id="book.zlib" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Zlib</title>
<!-- {{{ preface -->
<preface xml:id="intro.zlib">
&reftitle.intro;
<para>
This module enables you to transparently read and write
gzip (.gz) compressed files, through versions of most of
the <link linkend="book.filesystem">filesystem</link> functions
which work with gzip-compressed files (and uncompressed files,
too, but not with sockets).
</para>
<note>
<para>
Version 4.0.4 introduced a fopen-wrapper for .gz-files, so that
you can use a special <filename>zlib:</filename> URL to access
compressed files transparently using the normal f*() file access
functions if you prefix the filename or path with
<filename>zlib:</filename> when calling <function>fopen</function>. This
feature requires a C runtime library that provides the
<literal>fopencookie()</literal> function. Up to now the GNU libc
seems to be the only library that provides this feature.
</para>
<para>
In PHP 4.3.0, <filename>zlib:</filename> has been changed to
<filename>compress.zlib://</filename> to prevent ambiguities with
filenames containing ':' characters. The
<literal>fopencookie()</literal> function is not longer required.
More information is available in the section about
<xref linkend="wrappers.compression" />.
</para>
</note>
</preface>
<!-- }}} -->
&reference.zlib.setup;
&reference.zlib.constants;
&reference.zlib.examples;
&reference.zlib.reference;
</book>
<!-- 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
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.6 $ -->
<section xml:id="zlib.constants" xmlns="http://docbook.org/ns/docbook">
<!-- $Revision: 1.7 $ -->
<appendix xml:id="zlib.constants" xmlns="http://docbook.org/ns/docbook">
&reftitle.constants;
&extension.constants;
<variablelist>
@ -27,7 +27,7 @@
</listitem>
</varlistentry>
</variablelist>
</section>
</appendix>
<!-- Keep this comment at the end of the file
Local variables:

View file

@ -0,0 +1,75 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<chapter xml:id="zlib.examples" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
&reftitle.examples;
<para>
This example opens a temporary file and writes a test string
to it, then it prints out the content of this file twice.
</para>
<example>
<title>Small Zlib Example</title>
<programlisting role="php">
<![CDATA[
<?php
$filename = tempnam('/tmp', 'zlibtest') . '.gz';
echo "<html>\n<head></head>\n<body>\n<pre>\n";
$s = "Only a test, test, test, test, test, test, test, test!\n";
// open file for writing with maximum compression
$zp = gzopen($filename, "w9");
// write string to file
gzwrite($zp, $s);
// close file
gzclose($zp);
// open file for reading
$zp = gzopen($filename, "r");
// read 3 char
echo gzread($zp, 3);
// output until end of the file and close it.
gzpassthru($zp);
gzclose($zp);
echo "\n";
// open file and print content (the 2nd time).
if (readgzfile($filename) != strlen($s)) {
echo "Error with zlib functions!";
}
unlink($filename);
echo "</pre>\n</body>\n</html>\n";
?>
]]>
</programlisting>
</example>
</chapter>
<!-- 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
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->

View file

@ -1,121 +1,13 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.19 $ -->
<!-- Purpose: compression -->
<!-- Membership: bundled -->
<!-- $Revision: 1.20 $ -->
<reference xml:id="ref.zlib" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Zlib Compression Functions</title>
<titleabbrev>Zlib</titleabbrev>
<reference xml:id="ref.zlib" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<title>Zlib Compression &Functions;</title>
<partintro>
<section xml:id="zlib.intro">
&reftitle.intro;
<para>
This module enables you to transparently read and write
gzip (.gz) compressed files, through versions of most of
the <link linkend="ref.filesystem">filesystem</link> functions
which work with gzip-compressed files (and uncompressed files,
too, but not with sockets).
</para>
<note>
<para>
Version 4.0.4 introduced a fopen-wrapper for .gz-files, so that
you can use a special <filename>zlib:</filename> URL to access
compressed files transparently using the normal f*() file access
functions if you prefix the filename or path with
<filename>zlib:</filename> when calling <function>fopen</function>. This
feature requires a C runtime library that provides the
<literal>fopencookie()</literal> function. Up to now the GNU libc
seems to be the only library that provides this feature.
</para>
<para>
In PHP 4.3.0, <filename>zlib:</filename> has been changed to
<filename>compress.zlib://</filename> to prevent ambiguities with
filenames containing ':' characters. The
<literal>fopencookie()</literal> function is not longer required.
More information is available in the section about
<xref linkend="wrappers.compression" />.
</para>
</note>
</section>
&reference.zlib.entities.functions;
<section xml:id="zlib.requirements">
&reftitle.required;
<para>
This module uses the functions of <link xlink:href="&url.zlib;">zlib</link>
by Jean-loup Gailly and Mark Adler. You have to use a zlib
version &gt;= 1.0.9 with this module.
</para>
</section>
</reference>
&reference.zlib.configure;
&reference.zlib.ini;
<section xml:id="zlib.resources">
&reftitle.resources;
<para>
This extension defines a file pointer resource returned by
<function>gzopen</function>.
</para>
</section>
&reference.zlib.constants;
<section xml:id="zlib.examples">
&reftitle.examples;
<para>
This example opens a temporary file and writes a test string
to it, then it prints out the content of this file twice.
</para>
<example>
<title>Small Zlib Example</title>
<programlisting role="php">
<![CDATA[
<?php
$filename = tempnam('/tmp', 'zlibtest') . '.gz';
echo "<html>\n<head></head>\n<body>\n<pre>\n";
$s = "Only a test, test, test, test, test, test, test, test!\n";
// open file for writing with maximum compression
$zp = gzopen($filename, "w9");
// write string to file
gzwrite($zp, $s);
// close file
gzclose($zp);
// open file for reading
$zp = gzopen($filename, "r");
// read 3 char
echo gzread($zp, 3);
// output until end of the file and close it.
gzpassthru($zp);
gzclose($zp);
echo "\n";
// open file and print content (the 2nd time).
if (readgzfile($filename) != strlen($s)) {
echo "Error with zlib functions!";
}
unlink($filename);
echo "</pre>\n</body>\n</html>\n";
?>
]]>
</programlisting>
</example>
</section>
</partintro>
&reference.zlib.entities.functions;
</reference>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml

58
reference/zlib/setup.xml Normal file
View file

@ -0,0 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision: 1.2 $ -->
<chapter xml:id="zlib.setup" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
&reftitle.setup;
<!-- {{{ Requirements -->
<section xml:id="zlib.requirements">
&reftitle.required;
<para>
This module uses the functions of <link xlink:href="&url.zlib;">zlib</link>
by Jean-loup Gailly and Mark Adler. You have to use a zlib
version &gt;= 1.0.9 with this module.
</para>
</section>
<!-- }}} -->
<!-- {{{ Installation -->
&reference.zlib.configure;
<!-- }}} -->
<!-- {{{ Configuration -->
&reference.zlib.ini;
<!-- }}} -->
<!-- {{{ Resources -->
<section xml:id="zlib.resources">
&reftitle.resources;
<para>
This extension defines a file pointer resource returned by
<function>gzopen</function>.
</para>
</section>
<!-- }}} -->
</chapter>
<!-- 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
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->