title: Phar archive and stub file usage
body: <p>I try to define a deployment procedure based on command :</p>
  
  <pre><code>php &lt;phar_file_deployed_on_server&gt;.phar
  </code></pre>
  
  <p>This command generates an index.php file external to phar archive.</p>
  
  <p>The index.php file will act as a "thin" dispatcher to N-file.php inside the phar archive.</p>
  
  <p>Example of generated index.php file :</p>
  
  <pre><code>&lt;?
  
  $requiredFile = "phar://&lt;phar_file_deployed_on_server&gt;.phar";
  
  /**
   * For example index.php can check $_GET array and dispatch 
   * to file inside Phar archive.
   **/
  if (array_key_exists("getParameter", $_GET))
      $requiredFile = $requiredFile . "/" . $_GET['getParameter'] . ".php";
  else
      &lt;handling_of_else_condition&gt;;
  
  require_once $requiredFile;
  
  __HALT_COMPILER();
  
  ?&gt;
  </code></pre>
  
  <p><strong>The above dispathing rule is an example.</strong> </p>
  
  <p>My idea is oriented to simply the deployment procedure. The example provided check $_GET array, but it's possible a more complex rule generated during deployment (e.g. via command line parameter).</p>
  
  <blockquote>
    <p>I have created a PHP web application and compressed it to the Phar
    format for easy deployment.</p>
    
    <p>The application can be executed without decompression on a production
    machine, because I have planned an <code>index.php</code> file that links to the
    application inside the Phar archive.</p>
    
    <p>To generate the <code>index.php</code> file during deployment, it is necessary to
    launch the following command into production machine shell:</p>
  
  <pre><code>php &lt;just_deployed_phar_file&gt;
  </code></pre>
    
    <p>The code inside the stub file generates the <code>index.php</code> file in manner
    to refer to the just installed Phar archive.</p>
    
    <p>Is this the correct way to use the stub file?</p>
  </blockquote>