Bug #74154 [Opn->Ver]: Phar extractTo creates empty files

From: Date: Thu, 23 Feb 2017 13:04:45 +0000
Subject: Bug #74154 [Opn->Ver]: Phar extractTo creates empty files
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-207521@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74154&edit=1 ID: 74154 Updated by: cmb@php.net Reported by: jlesueur at bamboohr dot com Summary: Phar extractTo creates empty files -Status: Open +Status: Verified Type: Bug Package: PHAR related Operating System: Ubuntu trusty PHP Version: 7.0.16 Block user comment: N Private report: N New Comment: This regression has been introduced with commit 995ecff[1] which fixed bug #70417. [1] <http://git.php.net/?p=php-src.git;a=commit;h=995ecffbb2ef972c2d01200ee15b39feb7c6d066> Previous Comments: ------------------------------------------------------------------------ [2017-02-22 22:41:53] jlesueur at bamboohr dot com Description: ------------ The test script creates a test directory, and 5 text files inside. It then uses loads those files into a PharData file, compresses it, and extracts to a "dest" directory. In php 7.0.15, the files had the correct contents, in 7.0.16, the files in "dest" are empty. Test script: --------------- <?php rm -rf test; mkdir('test'); file_put_contents('test/1.txt', str_repeat('h', 10000)); file_put_contents('test/2.txt', str_repeat('e', 10000)); file_put_contents('test/3.txt', str_repeat('l', 10000)); file_put_contents('test/4.txt', str_repeat('l', 10000)); file_put_contents('test/5.txt', str_repeat('o', 10000)); $phar = new PharData('test.tar'); $phar->buildFromDirectory('test'); $compPhar = $phar->compress(Phar::GZ); unset($phar); //make sure that test.tar is closed unlink('test.tar'); unset($compPhar); //make sure that test.tar.gz is closed $extractingPhar = new PharData('test.tar.gz'); $extractingPhar->extractTo('dest'); ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=74154&edit=1

« previous php.bugs (#207521) next »