Doc->Bug #72394 [Opn->Ver]: PharData fails to iterate certain Tar files

From: Date: Mon, 13 Jun 2016 12:56:21 +0000
Subject: Doc->Bug #72394 [Opn->Ver]: PharData fails to iterate certain Tar files
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-201566@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's limitations are not listed. +Summary: PharData fails to iterate certain Tar files -Status: Open +Status: Verified -Type: Documentation Problem +Type: Bug -Package: Documentation problem +Package: PHAR related PHP Version: Irrelevant Block user comment: N Private report: N New Comment: 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. Previous Comments: ------------------------------------------------------------------------ [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 (#201566) next »