php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #72046 PharData::buildFromIterator() directory support
Submitted: 2016-04-17 21:56 UTC Modified: 2021-02-05 12:38 UTC
Votes:2
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: tklingenberg at lastflood dot net Assigned:
Status: Open Package: PHAR related
PHP Version: 5.6.20 OS: Linux
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: tklingenberg at lastflood dot net
New email:
PHP Version: OS:

 

 [2016-04-17 21:56 UTC] tklingenberg at lastflood dot net
Description:
------------
When building from an iterator, the iterator can return SplFileInfo objects.

These can represent a *file* or a *directory*.

Right now each iteration is treated as a file.

It would be great to support directories as well and whenever encountering a directory SplFileInfo to add it's path as empty directory (compare PharData::addEmptyDir())



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-04-17 22:01 UTC] tklingenberg at lastflood dot net
Previous behaviour (#46060) that was fixed for addDir() is now still on itertor process with a directory: Directory path as zero-byte file.
 [2021-01-27 14:21 UTC] cmb@php.net
IMHO, a reasonable feature request!

> Previous behaviour (#46060) that was fixed for addDir() is now
> still on itertor process with a directory: Directory path as
> zero-byte file.

This is no longer the case as of PHP 7.4.0 (and hasn't been on
Windows), since opening a directory is no longer erroneously
supported.
 [2021-01-27 15:46 UTC] tklingenberg at lastflood dot net
Is there anything I can for it? Just asking as the original report is quite old and I think I could add an example script for creating a phar in PHP with an empty directory via building from iterator.
 [2021-02-05 12:38 UTC] cmb@php.net
> Is there anything I can for it?

A pull request implementing that feature would be welcome!
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 13:01:29 2024 UTC