Doc #79173 [Opn->Csd]: Phar::decompress() return new instance of itself
| From: | cmb@php.net | Date: | Sat, 14 Mar 2020 17:22:45 +0000 |
| Subject: | Doc #79173 [Opn->Csd]: Phar::decompress() return new instance of itself | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-17423@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
Updated by: cmb@php.net
Reported by: wcode404 at gmail dot com
Summary: Phar::decompress() return new instance of itself
-Status: Open
+Status: Closed
Type: Documentation Problem
Package: PHAR related
Operating System: Documentation
PHP Version: master-Git-2020-01-27 (Git)
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.
Thank you for the report, and for helping us make our documentation better.
Previous Comments:
------------------------------------------------------------------------
[2020-03-14 17:22:36] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&revision=349430
Log: Fix #79173: Phar::decompress() return new instance of itself
------------------------------------------------------------------------
[2020-01-29 09:06:58] wcode404 at gmail dot com
I save here related problems
PhpStorm
bug https://youtrack.jetbrains.com/issue/WI-50953
fix https://github.com/JetBrains/phpstorm-stubs/pull/740
PHPStan
bug https://github.com/phpstan/phpstan/issues/2908
fix https://github.com/phpstan/phpstan-src/pull/114
------------------------------------------------------------------------
[2020-01-28 12:13:57] wcode404 at gmail dot com
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
------------------------------------------------------------------------
[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