Files
doc-fr/reference/phar/Phar/isBuffering.xml
2021-06-12 07:27:28 +01:00

123 lines
2.9 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: f5a5f5ae75cf140bd3dd65da52b70f6236b0e131 Maintainer: yannick Status: ready -->
<!-- Reviewed: no -->
<refentry xmlns="http://docbook.org/ns/docbook" xml:id="phar.isbuffering">
<refnamediv>
<refname>Phar::isBuffering</refname>
<refpurpose>Détermine si les opérations d'écriture du Phar sont mises en tampons ou sont directement inscrites sur le disque</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>bool</type><methodname>Phar::isBuffering</methodname>
<void/>
</methodsynopsis>
<para>
Cette méthode peut être utilisée pour déterminer si un Phar sauvera ses changements
immédiatement sur le disque ou si un appel à la fonction <function>Phar::stopBuffering</function>
est nécessaire pour inscrire les modifications.
</para>
<para>
La mise en tampon de l'écriture du Phar se fait par archive; la mise en tampon de
l'archive Phar<literal>foo.phar</literal> n'affecte en rien les changements faits sur
l'archive Phar <literal>bar.phar</literal>.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
&no.function.parameters;
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
Retourne &true; si les opérations d'écriture sont mises en tampons,
&false; sinon.
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Un exemple avec <function>Phar::isBuffering</function></title>
<para>
</para>
<programlisting role="php">
<![CDATA[
<?php
$p = new Phar(dirname(__FILE__) . '/nouveauphar.phar', 0, 'nouveauphar.phar');
$p2 = new Phar('pharexistant.phar');
$p['fichier1.txt'] = 'salut';
var_dump($p->isBuffering());
var_dump($p2->isBuffering());
?>
=2=
<?php
$p->startBuffering();
var_dump($p->isBuffering());
var_dump($p2->isBuffering());
$p->stopBuffering();
?>
=3=
<?php
var_dump($p->isBuffering());
var_dump($p2->isBuffering());
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
bool(false)
bool(false)
=2=
bool(true)
bool(false)
=3=
bool(false)
bool(false)
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>Phar::startBuffering</function></member>
<member><function>Phar::stopBuffering</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
-->