|  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
Have you experienced this issue?
Rate the importance of this bug to you:

 [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-2021 The PHP Group
All rights reserved.
Last updated: Mon Jan 18 00:01:22 2021 UTC