mirror of
https://github.com/macintoshplus/doc-fr.git
synced 2026-03-25 17:32:07 +01:00
134 lines
4.2 KiB
XML
134 lines
4.2 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: 8c2f58a7deadc3fe0b39855049e0122e7588293e Maintainer: gui Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
|
|
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="pharfileinfo.compress">
|
|
<refnamediv>
|
|
<refname>PharFileInfo::compress</refname>
|
|
<refpurpose>Compresse l'entrée Phar courante avec une des compressions zlib ou bzip2</refpurpose>
|
|
</refnamediv>
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<modifier>public</modifier> <type>bool</type><methodname>PharFileInfo::compress</methodname>
|
|
<methodparam><type>int</type><parameter>compression</parameter></methodparam>
|
|
</methodsynopsis>
|
|
|
|
<para>
|
|
Cette méthode compresse le fichier au sein de l'archive Phar en utilisant l'une des compressions
|
|
bzip2 ou zlib. Les extensions <link linkend="ref.bzip2">bzip2</link> ou <link linkend="ref.zlib">zlib</link>
|
|
doivent être activées pour tirer parti de cette fonctionnalité. De plus, si le fichier est déjà compressé,
|
|
l'extension adéquate doit être activée pour le décompresser. Comme avec toutes les fonctionnalités qui
|
|
modifient le contenu d'un phar, la variable INI <link linkend="ini.phar.readonly">phar.readonly</link>
|
|
doit être à off pour réussir si le fichier est au sein d'une archive <classname>Phar</classname>.
|
|
Les fichiers au sein d'archives <classname>PharData</classname> n'ont pas cette restriction.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>compression</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
La compression doit être <constant>Phar::GZ</constant> ou <constant>Phar::BZ2</constant>.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
&return.success;
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="errors">
|
|
&reftitle.errors;
|
|
<para>
|
|
Soulève une exception <classname>BadMethodCallException</classname> si la variable INI
|
|
<link linkend="ini.phar.readonly">phar.readonly</link> est à on, ou si l'extension
|
|
<link linkend="ref.bzip2">bzip2</link>/<link linkend="ref.zlib">zlib</link> n'est pas
|
|
disponible.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Un exemple avec <function>PharFileInfo::compress</function></title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
try {
|
|
$p = new Phar('/chemin/vers/mon.phar', 0, 'mon.phar');
|
|
$p['monfichier.txt'] = 'salut';
|
|
$file = $p['monfichier.txt'];
|
|
var_dump($file->isCompressed(Phar::BZ2));
|
|
$p['monfichier.txt']->compress(Phar::BZ2);
|
|
var_dump($file->isCompressed(Phar::BZ2));
|
|
} catch (Exception $e) {
|
|
echo 'Ne peut pas créer/modifier mon.phar : ', $e;
|
|
}
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
bool(false)
|
|
bool(true)
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>PharFileInfo::getCompressedSize</function></member>
|
|
<member><function>PharFileInfo::isCompressed</function></member>
|
|
<member><function>PharFileInfo::decompress</function></member>
|
|
<member><function>Phar::canCompress</function></member>
|
|
<member><function>Phar::isCompressed</function></member>
|
|
<member><function>Phar::compressFiles</function></member>
|
|
<member><function>Phar::decompressFiles</function></member>
|
|
<member><function>Phar::compress</function></member>
|
|
<member><function>Phar::decompress</function></member>
|
|
<member><function>Phar::getSupportedCompression</function></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
|
|
-->
|