Req #72046 [Com]: PharData::buildFromIterator() directory support

From: Date: Wed, 27 Jan 2021 15:46:44 +0000
Subject: Req #72046 [Com]: PharData::buildFromIterator() directory support
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-231798@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=72046&edit=1

 ID:                 72046
 Comment by:         tklingenberg at lastflood dot 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? 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.


Previous Comments:
------------------------------------------------------------------------
[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)

« previous php.bugs (#231798) next »