<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.phar.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'fr',
  ),
  'this' => 
  array (
    0 => 'phar.stopbuffering.php',
    1 => 'Phar::stopBuffering',
    2 => 'Arr&ecirc;te la mise en tampon des &eacute;critures Phar et provoque l\'&eacute;criture sur le disque',
  ),
  'up' => 
  array (
    0 => 'class.phar.php',
    1 => 'Phar',
  ),
  'prev' => 
  array (
    0 => 'phar.startbuffering.php',
    1 => 'Phar::startBuffering',
  ),
  'next' => 
  array (
    0 => 'phar.unlinkarchive.php',
    1 => 'Phar::unlinkArchive',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/phar/Phar/stopBuffering.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="phar.stopbuffering" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Phar::stopBuffering</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.3.0, PHP 7, PHP 8, PECL phar &gt;= 1.0.0)</p><p class="refpurpose"><span class="refname">Phar::stopBuffering</span> &mdash; <span class="dc-title">Arrête la mise en tampon des écritures Phar et provoque l&#039;écriture sur le disque</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-phar.stopbuffering-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>Phar::stopBuffering</strong></span>(): <span class="type"><a href="language.types.void.php" class="type void">void</a></span></div>


  <p class="para rdfs-comment">
   <span class="function"><strong>Phar::stopBuffering()</strong></span> est utilisée en conjonction avec la méthode
   <span class="function"><a href="phar.startbuffering.php" class="function">Phar::startBuffering()</a></span>. <span class="function"><a href="phar.startbuffering.php" class="function">Phar::startBuffering()</a></span>
   peut fournir un gain de performance lors de la création ou la modification d&#039;une archive
   Phar avec un grand nombre de fichiers. D&#039;ordinaire, chaque fois qu&#039;un fichier au sein de 
   l&#039;archive Phar est créé ou modifié, l&#039;archive Phar entière est recréée en incluant les
   changements. De cette manière, l&#039;archive sera toujours à jour vis à vis des opérations qui
   y sont appliquées.
  </p>
  <p class="para">
   Alors que ceci peut paraître inutile lors de la création d&#039;une archive Phar simple,
   ça prend tout son sens lors de l&#039;écriture en une fois de l&#039;archive Phar entière.
   De même, il est souvent nécessaire de faire une série de changements et de s&#039;assurer
   qu&#039;ils sont tous possibles avant d&#039;écrire sur le disque, un peu comme les transactions
   des bases de données relationnelles. Les fonctions
   <span class="function"><a href="phar.startbuffering.php" class="function">Phar::startBuffering()</a></span>/<span class="function"><strong>Phar::stopBuffering()</strong></span> sont disponibles
   dans ce but.
  </p>
  <p class="para">
   La mise en tampon Phar s&#039;effectue par archive, le tampon actif pour l&#039;archive Phar
   <code class="literal">foo.phar</code> n&#039;affecte pas les changements faits à l&#039;archive Phar 
   <code class="literal">bar.phar</code>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-phar.stopbuffering-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <p class="para">Cette fonction ne contient aucun paramètre.</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-phar.stopbuffering-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   Aucune valeur n&#039;est retournée.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-phar.stopbuffering-errors">
  <h3 class="title">Erreurs / Exceptions</h3>
  <p class="para">
   Une exception <span class="classname"><a href="class.pharexception.php" class="classname">PharException</a></span> est levée si des problèmes sont rencontrés lors
   de l&#039;écriture des changements sur le disque.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-phar.stopbuffering-examples">
  <h3 class="title">Exemples</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Exemple #1 Un exemple <span class="function"><strong>Phar::stopBuffering()</strong></span></strong></p>
    <div class="example-contents"><p>
    </p></div>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$p </span><span style="color: #007700">= new </span><span style="color: #0000BB">Phar</span><span style="color: #007700">(</span><span style="color: #0000BB">dirname</span><span style="color: #007700">(</span><span style="color: #0000BB">__FILE__</span><span style="color: #007700">) . </span><span style="color: #DD0000">'/nouveau.phar'</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">, </span><span style="color: #DD0000">'nouveau.phar'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$p</span><span style="color: #007700">[</span><span style="color: #DD0000">'fichier1.txt'</span><span style="color: #007700">] = </span><span style="color: #DD0000">'salut'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$p</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">startBuffering</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$p</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getStub</span><span style="color: #007700">());<br /></span><span style="color: #0000BB">$p</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setStub</span><span style="color: #007700">(</span><span style="color: #DD0000">"&lt;?php<br />function __autoload(\$class)<br />{<br />    include 'phar://nouveau.phar/' . str_replace('_', '/', \$class) . '.php';<br />}<br />Phar::mapPhar('nouveau.phar');<br />include 'phar://nouveau.phar/demarrage.php';<br />__HALT_COMPILER();"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$p</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">stopBuffering</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$p</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getStub</span><span style="color: #007700">());<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
    </div>

    <div class="example-contents"><p>L&#039;exemple ci-dessus va afficher :</p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">string(24) &quot;&lt;?php __HALT_COMPILER();&quot;
string(195) &quot;&lt;?php
function __autoload($class)
{
    include &#039;phar://&#039; . str_replace(&#039;_&#039;, &#039;/&#039;, $class);
}
Phar::mapPhar(&#039;nouveau.phar&#039;);
include &#039;phar://nouveau.phar/demarrage.php&#039;;
__HALT_COMPILER();&quot;</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-phar.stopbuffering-seealso">
  <h3 class="title">Voir aussi</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="phar.startbuffering.php" class="function" rel="rdfs-seeAlso">Phar::startBuffering()</a> - D&eacute;marre la mise en tampon d'&eacute;critures Phar, ne modifie pas l'objet Phar sur le disque</span></li>
    <li><span class="function"><a href="phar.isbuffering.php" class="function" rel="rdfs-seeAlso">Phar::isBuffering()</a> - D&eacute;termine si les op&eacute;rations d'&eacute;criture du Phar sont mises en tampons ou sont directement inscrites sur le disque</span></li>
   </ul>
  </p>
 </div>


</div><?php manual_footer($setup); ?>