Bug #76584 [Opn]: PharFileInfo::decompress not working

From: Date: Mon, 06 May 2019 22:21:44 +0000
Subject: Bug #76584 [Opn]: PharFileInfo::decompress not working
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-220721@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=76584&edit=1

 ID:                 76584
 User updated by:    thenewherobrinex at gmail dot com
 Reported by:        thenewherobrinex at gmail dot com
 Summary:            PharFileInfo::decompress not working
 Status:             Open
 Type:               Bug
 Package:            PHAR related
 Operating System:   Mac/Linux
-PHP Version:        7.2.7
+PHP Version:        7.3.5
 Block user comment: N
 Private report:     N

 New Comment:

I just tested and I noticed that this bug is still there in 7.3.5


Previous Comments:
------------------------------------------------------------------------
[2018-07-05 21:21:08] thenewherobrinex at gmail dot com

Description:
------------
PharFileInfo::decompress marks the file in the phar as not compressed but when you extract the file
from the phar it will be compressed.

Test script:
---------------
<?php
file_put_contents("test.txt", "This is a test file.");
$phar = new Phar("test.phar");
$phar->addFile("test.txt");
$file = $phar["test.txt"];
var_dump($file->compress(Phar::GZ)); //true (success)
var_dump($file->isCompressed()); //true (the file is compressed)
var_dump($file->decompress()); //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)



------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=76584&edit=1


Thread (5 messages)

« previous php.bugs (#220721) next »