|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #71555 phardata.compress removes same name files in tar archive
Submitted: 2016-02-09 07:51 UTC Modified: 2020-12-15 14:23 UTC
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: fredrik dot e at gmail dot com Assigned:
Status: Verified Package: PHAR related
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
43 - 38 = ?
Subscribe to this entry?

 [2016-02-09 07:51 UTC] fredrik dot e at gmail dot com
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:
  $p = new PharData('tarFile.tar',0);

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.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-12-15 14:23 UTC]
-Status: Open +Status: Verified -Type: Bug +Type: Documentation Problem -PHP Version: 5.5.32 +PHP Version: Irrelevant
 [2020-12-15 14:23 UTC]
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.
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Feb 22 12:01:29 2024 UTC