Doc #53166 [Asn]: ZipArchive::addFile() is missing parameters in docs

From: Date: Tue, 26 Oct 2010 16:18:11 +0000
Subject: Doc #53166 [Asn]: ZipArchive::addFile() is missing parameters in docs
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-5419@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=53166&edit=1 ID: 53166 Updated by: rquadling@php.net Reported by: znarkus at gmail dot com Summary: ZipArchive::addFile() is missing parameters in docs Status: Assigned Type: Documentation Problem -Package: Documentation problem +Package: Zip Related Operating System: Windows PHP Version: 5.3.3 -Assigned To: rquadling +Assigned To: Block user comment: N New Comment: There would also be an issue with ZipArchive::setArchiveComment, ZipArchive::getCommentIndex, ZipArchive::getCommentName, ZipArchive::getNameIndex(), ZipArchive::getFromName() and ZipArchive::getFromIndex(). None of these methods documented prototypes tie up with the actual parameters being reflected by the extension. Also, in some cases, the reflection doesn't tie up with the argument parsing in the C code. Whilst, on the surface, this looks like a documentation bug, I think that the underlying code should be fixed and then accurate documentation can be written from that. There are also missing function ZipArchive::addGlob() and ZipArchive::addPattern() are missing. Previous Comments: ------------------------------------------------------------------------ [2010-10-26 17:38:24] znarkus at gmail dot com Yeah, downloading the source and dissecting the C code is probably not rookie PHP'ers do, like I had to. One of the things PHP is known for is it's extensive documentation. Thanks for taking the time! ------------------------------------------------------------------------ [2010-10-26 17:33:51] philip@php.net If the parameters exist, they should be documented, even if it means saying that they do nothing useful. ------------------------------------------------------------------------ [2010-10-26 16:51:53] znarkus at gmail dot com Without them, I get the following error when extending the class. Declaration of ZipArchiveImproved::addFile() should be compatible with that of ZipArchive::addFile() ZipArchiveImproved is my custom class, and definition of addFile is as follows, which doesn't work. public function addFile( $fileName, $localname = '') ------------------------------------------------------------------------ [2010-10-26 14:47:06] rquadling@php.net Interesting. Yes, the prototype could look like that, but the additional parameters would have no impact. In both the addFile() and the addGlob() methods, the call to php_zip_add_file doesn't passes 0 for both the start and length parameters. I'd not change the documentation to match these useless parameters. Unless this bug is really that the values SHOULD be passed? ------------------------------------------------------------------------ [2010-10-26 14:35:10] znarkus at gmail dot com On this URL: http://se.php.net/manual/en/function.ziparchive-addfile.php ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/bug.php?id=53166 -- Edit this bug report at http://bugs.php.net/bug.php?id=53166&edit=1

« previous php.doc.bugs (#5419) next »