reference/zlib/functions/gzencode.xml
f9c4a68ef4f89e51e6d9b905ad3ddb6492386dd3
...
...
@@ -9,10 +9,10 @@
9
9
<refsect1 role="description">
10
10
&reftitle.description;
11
11
<methodsynopsis>
12
-
<type>string</type><methodname>gzencode</methodname>
12
+
<type class="union"><type>string</type><type>false</type></type><methodname>gzencode</methodname>
13
13
<methodparam><type>string</type><parameter>data</parameter></methodparam>
14
14
<methodparam choice="opt"><type>int</type><parameter>level</parameter><initializer>-1</initializer></methodparam>
15
-
<methodparam choice="opt"><type>int</type><parameter>encoding_mode</parameter><initializer>FORCE_GZIP</initializer></methodparam>
15
+
<methodparam choice="opt"><type>int</type><parameter>encoding</parameter><initializer><constant>ZLIB_ENCODING_GZIP</constant></initializer></methodparam>
16
16
</methodsynopsis>
17
17
<para>
18
18
This function returns a compressed version of the input
...
...
@@ -49,19 +49,14 @@
49
49
</listitem>
50
50
</varlistentry>
51
51
<varlistentry>
52
-
<term><parameter>encoding_mode</parameter></term>
52
+
<term><parameter>encoding</parameter></term>
53
53
<listitem>
54
54
<para>
55
55
The encoding mode. Can be <constant>FORCE_GZIP</constant> (the default)
56
56
or <constant>FORCE_DEFLATE</constant>.
57
57
</para>
58
58
<para>
59
-
Prior to PHP 5.4.0, using <constant>FORCE_DEFLATE</constant> results in
60
-
a standard zlib deflated string (inclusive zlib headers) after a gzip
61
-
file header but without the trailing crc32 checksum.
62
-
</para>
63
-
<para>
64
-
In PHP 5.4.0 and later, <constant>FORCE_DEFLATE</constant> generates
59
+
<constant>FORCE_DEFLATE</constant> generates
65
60
RFC 1950 compliant output, consisting of a zlib header, the deflated
66
61
data, and an Adler checksum.
67
62
</para>
...
...
@@ -88,11 +83,9 @@
88
83
<programlisting role="php">
89
84
<![CDATA[
90
85
<?php
91
-
$data = implode("", file("bigfile.txt"));
86
+
$data = file_get_contents("bigfile.txt");
92
87
$gzdata = gzencode($data, 9);
93
-
$fp = fopen("bigfile.txt.gz", "w");
94
-
fwrite($fp, $gzdata);
95
-
fclose($fp);
88
+
file_put_contents("bigfile.txt.gz", $gzdata);
96
89
?>
97
90
]]>
98
91
</programlisting>
...
...
@@ -119,7 +112,6 @@ fclose($fp);
119
112
</refsect1>
120
113

121
114
</refentry>
122
-

123
115
<!-- Keep this comment at the end of the file
124
116
Local variables:
125
117
mode: sgml
126
118