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 revision
Previous revision
Next revisionBoth sides next revision
rfc:streamline-phar-api [2008/03/28 14:56] – save temporarily lstrojnyrfc:streamline-phar-api [2008/03/28 15:09] – Adding metdata lstrojny
Line 1: Line 1:
 ====== Request for comments: Streamline Phar API ====== ====== Request for comments: Streamline Phar API ======
 +
 +  * **Version:** 0.1
 +  * **Date:** 2008-03-28
 +  * **Author:** Lars Strojny
 +  * **Status:** Under development
 +
 ===== Abstract ===== ===== Abstract =====
 This proposal aims to streamline the Phar API to make it more usable and intuitive.  This proposal aims to streamline the Phar API to make it more usable and intuitive. 
 ===== Concrete change proposals ===== ===== Concrete change proposals =====
 +
 +
 ==== Phar ==== ==== Phar ====
 === Modifying Phar archive content === === Modifying Phar archive content ===
Line 20: Line 28:
 === Adding isWritable() method === === Adding isWritable() method ===
 == Proposal == == Proposal ==
-Add an isWritable() method to determine whether an archive can be written or not.+Add an isWritable() method to determine whether an archive can be written or not. Not being able to write an archive either means it is disabled in the php.ini (see Phar::canWrite()) or that PHP can't write to the requested location of the phar archive.
 == Code == == Code ==
 <code php> <code php>
Line 29: Line 37:
 </code> </code>
  
 +=== Adding createDirectory() ===
 +== Proposal ==
 +Add the method Phar->createDirectory() to explicitly create a new directory. createDirectory() will return another Phar object and takes a dirname (string) as an argument.
 +== Code ==
 +<code php>
 +$phar = new Phar('test.phar');
 +$dir = $phar->createDirectory('foo');
 +$dir['file'] = 'content'; // Set the file 'foo/file' to 'content'
 +</code>
  
 ==== SplFileInfo ==== ==== SplFileInfo ====
rfc/streamline-phar-api.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1