mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-03-24 17:02:18 +01:00
137 lines
4.1 KiB
XML
137 lines
4.1 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: f9c4a68ef4f89e51e6d9b905ad3ddb6492386dd3 Maintainer: yannick Status: ready -->
|
|
<!-- Reviewed: yes -->
|
|
<refentry xml:id="function.gzencode" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
<refnamediv>
|
|
<refname>gzencode</refname>
|
|
<refpurpose>Crée une chaîne compressée gzip</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type class="union"><type>string</type><type>false</type></type><methodname>gzencode</methodname>
|
|
<methodparam><type>string</type><parameter>data</parameter></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>level</parameter><initializer>-1</initializer></methodparam>
|
|
<methodparam choice="opt"><type>int</type><parameter>encoding</parameter><initializer><constant>ZLIB_ENCODING_GZIP</constant></initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>gzencode</function> retourne la version compressée de la chaîne
|
|
<parameter>data</parameter> compatible avec la sortie du programme
|
|
<command>gzip</command>.
|
|
</para>
|
|
<para>
|
|
Pour plus de détails sur l'algorithme, lisez le document
|
|
<link xlink:href="&url.rfc;1952"><literal>"ZLIB Compressed Data Format
|
|
Specification version 4.3"</literal></link> (RFC 1952).
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>data</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Les données à encoder.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>level</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Le degré de compression. 0 signifie aucune compression, jusqu'à 9
|
|
pour une compression maximale. Si omis, le degré de compression par défaut
|
|
sera celui de la bibliothèque zlib.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>encoding</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
Le mode d'encodage. Peut être <constant>FORCE_GZIP</constant> (par défaut)
|
|
ou <constant>FORCE_DEFLATE</constant>.
|
|
</para>
|
|
<para>
|
|
<constant>FORCE_DEFLATE</constant> génère
|
|
un affichage conforme à la RFC 1950, contenant un en-tête zlib,
|
|
les données standard, et une somme de vérification Adler.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
La chaîne encodée ou &false; si une erreur survient.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
Les données résultantes contiennent les en-têtes appropriés ainsi que la
|
|
structure de données pour faire un fichier .gz standard, e.g. :
|
|
<example>
|
|
<title>Création d'un fichier gzip</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
$data = file_get_contents("bigfile.txt");
|
|
$gzdata = gzencode($data, 9);
|
|
file_put_contents("bigfile.txt.gz", $gzdata);
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>gzdecode</function></member>
|
|
<member><function>gzdeflate</function></member>
|
|
<member><function>gzinflate</function></member>
|
|
<member><function>gzuncompress</function></member>
|
|
<member><function>gzcompress</function></member>
|
|
<member>
|
|
<link xlink:href="&url.rfc;1950">
|
|
Spécification du format de données compressées ZLIB (RFC 1950)
|
|
</link>
|
|
</member>
|
|
</simplelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
</refentry>
|
|
<!-- 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:"~/.phpdoc/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
|
|
-->
|