Doc #77500 [Opn->Nab]: ZipArchive::getFromName works with path, not just name

From: Date: Wed, 18 Mar 2020 12:38:47 +0000
Subject: Doc #77500 [Opn->Nab]: ZipArchive::getFromName works with path, not just name
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-17434@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77500&edit=1 ID: 77500 Updated by: remi@php.net Reported by: jave dot web at seznam dot cz Summary: ZipArchive::getFromName works with path, not just name -Status: Open +Status: Not a bug Type: Documentation Problem Package: Zip Related PHP Version: Irrelevant Block user comment: N Private report: N New Comment: Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Due to the volume of reports we can not explain in detail here why your report is not a bug. The support channels will be able to provide an explanation for you. Thank you for your interest in PHP. Please propose a documentation change. Previous Comments: ------------------------------------------------------------------------ [2019-01-22 16:14:39] jave dot web at seznam dot cz Description: ------------ Documentation for ZipArchive::getFromName is misleading. The first parameter is actually a relative (to root of the archive) path, docs say "Name" which can falsely imply file would be found just by its filename, which doesn't happen when it is inside a directory. To get to a deeper file, you must specify the path like: $zip->getFromName('subFolderTest/test.txt'); --- From manual page: https://php.net/ziparchive.getfromname --- Test script: --------------- //considering archive structure //subFolderTest (d) // - test.txt (f) // - test2.txt (f) $zip->getFromName('test.txt'); //this will not find anything $zip->getFromName('subFolderTest/test.txt'); //this will find the file ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=77500&edit=1

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