rfc:streamline-phar-api

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
rfc:streamline-phar-api [2008/03/28 15:17]
lstrojny Adding directory iterator adjustments
rfc:streamline-phar-api [2017/09/22 13:28] (current)
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 ​change proposals =====+===== 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::​canWrite()) or that PHP can't write to the requested location of the phar archive.+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. PharFileInfo must overload the method in order to accomplish that.
 == Code == == Code ==
 <code php> <code php>
Line 113: Line 113:
 $file = $iterator['​file'​];​ $file = $iterator['​file'​];​
 </​code>​ </​code>​
 +
 +==== SplFileObject ====
 +=== Overload getContent()/​setContent() ===
 +It is necessary to overload getContent()/​setContent() in SplFileObject to properly reset internal flags. This is merely an implementation detail of the SplFileInfo::​getContent()/​setContent().
 +
 +===== 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 ==
 + ​Rename this methods to make their names more OO-alike, but leave the old names as deprecated aliases and remove them in PHP 6. This belongs to the extended change proposal as it would be practical to do but is not strictly related to Phar.
rfc/streamline-phar-api.1206717449.txt.gz · Last modified: 2017/09/22 13:28 (external edit)