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 15:01] – save temporarily lstrojny | rfc:streamline-phar-api [2008/03/28 15:13] – Adding Phar::create() lstrojny | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Request for comments: Streamline Phar API ====== | ====== Request for comments: Streamline Phar API ====== | ||
+ | |||
+ | * **Version: | ||
+ | * **Date:** 2008-03-28 | ||
+ | * **Author:** Lars Strojny, based on ideas from | ||
+ | * **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 ==== | ||
Line 21: | 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:: |
== Code == | == Code == | ||
<code php> | <code php> | ||
Line 38: | Line 45: | ||
$dir = $phar-> | $dir = $phar-> | ||
$dir[' | $dir[' | ||
+ | </ | ||
+ | |||
+ | === 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:: | ||
</ | </ | ||
rfc/streamline-phar-api.txt · Last modified: 2017/09/22 13:28 by 127.0.0.1