|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #76475 phar buildFromIterator misses some directory informations
Submitted: 2018-06-14 10:38 UTC Modified: -
From: Assigned:
Status: Open Package: PHAR related
PHP Version: 7.2.6 OS: OSX
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [2018-06-14 10:38 UTC]
When building a phar with addFile, it is possible to list the folders with scandir or opendir. 
When building the same phar with buildFromIterator, some of the folders in the phar archive can't be read. I get the following error : 

PHP Warning:  scandir(phar:///tmp/iterator.phar/folder/sub): failed to open dir: operation failed in phar:///tmp/iterator.phar/test on line 3

Test script:
The attached gist creates a few files, and build 2 phar with the same structure.
The one created with iterator fails, while the other one is OK, displaying a folder listing.

Expected result:
Building phar with archives allows for all folder listing.

Actual result:
error when using scandir, opendir in the phar. 


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Wed Oct 28 13:01:23 2020 UTC