<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.ziparchive.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'uk',
  ),
  'this' => 
  array (
    0 => 'ziparchive.registerprogresscallback.php',
    1 => 'ZipArchive::registerProgressCallback',
    2 => 'Register a callback to provide updates during archive close.',
  ),
  'up' => 
  array (
    0 => 'class.ziparchive.php',
    1 => 'ZipArchive',
  ),
  'prev' => 
  array (
    0 => 'ziparchive.registercancelcallback.php',
    1 => 'ZipArchive::registerCancelCallback',
  ),
  'next' => 
  array (
    0 => 'ziparchive.renameindex.php',
    1 => 'ZipArchive::renameIndex',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/zip/ziparchive/registerprogresscallback.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="ziparchive.registerprogresscallback" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ZipArchive::registerProgressCallback</h1>
  <p class="verinfo">(PHP &gt;= 8.0.0, PECL zip &gt;= 1.17.0)</p><p class="refpurpose"><span class="refname">ZipArchive::registerProgressCallback</span> &mdash; <span class="dc-title">Register a callback to provide updates during archive close.</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-ziparchive.registerprogresscallback-description">
  <h3 class="title">Опис</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>ZipArchive::registerProgressCallback</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.float.php" class="type float">float</a></span> <code class="parameter">$rate</code></span>, <span class="methodparam"><span class="type"><a href="language.types.callable.php" class="type callable">callable</a></span> <code class="parameter">$callback</code></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   Register a <code class="parameter">callback</code> function to provide updates during archive close. 
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-ziparchive.registerprogresscallback-parameters">
  <h3 class="title">Параметри</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">rate</code></dt>
     <dd>
      <p class="para">
       Change between each call of the callback (from 0.0 to 1.0).
      </p>
     </dd>
    
    
     <dt><code class="parameter">callback</code></dt>
     <dd>
      <p class="para">
       This function will receive the current <code class="parameter">state</code> as a <span class="type"><a href="language.types.float.php" class="type float">float</a></span> (from 0.0 to 1.0).
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-ziparchive.registerprogresscallback-returnvalues">
  <h3 class="title">Значення, що повертаються</h3>
  <p class="para">
   Повертає <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> у разі успіху або <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> в разі помилки.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-ziparchive.registerprogresscallback-examples">
  <h3 class="title">Приклади</h3>
    <p class="para">
     This example creates a ZIP file archive
     <var class="filename">php.zip</var> and show
     progression.
    </p>
    <div class="example" id="example-1">
     <p><strong>Приклад #1 Archive a file</strong></p>
     <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">$zip = new ZipArchive();<br />if ($zip-&gt;open('php.zip', ZipArchive::CREATE | ZipArchive::OVERWRITE)) {<br />    $zip-&gt;addFile(PHP_BINARY, 'php');<br />    $zip-&gt;registerProgressCallback(0.05, function ($r) {<br />        printf("%d%%\n", $r * 100);<br />    });<br />    $zip-&gt;close();<br />}</span></code></div>
     </div>

    </div>
 </div>


 <div class="refsect1 notes" id="refsect1-ziparchive.registerprogresscallback-notes">
  <h3 class="title">Примітки</h3>
  <blockquote class="note"><p><strong class="note">Зауваження</strong>: 
   <p class="para">
    This function is only available if built against libzip ≥ 1.3.0.
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 seealso" id="refsect1-ziparchive.registerprogresscallback-seealso">
  <h3 class="title">Прогляньте також</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="methodname"><a href="ziparchive.registercancelcallback.php" class="methodname" rel="rdfs-seeAlso">ZipArchive::registerCancelCallback()</a> - Register a callback to allow cancellation during archive close.</span></li>
   </ul>
  </p>
 </div>


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