Doc #79173 [Opn]: Phar::decompress() return new instance of itself
| From: | wcode404 at gmail dot com | Date: | Tue, 28 Jan 2020 12:13:57 +0000 |
| Subject: | Doc #79173 [Opn]: Phar::decompress() return new instance of itself | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-17229@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=79173&edit=1
ID: 79173
User updated by: wcode404 at gmail dot com
Reported by: wcode404 at gmail dot com
Summary: Phar::decompress() return new instance of itself
Status: Open
Type: Documentation Problem
Package: PHAR related
Operating System: Documentation
PHP Version: master-Git-2020-01-27 (Git)
Block user comment: N
Private report: N
New Comment:
Similar problem for \Phar::compress() and \PharData::compress().
https://www.php.net/manual/en/phar.compress.php#refsect1-phar.compress-returnvalues
https://www.php.net/manual/en/phardata.compress.php#refsect1-phardata.compress-returnvalues
Previous Comments:
------------------------------------------------------------------------
[2020-01-27 15:01:08] wcode404 at gmail dot com
Similar problem for \PharData::decompress()
https://www.php.net/manual/en/phardata.decompress.php#refsect1-phardata.decompress-returnvalues
------------------------------------------------------------------------
[2020-01-27 14:47:55] wcode404 at gmail dot com
Description:
------------
In description saed that \Phar::decompress() return \Phar
https://www.php.net/manual/en/phar.decompress.php#refsect1-phar.decompress-returnvalues
But declared it as
public Phar::decompress ([ string $extension ] ) : object
Maybe need update the documentation for
public Phar::decompress ([ string $extension ] ) : \Phar
Test script:
---------------
// gzipped tar archive with path "GeoLite2.mmdb"
$encode =
'H4sIAAAAAAAAA3NPzffJLEk10svNTUlioA0wAAIzAwOs4lDAYGhsZmhsamZoZm4GEjc3MDRWwNRBA1BaXJJYxIDFdaNgFIyCUTC8AQCdCzBEAAYAAA==';
// make archive file
$filename = sys_get_temp_dir().'/GeoLite2.tar.gz';
file_put_contents($filename, base64_decode($encode));
// extrac archive
$zip = new \PharData($filename);
$tar = $zip->decompress();
$tar->extractTo(sys_get_temp_dir());
assert(file_exists(sys_get_temp_dir().'/GeoLite2.mmdb'));
Expected result:
----------------
all is good
Actual result:
--------------
all is good
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=79173&edit=1