Bug #72394 [Ver]: PharData fails to iterate certain Tar files

From: Date: Mon, 13 Jun 2016 13:47:52 +0000
Subject: Bug #72394 [Ver]: PharData fails to iterate certain Tar files
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-201572@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 User updated by: forums at artfulrobot dot uk Reported by: forums at artfulrobot dot uk Summary: PharData fails to iterate certain Tar files Status: Verified Type: Bug Package: PHAR related PHP Version: Irrelevant Block user comment: N Private report: N New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [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

« previous php.bugs (#201572) next »