rfc:streamline-phar-api

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
rfc:streamline-phar-api [2008/03/28 15:09] – Adding metdata lstrojnyrfc:streamline-phar-api [2008/03/28 15:13] – Adding Phar::create() lstrojny
Line 3: Line 3:
   * **Version:** 0.1   * **Version:** 0.1
   * **Date:** 2008-03-28   * **Date:** 2008-03-28
-  * **Author:** Lars Strojny+  * **Author:** Lars Strojny, based on ideas from 
   * **Status:** Under development   * **Status:** Under development
  
Line 45: Line 45:
 $dir = $phar->createDirectory('foo'); $dir = $phar->createDirectory('foo');
 $dir['file'] = 'content'; // Set the file 'foo/file' to 'content' $dir['file'] = 'content'; // Set the file 'foo/file' to 'content'
 +</code>
 +
 +=== Adding static create()-factory method ==
 +== Proposal ==
 +Add a static create method to allow the convenient creation of a Phar-archive from the file system. The create()-method will take two arguments. The first argument is a string with the path to the archive. The second argument is a string with the path to the directory containing the files to be added to the archive. create() will return a Phar-object.
 +== Code ==
 +<code php>
 +$phar = Phar::create('test.phar', 'path/to/source/dir'); // Adds every file and subdirectory to test.phar
 </code> </code>
  
rfc/streamline-phar-api.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1