|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2020-12-08 19:22 UTC] cataphract@php.net
-Status: Open
+Status: Wont fix
[2020-12-08 19:22 UTC] cataphract@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 22:00:01 2025 UTC |
Description: ------------ When using RarEntry::extract() for an entry that is a directory, only the directory itself is extracted but not the entries within that directory. The extracted directory is empty. It would be useful if this method extracted the directory including all entries within that directory. Also, this would be consistent with "x" command of unrar (as in the command-line unrar). The workaround (i.e. finding and extracting all entries within a given directory entry by name) does not promise to work reliably given that, according to the PHP manual, a RAR archive can have multiple entries with the same name. Test script: --------------- Assuming "archive.rar" is an archive with the following contents: mydirectory mydirectory/myfile.txt And the following code snippet: $archive = RarArchive::open("archive.rar"); foreach ($archive as $entry) { if ($entry->isDirectory()) { $entry->extract(""); } } Expected result: ---------------- In the current directory, there is a directory called "mydirectory", and within that directory, there is the file "myfile.txt" from the archive. Actual result: -------------- In the current directory, there is an empty directory called "mydirectory".