<?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 => 'tr',
  ),
  'this' => 
  array (
    0 => 'ziparchive.addglob.php',
    1 => 'ZipArchive::addGlob',
    2 => 'Add files from a directory by glob pattern',
  ),
  'up' => 
  array (
    0 => 'class.ziparchive.php',
    1 => 'ZipArchive',
  ),
  'prev' => 
  array (
    0 => 'ziparchive.addfromstring.php',
    1 => 'ZipArchive::addFromString',
  ),
  'next' => 
  array (
    0 => 'ziparchive.addpattern.php',
    1 => 'ZipArchive::addPattern',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/zip/ziparchive/addglob.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="ziparchive.addglob" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ZipArchive::addGlob</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.3.0, PHP 7, PHP 8, PECL zip &gt;= 1.9.0)</p><p class="refpurpose"><span class="refname">ZipArchive::addGlob</span> &mdash; <span class="dc-title">Add files from a directory by glob pattern</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-ziparchive.addglob-description">
  <h3 class="title">Açıklama</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>ZipArchive::addGlob</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$pattern</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$flags</code><span class="initializer"> = 0</span></span>, <span class="methodparam"><span class="type"><a href="language.types.array.php" class="type array">array</a></span> <code class="parameter">$options</code><span class="initializer"> = []</span></span>): <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.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   Add files from a directory which match the glob <code class="parameter">pattern</code>.
  </p>
  <blockquote class="note"><p><strong class="note">Bilginize</strong>: 
