Bug->Doc #71555 [Opn->Ver]: phardata.compress removes same name files in tar archive

From: Date: Tue, 15 Dec 2020 14:23:26 +0000
Subject: Bug->Doc #71555 [Opn->Ver]: phardata.compress removes same name files in tar archive
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-18263@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=71555&edit=1 ID: 71555 Updated by: cmb@php.net Reported by: fredrik dot e at gmail dot com Summary: phardata.compress removes same name files in tar archive -Status: Open +Status: Verified -Type: Bug +Type: Documentation Problem Package: PHAR related -PHP Version: 5.5.32 +PHP Version: Irrelevant Block user comment: N Private report: N New Comment: This is not particularly related to compression, but happens whenever Phar(Data) modifies the archive. Since Phar(Data) implements ArrayAccess, there can only ever be at most a single entry with the same key. Changing to documentation problem. Previous Comments: ------------------------------------------------------------------------ [2016-02-09 07:51:46] fredrik dot e at gmail dot com Description: ------------ I just realized that phardata.compress removes same name files in tar archives. I have multiple tar archives that contains multiple instances of files with the same name and when using the code below only the first occurrence of the file is preserved. Test script: --------------- <?php $p = new PharData('tarFile.tar',0); $p->compress(Phar::GZ); ?> Expected result: ---------------- The expected result is to preserve all files in the archive and just compress it. Actual result: -------------- Only first file (with the same name) is preserved. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=71555&edit=1

« previous php.doc.bugs (#18263) next »