rfc:streamline-phar-api
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
rfc:streamline-phar-api [2008/03/28 15:15] – Adding the list of cointributors to this proposal lstrojny | rfc:streamline-phar-api [2017/09/22 13:28] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 8: | Line 8: | ||
===== 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 | + | ===== Basic change proposals ===== |
Line 28: | Line 28: | ||
=== Adding isWritable() method === | === Adding isWritable() method === | ||
== Proposal == | == 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:: | + | 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 104: | Line 104: | ||
$file-> | $file-> | ||
</ | </ | ||
+ | |||
+ | ==== DirectoryIterator ==== | ||
+ | === Implement DirectoryIterator === | ||
+ | Let DirectoryIterator implement the ArrayAccess interface. By accessing an array index of a directory iterator, the related SplFileInfo object is returned. | ||
+ | === Code === | ||
+ | <code php> | ||
+ | $iterator = new DirectoryIterator(__DIR__); | ||
+ | $file = $iterator[' | ||
+ | </ | ||
+ | |||
+ | ==== SplFileObject ==== | ||
+ | === Overload getContent()/ | ||
+ | It is necessary to overload getContent()/ | ||
+ | |||
+ | ===== Extended change proposals ===== | ||
+ | ==== SplFileObject ==== | ||
+ | === Rename methods === | ||
+ | == Renamed methods == | ||
+ | * eof() => isEndOfFile() | ||
+ | * fflush() => flush() | ||
+ | * fgetc() => getChar() | ||
+ | * fgetcvs() => getCsv() | ||
+ | * fgets() => getLine() | ||
+ | * fgetss() => getStripped() | ||
+ | * flock() => lock() | ||
+ | * fpassthru() => getRest() | ||
+ | * fseek() => seek() | ||
+ | * fstat() => stat() | ||
+ | * ftell() => getLine() | ||
+ | * ftruncate() => truncate() | ||
+ | * fwrite() => write() | ||
+ | == Proposal == | ||
+ | |
rfc/streamline-phar-api.1206717302.txt.gz · Last modified: 2017/09/22 13:28 (external edit)