diff --git a/reference/zlib/book.xml b/reference/zlib/book.xml new file mode 100644 index 0000000000..9168eeb667 --- /dev/null +++ b/reference/zlib/book.xml @@ -0,0 +1,69 @@ + + + + + + + Zlib + + + + &reftitle.intro; + + This module enables you to transparently read and write + gzip (.gz) compressed files, through versions of most of + the filesystem functions + which work with gzip-compressed files (and uncompressed files, + too, but not with sockets). + + + + Version 4.0.4 introduced a fopen-wrapper for .gz-files, so that + you can use a special zlib: URL to access + compressed files transparently using the normal f*() file access + functions if you prefix the filename or path with + zlib: when calling fopen. This + feature requires a C runtime library that provides the + fopencookie() function. Up to now the GNU libc + seems to be the only library that provides this feature. + + + In PHP 4.3.0, zlib: has been changed to + compress.zlib:// to prevent ambiguities with + filenames containing ':' characters. The + fopencookie() function is not longer required. + More information is available in the section about + . + + + + + + &reference.zlib.setup; + &reference.zlib.constants; + &reference.zlib.examples; + &reference.zlib.reference; + + + + + diff --git a/reference/zlib/constants.xml b/reference/zlib/constants.xml index aa1470f108..beaf8fbde7 100644 --- a/reference/zlib/constants.xml +++ b/reference/zlib/constants.xml @@ -1,6 +1,6 @@ - -
+ + &reftitle.constants; &extension.constants; @@ -27,7 +27,7 @@ -
+ + + + &reftitle.examples; + + This example opens a temporary file and writes a test string + to it, then it prints out the content of this file twice. + + + Small Zlib Example + +\n\n\n
\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 "
\n\n\n"; + +?> +]]> +
+
+
+ + + + diff --git a/reference/zlib/reference.xml b/reference/zlib/reference.xml index 7d1be1e174..a679762ec2 100644 --- a/reference/zlib/reference.xml +++ b/reference/zlib/reference.xml @@ -1,121 +1,13 @@ - - - + - - Zlib Compression Functions - Zlib + + Zlib Compression &Functions; - -
- &reftitle.intro; - - This module enables you to transparently read and write - gzip (.gz) compressed files, through versions of most of - the filesystem functions - which work with gzip-compressed files (and uncompressed files, - too, but not with sockets). - - - - Version 4.0.4 introduced a fopen-wrapper for .gz-files, so that - you can use a special zlib: URL to access - compressed files transparently using the normal f*() file access - functions if you prefix the filename or path with - zlib: when calling fopen. This - feature requires a C runtime library that provides the - fopencookie() function. Up to now the GNU libc - seems to be the only library that provides this feature. - - - In PHP 4.3.0, zlib: has been changed to - compress.zlib:// to prevent ambiguities with - filenames containing ':' characters. The - fopencookie() function is not longer required. - More information is available in the section about - . - - -
+ &reference.zlib.entities.functions; -
- &reftitle.required; - - This module uses the functions of zlib - by Jean-loup Gailly and Mark Adler. You have to use a zlib - version >= 1.0.9 with this module. - -
+
- &reference.zlib.configure; - - &reference.zlib.ini; - -
- &reftitle.resources; - - This extension defines a file pointer resource returned by - gzopen. - -
- - &reference.zlib.constants; - -
- &reftitle.examples; - - This example opens a temporary file and writes a test string - to it, then it prints out the content of this file twice. - - - Small Zlib Example - -\n\n\n
\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 "
\n\n\n"; - -?> -]]> -
-
-
- - -&reference.zlib.entities.functions; - -
+ + + &reftitle.setup; + + +
+ &reftitle.required; + + This module uses the functions of zlib + by Jean-loup Gailly and Mark Adler. You have to use a zlib + version >= 1.0.9 with this module. + +
+ + + + &reference.zlib.configure; + + + + &reference.zlib.ini; + + + +
+ &reftitle.resources; + + This extension defines a file pointer resource returned by + gzopen. + +
+ + +
+ + +