|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79912 Phar::decompressFiles not working
Submitted: 2020-07-29 16:17 UTC Modified: 2021-01-19 09:33 UTC
From: thenewherobrinex at gmail dot com Assigned: cmb (profile)
Status: Duplicate Package: PHAR related
PHP Version: 7.4.8 OS: MacOS
Private report: No CVE-ID: None
 [2020-07-29 16:17 UTC] thenewherobrinex at gmail dot com
Phar::decompressFiles marks the files in the PHAR as not compressed but when you extract the files from the PHAR they will be still compressed.

This is the same exact issue as just with Phar::decompressFiles instead of PharFileInfo::decompress.

Test script:
file_put_contents("test.txt", "This is a test file.");
$phar = new Phar("test.phar");
$file = $phar["test.txt"];
var_dump($file->compress(Phar::GZ)); //true (success)
var_dump($file->isCompressed()); //true (the file is compressed)
var_dump($phar->decompressFiles()); //true (success)
var_dump($file->isCompressed()); //false (the file should not be compressed anymore)
var_dump($phar->extractTo("test")); //true (success but the extracted file in the folder is compressed)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2020-12-08 13:46 UTC]
-Status: Open +Status: Verified
 [2021-01-19 09:33 UTC]
Actually, this appears to be a duplicate of bug #69279.
 [2021-01-19 09:33 UTC]
-Status: Verified +Status: Duplicate -Assigned To: +Assigned To: cmb
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue May 21 02:01:35 2024 UTC