<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/phar.fileformat.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'de',
  ),
  'this' => 
  array (
    0 => 'phar.fileformat.comparison.php',
    1 => 'Head-to-head comparison of Phar, Tar and Zip',
    2 => 'Head-to-head comparison of Phar, Tar and Zip',
  ),
  'up' => 
  array (
    0 => 'phar.fileformat.php',
    1 => 'What makes a phar a phar and not a tar or a zip?',
  ),
  'prev' => 
  array (
    0 => 'phar.fileformat.stub.php',
    1 => 'Phar file stub',
  ),
  'next' => 
  array (
    0 => 'phar.fileformat.tar.php',
    1 => 'Tar-based phars',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/phar/fileformat.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="phar.fileformat.comparison" class="section">
  <h2 class="title">Head-to-head comparison of Phar, Tar and Zip</h2>
  <p class="para">
   What are the good and the bad things about the three supported file formats in
   the phar extension?  This table attempts to address that question.
  <table class="doctable table">
   <caption><strong>Feature matrix: Phar vs. Tar vs. Zip</strong></caption>
   
    <thead>
     <tr>
      <th>Feature</th>
      <th>Phar</th>
      <th>Tar</th>
      <th>Zip</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>Standard File Format</td>
      <td>No</td>
      <td>Yes</td>
      <td>Yes</td>
     </tr>

     <tr>
      <td>Can be executed without the Phar Extension
       <a href="phar.fileformat.comparison.php#phar.fileformat.phartip" class="link">[1]</a>
      </td>
      <td>Yes</td>
      <td>No</td>
      <td>No</td>
     </tr>

     <tr>
      <td>Per-file compression</td>
      <td>Yes</td>
      <td>No</td>
      <td>Yes</td>
     </tr>

     <tr>
      <td>Whole-archive compression</td>
      <td>Yes</td>
      <td>Yes</td>
      <td>No</td>
     </tr>

     <tr>
      <td>Whole-archive signature validation</td>
      <td>Yes</td>
      <td>Yes</td>
      <td>Yes</td>
     </tr>

     <tr>
      <td>Web-specific application support</td>
      <td>Yes</td>
      <td>Yes</td>
      <td>Yes</td>
     </tr>

     <tr>
      <td>Per-file Meta-data</td>
      <td>Yes</td>
      <td>Yes</td>
      <td>Yes</td>
     </tr>

     <tr>
      <td>Whole-Archive Meta-data</td>
      <td>Yes</td>
      <td>Yes</td>
      <td>Yes</td>
     </tr>

     <tr>
      <td>Archive creation/modification
       <a href="phar.fileformat.comparison.php#phar.fileformat.phartip2" class="link">[2]</a>
      </td>
      <td>Yes</td>
      <td>Yes</td>
      <td>Yes</td>
     </tr>

     <tr>
      <td>Full support for all stream wrapper functions</td>
      <td>Yes</td>
      <td>Yes</td>
      <td>Yes</td>
     </tr>

     <tr>
      <td>Can be created/modified even if phar.readonly=1
       <a href="phar.fileformat.comparison.php#phar.fileformat.phartip3" class="link">[3]</a>
      </td>
      <td>No</td>
      <td>Yes</td>
      <td>Yes</td>
     </tr>

    </tbody>
   
  </table>

  </p>
  <p class="para" id="phar.fileformat.phartip">
   <div class="tip"><strong class="tip">Tipp</strong>
    <p class="para">
    [1] PHP can only directly access the contents of a Phar archive
    without the Phar extension if it is using a <code class="literal">stub</code>
    that extracts the contents of the phar archive.  The stub
    created by <span class="function"><a href="phar.createdefaultstub.php" class="function">Phar::createDefaultStub()</a></span> extracts
    the phar archive and runs its contents from a temporary directory
    if no phar extension is found.
    </p>
   </div>
  </p>
  <p class="para" id="phar.fileformat.phartip2">
   <div class="tip"><strong class="tip">Tipp</strong>
    <p class="para">
    [2] All write access requires <code class="literal">phar.readonly</code> to
    be disabled in php.ini or on the command-line directly.
    </p>
   </div>
  </p>
  <p class="para" id="phar.fileformat.phartip3">
   <div class="tip"><strong class="tip">Tipp</strong>
    <p class="para">
    [3] Only tar and zip archives without <code class="literal">.phar</code> in their
    filename and without an executable stub <code class="literal">.phar/stub.php</code>
    can be created if phar.readonly=1.
    </p>
   </div>
  </p>
 </div><?php manual_footer($setup); ?>