Req #72046 [Opn]: PharData::buildFromIterator() directory support
Edit report at https://bugs.php.net/bug.php?id=72046&edit=1
ID: 72046
Updated by: cmb@php.net
Reported by: tklingenberg at lastflood dot net
Summary: PharData::buildFromIterator() directory support
Status: Open
Type: Feature/Change Request
Package: PHAR related
Operating System: Linux
PHP Version: 5.6.20
Block user comment: N
Private report: N
New Comment:
> Is there anything I can for it?
A pull request implementing that feature would be welcome!
Previous Comments:
------------------------------------------------------------------------
[2021-01-27 15:46:44] 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-01-27 14:21:02] 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 13:04:12] cmb@php.net
Related To: Bug #76475
------------------------------------------------------------------------
[2016-04-17 22:01:21] 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.
------------------------------------------------------------------------
[2016-04-17 21:56:42] 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())
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=72046&edit=1
Thread (5 messages)