php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #79173 Phar::decompress() return new instance of itself
Submitted: 2020-01-27 14:47 UTC Modified: 2020-03-14 17:22 UTC
From: wcode404 at gmail dot com Assigned: cmb (profile)
Status: Closed Package: PHAR related
PHP Version: master-Git-2020-01-27 (Git) OS: Documentation
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: wcode404 at gmail dot com
New email:
PHP Version: OS:

 

 [2020-01-27 14:47 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-01-27 15:01 UTC] 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 18:43 UTC] requinix@php.net
-Package: PHP Language Specification +Package: PHAR related
 [2020-03-14 17:22 UTC] 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-03-14 17:22 UTC] cmb@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: cmb
 [2020-03-14 17:22 UTC] cmb@php.net
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.
 [2020-03-14 17:24 UTC] phpdocbot@php.net
Automatic comment on behalf of cmb
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=483b1101fc5e75cfb85b5c017f50456ead8c52ec
Log: Fix #79173: Phar::decompress() return new instance of itself
 [2020-03-14 22:39 UTC] mumumu@php.net
Automatic comment from SVN on behalf of mumumu
Revision: http://svn.php.net/viewvc/?view=revision&revision=349435
Log: Fix #79173: Phar::decompress() return new instance of itself
 [2020-03-14 22:40 UTC] phpdocbot@php.net
Automatic comment on behalf of mumumu
Revision: http://git.php.net/?p=doc/ja.git;a=commit;h=dc8ce55503d734b96a304bc007898ee0b87a5f5f
Log: Fix #79173: Phar::decompress() return new instance of itself
 [2020-12-30 11:59 UTC] nikic@php.net
Automatic comment on behalf of mumumu
Revision: http://git.php.net/?p=doc/ja.git;a=commit;h=2680963e8ea4f3735c0b30c1865032591e1a262d
Log: Fix #79173: Phar::decompress() return new instance of itself
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 17:01:29 2024 UTC