Bug #76584 [Opn->Ver]: PharFileInfo::decompress not working
Edit report at https://bugs.php.net/bug.php?id=76584&edit=1
ID: 76584
Updated by: cmb@php.net
Reported by: thenewherobrinex at gmail dot com
Summary: PharFileInfo::decompress not working
-Status: Open
+Status: Verified
Type: Bug
Package: PHAR related
Operating System: Mac/Linux
PHP Version: 7.3.5
Block user comment: N
Private report: N
Previous Comments:
------------------------------------------------------------------------
[2019-05-06 22:21:44] thenewherobrinex at gmail dot com
I just tested and I noticed that this bug is still there in 7.3.5
------------------------------------------------------------------------
[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)