Bug #72394 [Ver->Dup]: PharData fails to iterate certain Tar files
| From: | cmb@php.net | Date: | Fri, 29 Jan 2021 15:52:42 +0000 |
| Subject: | Bug #72394 [Ver->Dup]: PharData fails to iterate certain Tar files | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-231831@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=72394&edit=1
ID: 72394
Updated by: cmb@php.net
Reported by: forums at artfulrobot dot uk
Summary: PharData fails to iterate certain Tar files
-Status: Verified
+Status: Duplicate
Type: Bug
Package: PHAR related
PHP Version: Irrelevant
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
This is actually a duplicate of bug #71966.
Previous Comments:
------------------------------------------------------------------------
[2016-06-13 13:47:51] forums at artfulrobot dot uk
yeah, I thought it was a bug, but because I only use packaged versions of PHP (Debian, Ubuntu) and
neither of those is considered up-to-date enough to have an option in the bug reporter, I figured
I'd say it was wrong documentation...
FWIW: I can confirm this bug is in PHP 5.6.20 and PHP 7.0.4.
------------------------------------------------------------------------
[2016-06-13 12:56:19] cmb@php.net
Even when RecursiveDirectoryIterator::SKIP_DOTS is not passed to
the constructor, I see the same behavior, and to me that looks
like a bug, not a limitation.
------------------------------------------------------------------------
[2016-06-13 11:24:44] forums at artfulrobot dot uk
oops, wrong name in title
------------------------------------------------------------------------
[2016-06-13 11:24:08] forums at artfulrobot dot uk
Description:
------------
---
From manual page: http://www.php.net/class.phardata
---
This fails to iterate certain Tar files, see example below. If this is a by-design limitation it
should be noted.
Test script:
---------------
#!/bin/bash
# Create a tar file.
mkdir -p orig-dir/subdir; touch orig-dir/{a,b,subdir/c}; cd orig-dir
tar czf ../test.tgz ./; cd ../
# PHP
<?php
$a = new PharData('test.tgz', RecursiveDirectoryIterator::SKIP_DOTS);
print count($a) . " files\n";
foreach (new RecursiveIteratorIterator($a) as $path => $fileinfo) {
print " " . $path . "\n"; // never runs.
}
Expected result:
----------------
3 files
phar:///some/path/./a
phar:///some/path/./b
phar:///some/path/./subdir/c
Actual result:
--------------
5 files
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=72394&edit=1