<span class="simpara">Taşınabilirliği arttırmak için ZIP dosya isimlerinde dizin ayracı
olarak bölü çizgilerini (<code class="literal">/</code>) kullanın.</span></p></blockquote>
 </div>


 <div class="refsect1 parameters" id="refsect1-ziparchive.addglob-parameters">
  <h3 class="title">Bağımsız Değişkenler</h3>
  <dl>
   
    <dt><code class="parameter">pattern</code></dt>
    <dd>
     <p class="para">
      A <span class="function"><a href="function.glob.php" class="function">glob()</a></span> pattern against which files will be matched.
     </p>
    </dd>
   
   
    <dt><code class="parameter">flags</code></dt>
    <dd>
     <p class="para">
      A bit mask of <code class="literal">glob()</code> flags.
     </p>
    </dd>
   
   
    <dt><code class="parameter">options</code></dt>
    <dd>
     <p class="para">
      An associative array of options. Available options are:
      <ul class="itemizedlist">
       <li class="listitem">
        <p class="para">
         <code class="literal">&quot;add_path&quot;</code>
        </p>
        <p class="para">
         Prefix to prepend when translating to the local path of the file within
         the archive. This is applied after any remove operations defined by the
         <code class="literal">&quot;remove_path&quot;</code> or <code class="literal">&quot;remove_all_path&quot;</code>
         options.
        </p>
       </li>
       <li class="listitem">
        <p class="para">
         <code class="literal">&quot;remove_path&quot;</code>
        </p>
        <p class="para">
         Prefix to remove from matching file paths before adding to the archive.
        </p>
       </li>
       <li class="listitem">
        <p class="para">
         <code class="literal">&quot;remove_all_path&quot;</code>
        </p>
        <p class="para">
         <strong><code><a href="reserved.constants.php#constant.true">true</a></code></strong> to use the file name only and add to the root of the archive.
        </p>
       </li>
       <li class="listitem">
        <p class="para">
         <code class="literal">&quot;flags&quot;</code>
        </p>
        <p class="para">
         Bitmask consisting of
         <strong><code><a href="zip.constants.php#ziparchive.constants.fl-overwrite">ZipArchive::FL_OVERWRITE</a></code></strong>,
         <strong><code><a href="zip.constants.php#ziparchive.constants.fl-enc-guess">ZipArchive::FL_ENC_GUESS</a></code></strong>,
         <strong><code><a href="zip.constants.php#ziparchive.constants.fl-enc-utf-8">ZipArchive::FL_ENC_UTF_8</a></code></strong>,
         <strong><code><a href="zip.constants.php#ziparchive.constants.fl-enc-cp437">ZipArchive::FL_ENC_CP437</a></code></strong>,
         <strong><code><a href="zip.constants.php#ziparchive.constants.fl-open-file-now">ZipArchive::FL_OPEN_FILE_NOW</a></code></strong>.
         The behaviour of these constants is described on the
         <a href="zip.constants.php" class="link">ZIP constants</a> page.
        </p>
       </li>
       <li class="listitem">
        <p class="para">
         <code class="literal">&quot;comp_method&quot;</code>
        </p>
        <p class="para">
         Compression method, one of the <strong><code><a href="zip.constants.php#ziparchive.constants.cm-default">ZipArchive::CM_<span class="replaceable">*</span></a></code></strong>
         constants.
        </p>
       </li>
       <li class="listitem">
        <p class="para">
         <code class="literal">&quot;comp_flags&quot;</code>
        </p>
        <p class="para">
         Compression level.
        </p>
       </li>
       <li class="listitem">
        <p class="para">
         <code class="literal">&quot;enc_method&quot;</code>
        </p>
        <p class="para">
         Encryption method, one of the <strong><code><a href="zip.constants.php#ziparchive.constants.em-none">ZipArchive::EM_<span class="replaceable">*</span></a></code></strong>
         constants.
        </p>
       </li>
       <li class="listitem">
        <p class="para">
         <code class="literal">&quot;enc_password&quot;</code>
        </p>
        <p class="para">
         Password used for encryption.
        </p>
       </li>
      </ul>
     </p>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-ziparchive.addglob-returnvalues">
  <h3 class="title">Dönen Değerler</h3>
  <p class="para">
   An <span class="type"><a href="language.types.array.php" class="type array">array</a></span> of added files on success  başarısızlık durumunda <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> döner
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-ziparchive.addglob-changelog">
  <h3 class="title">Sürüm Bilgisi</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>Sürüm: </th>
       <th>Açıklama</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>8.0.0, PECL zip 1.18.0</td>
       <td>
        <code class="literal">&quot;flags&quot;</code> in <code class="parameter">options</code> was added.
       </td>
      </tr>

      <tr>
       <td>8.0.0, PECL zip 1.18.1</td>
       <td>
        <code class="literal">&quot;comp_method&quot;</code>, <code class="literal">&quot;comp_flags&quot;</code>,
        <code class="literal">&quot;enc_method&quot;</code> and <code class="literal">&quot;enc_password&quot;</code> in
        <code class="parameter">options</code> were added.
       </td>
      </tr>

      <tr>
       <td>8.3.0, PECL zip 1.22.1</td>
       <td>
        <strong><code><a href="zip.constants.php#ziparchive.constants.fl-open-file-now">ZipArchive::FL_OPEN_FILE_NOW</a></code></strong> was added.
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-ziparchive.addglob-examples">
  <h3 class="title">Örnekler</h3>
  <div class="example" id="ziparchive.addglob.example.basic">
   <p><strong>Örnek 1 <span class="methodname"><strong>ZipArchive::addGlob()</strong></span> example</strong></p>
   <div class="example-contents"><p>
     Add all php scripts and text files from current working directory
   </p></div>
   <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">$ret </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">'application.zip'</span><span style="color: #007700">, </span><span style="color: #0000BB">ZipArchive</span><span style="color: #007700">::</span><span style="color: #0000BB">CREATE </span><span style="color: #007700">| </span><span style="color: #0000BB">ZipArchive</span><span style="color: #007700">::</span><span style="color: #0000BB">OVERWRITE</span><span style="color: #007700">);<br />if (</span><span style="color: #0000BB">$ret </span><span style="color: #007700">!== </span><span style="color: #0000BB">TRUE</span><span style="color: #007700">) {<br />    </span><span style="color: #0000BB">printf</span><span style="color: #007700">(</span><span style="color: #DD0000">'Failed with code %d'</span><span style="color: #007700">, </span><span style="color: #0000BB">$ret</span><span style="color: #007700">);<br />} else {<br />    </span><span style="color: #0000BB">$options </span><span style="color: #007700">= array(</span><span style="color: #DD0000">'add_path' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'sources/'</span><span style="color: #007700">, </span><span style="color: #DD0000">'remove_all_path' </span><span style="color: #007700">=&gt; </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">addGlob</span><span style="color: #007700">(</span><span style="color: #DD0000">'*.{php,txt}'</span><span style="color: #007700">, </span><span style="color: #0000BB">GLOB_BRACE</span><span style="color: #007700">, </span><span style="color: #0000BB">$options</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 />}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

  </div>
 </div>



 <div class="refsect1 seealso" id="refsect1-ziparchive.addglob-seealso">
  <h3 class="title">Ayrıca Bakınız</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="methodname"><a href="ziparchive.addfile.php" class="methodname" rel="rdfs-seeAlso">ZipArchive::addFile()</a> - Yolu belirtilen dosyayı arşive ekler</span></li>
    <li><span class="methodname"><a href="ziparchive.addpattern.php" class="methodname" rel="rdfs-seeAlso">ZipArchive::addPattern()</a> - Add files from a directory by PCRE pattern</span></li>
   </ul>
  </p>
 </div>

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