Bug #74154 [NEW]: Phar extractTo creates empty files
| From: | jlesueur at bamboohr dot com | Date: | Wed, 22 Feb 2017 22:41:54 +0000 |
| Subject: | Bug #74154 [NEW]: Phar extractTo creates empty files | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-207515@lists.php.net to get a copy of this message | ||
From: jlesueur at bamboohr dot com
Operating system: Ubuntu trusty
PHP version: 7.0.16
Package: PHAR related
Bug Type: Bug
Bug description:Phar extractTo creates empty files
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 bug report at https://bugs.php.net/bug.php?id=74154&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=74154&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=74154&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=74154&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=74154&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=74154&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=74154&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=74154&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=74154&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=74154&r=support
Expected behavior: https://bugs.php.net/fix.php?id=74154&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=74154&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=74154&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=74154&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=74154&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=74154&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=74154&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=74154&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=74154&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=74154&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=74154&r=mysqlcfg