Doc #70305 [Ver->Csd]: PharData::decompress() Example 1: $p2 is undefined
| From: | cmb@php.net | Date: | Wed, 19 Aug 2015 16:53:36 +0000 |
| Subject: | Doc #70305 [Ver->Csd]: PharData::decompress() Example 1: $p2 is undefined | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-12629@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=70305&edit=1
ID: 70305
Updated by: cmb@php.net
Reported by: howellnick at gmail dot com
Summary: PharData::decompress() Example 1: $p2 is undefined
-Status: Verified
+Status: Closed
Type: Documentation Problem
Package: Documentation problem
PHP Version: Irrelevant
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:
------------------------------------------------------------------------
[2015-08-19 16:53:03] cmb@php.net
Automatic comment from SVN on behalf of cmb
Revision: http://svn.php.net/viewvc/?view=revision&revision=337556
Log: fix erroneous example (fixes #70305)
------------------------------------------------------------------------
[2015-08-19 16:51:29] cmb@php.net
Thanks for reporting this issue. The example is definitely wrong,
but simply changing to $p->decompress() is not supposed to work,
either.
It seems the example has been copied from PharData::compress(),
and only superficially been adapted. IMO, the example should be
replaced with a simple example showing how to decompress an
already existing compressed archive.
------------------------------------------------------------------------
[2015-08-19 15:19:41] howellnick at gmail dot com
Description:
------------
Example #1 A PharData::decompress() example
<?php
$p = new PharData('/path/to/my.tar', 0, 'my.tar.gz');
$p['myfile.txt'] = 'hi';
$p['myfile2.txt'] = 'hi';
$p3 = $p2->decompress(); // creates /path/to/my.tar
?>
---
From manual page: http://www.php.net/phardata.decompress
---
On the line:
$p3 = $p2->decompress(); // creates /path/to/my.tar
$p2 is clearly undefined. The line should probably be changed to:
$p2 = $p->decompress(); // creates /path/to/my.tar
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=70305&edit=1