rfc:streamline-phar-api
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
rfc:streamline-phar-api [2008/03/28 14:53] – save temporarily lstrojny | rfc:streamline-phar-api [2008/03/28 15:03] – Adding more explaination to the purpose of Phar::isWritable() lstrojny | ||
---|---|---|---|
Line 3: | Line 3: | ||
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 11: | Line 13: | ||
* offsetUnset() | * offsetUnset() | ||
== Proposal == | == Proposal == | ||
- | In the current API, every path is represented by a single array index. This is counter intuitive, as a multi-dimensional structure (the archive) is represented as a single dimensional array accessible object. The idea is to change that object to be | + | In the current API, every path is represented by a single array index. This is counter intuitive, as a multi-dimensional structure (the archive) is represented as a single dimensional array accessible object. The idea is to change that object to represent every path element (e.g. " |
== Code == | == Code == | ||
<code php> | <code php> | ||
Line 18: | Line 20: | ||
</ | </ | ||
+ | === Adding isWritable() method === | ||
+ | == Proposal == | ||
+ | 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:: | ||
+ | == Code == | ||
+ | <code php> | ||
+ | $phar = new Phar(' | ||
+ | if ($phar-> | ||
+ | $phar[' | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | === Adding createDirectory() === | ||
+ | == Proposal == | ||
+ | Add the method Phar-> | ||
+ | == Code == | ||
+ | <code php> | ||
+ | $phar = new Phar(' | ||
+ | $dir = $phar-> | ||
+ | $dir[' | ||
+ | </ | ||
==== SplFileInfo ==== | ==== SplFileInfo ==== |
rfc/streamline-phar-api.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1