<?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 => 'fr',
  ),
  'this' => 
  array (
    0 => 'ziparchive.extractto.php',
    1 => 'ZipArchive::extractTo',
    2 => 'Extrait le contenu de l\'archive',
  ),
  'up' => 
  array (
    0 => 'class.ziparchive.php',
    1 => 'ZipArchive',
  ),
  'prev' => 
  array (
    0 => 'ziparchive.deletename.php',
    1 => 'ZipArchive::deleteName',
  ),
  'next' => 
  array (
    0 => 'ziparchive.getarchivecomment.php',
    1 => 'ZipArchive::getArchiveComment',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/zip/ziparchive/extractto.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="ziparchive.extractto" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ZipArchive::extractTo</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.2.0, PHP 7, PHP 8, PECL zip &gt;= 1.1.0)</p><p class="refpurpose"><span class="refname">ZipArchive::extractTo</span> &mdash; <span class="dc-title">Extrait le contenu de l&#039;archive</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-ziparchive.extractto-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>ZipArchive::extractTo</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$pathto</code></span>, <span class="methodparam"><span class="type"><span class="type"><a href="language.types.array.php" class="type array">array</a></span>|<span class="type"><a href="language.types.string.php" class="type string">string</a></span>|<span class="type"><a href="language.types.null.php" class="type null">null</a></span></span> <code class="parameter">$files</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>): <span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></div>

  <p class="para rdfs-comment">
   Extrait l&#039;archive complète ou les fichiers fournis vers un chemin spécifié.
  </p>
  <div class="warning"><strong class="warning">Avertissement</strong>
   <p class="para">
    Les permissions par défaut pour les fichiers et dossiers extraits
    donnent le plus large accès possible. Ceci peut être restreint en
    définissant le umask courant, qui peut être changé en utilisant
    <span class="function"><a href="function.umask.php" class="function">umask()</a></span>.
   </p>
   <p class="para">
    Pour des raisons de sécurité, les permissions d&#039;origine ne sont pas restaurées.
    Pour un exemple de comment les restaurer, consulter l&#039;échantillon de code sur la
    <a href="ziparchive.getexternalattributesindex.php#ziparchive.getexternalattributesindex.examples.perms" class="link">page d&#039;exemple</a>
    de la méthode <span class="methodname"><a href="ziparchive.getexternalattributesindex.php" class="methodname">ZipArchive::getExternalAttributesIndex()</a></span>.
   </p>
  </div>
 </div>


 <div class="refsect1 parameters" id="refsect1-ziparchive.extractto-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">pathto</code></dt>
     <dd>
      <p class="para">
       Endroit où l&#039;on doit extraire les fichiers
      </p>
     </dd>
    
    
     <dt><code class="parameter">files</code></dt>
     <dd>
      <p class="para">
       Les entrées à extraire. Ce peut être soit le nom d&#039;une entrée ou un
       tableau de noms
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-ziparchive.extractto-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   Cette fonction retourne <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> en cas de succès ou <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> si une erreur survient.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-ziparchive.extractto-examples">
  <h3 class="title">Exemples</h3>
  <div class="example" id="example-1">
   <p><strong>Exemple #1 Extrait toutes les entrées</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$zip </span><span style="color: #007700">= new </span><span style="color: #0000BB">ZipArchive</span><span style="color: #007700">;<br />if (</span><span style="color: #0000BB">$zip</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">open</span><span style="color: #007700">(</span><span style="color: #DD0000">'test.zip'</span><span style="color: #007700">) === </span><span style="color: #0000BB">TRUE</span><span style="color: #007700">) {<br />    </span><span style="color: #0000BB">$zip</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">extractTo</span><span style="color: #007700">(</span><span style="color: #DD0000">'/mon/dossier/destination/'</span><span style="color: #007700">);<br />    </span><span style="color: #0000BB">$zip</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">close</span><span style="color: #007700">();<br />    echo </span><span style="color: #DD0000">'ok'</span><span style="color: #007700">;<br />} else {<br />    echo </span><span style="color: #DD0000">'échec'</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

  </div>
  <div class="example" id="example-2">
   <p><strong>Exemple #2 Extrait deux entrées</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$zip </span><span style="color: #007700">= new </span><span style="color: #0000BB">ZipArchive</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$res </span><span style="color: #007700">= </span><span style="color: #0000BB">$zip</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">open</span><span style="color: #007700">(</span><span style="color: #DD0000">'test_im.zip'</span><span style="color: #007700">);<br />if (</span><span style="color: #0000BB">$res </span><span style="color: #007700">=== </span><span style="color: #0000BB">TRUE</span><span style="color: #007700">) {<br />    </span><span style="color: #0000BB">$zip</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">extractTo</span><span style="color: #007700">(</span><span style="color: #DD0000">'/mon/dossier/destination/'</span><span style="color: #007700">, array(</span><span style="color: #DD0000">'pear_item.gif'</span><span style="color: #007700">, </span><span style="color: #DD0000">'testfromfile.php'</span><span style="color: #007700">));<br />    </span><span style="color: #0000BB">$zip</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">close</span><span style="color: #007700">();<br />    echo </span><span style="color: #DD0000">'ok'</span><span style="color: #007700">;<br />} else {<br />    echo </span><span style="color: #DD0000">'échec'</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

  </div>
 </div>


 <div class="refsect1 notes" id="refsect1-ziparchive.extractto-notes">
  <h3 class="title">Notes</h3>
  <blockquote class="note"><p><strong class="note">Note</strong>: <p class="para">
 Les systèmes de fichiers NTFS Windows ne supportent pas certain caractères dans le noms de fichier,
 à savoir <code class="literal">&lt;|&gt;*?&quot;:</code>.
 Les noms de fichiers avec un point trainant ne sont également pas supporté.
 Contrairement à certains outils d&#039;extraction, cette méthode ne remplace pas ces caractères
 avec un tiret bas, mais échoue à extraire de tel fichiers.
</p></p></blockquote>
 </div>

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