Bug #66972 [Opn->Fbk]: $ZipArchive->addFile() don't see phar-inside file
| From: | cmb@php.net | Date: | Mon, 31 May 2021 14:42:29 +0000 |
| Subject: | Bug #66972 [Opn->Fbk]: $ZipArchive->addFile() don't see phar-inside file | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-234121@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=66972&edit=1
ID: 66972
Updated by: cmb@php.net
Reported by: sailormax at inbox dot lv
Summary: $ZipArchive->addFile() don't see phar-inside file
-Status: Open
+Status: Feedback
Type: Bug
Package: Zip Related
PHP Version: master-Git-2014-03-28 (Git)
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
So, is this still an issue with any of the actively supported PHP
versions[1]?
[1] <https://www.php.net/supported-versions.php>
Previous Comments:
------------------------------------------------------------------------
[2014-04-02 20:35:38] sailormax at inbox dot lv
Actually I compressed PHPWord ( https://phpword.codeplex.com ) and result has this error.
I'll retest my sample little later.
thank you.
------------------------------------------------------------------------
[2014-04-02 08:02:24] ab@php.net
Can't reproduce. Does this work from cli for you? It only fails by a real error, like if
embed.xml doesn't exits.
------------------------------------------------------------------------
[2014-03-28 15:08:31] sailormax at inbox dot lv
Description:
------------
Looks like $ZipArchive->addFile() don't see source file, if it placed near the executed
script inside PHAR.
Steps:
1. create phar-file with:
- embed.xml with any data;
- index.php with:
~~~~
$objZip = new ZipArchive();
$objZip->open("test.zip", ZIPARCHIVE::CREATE);
$objZip->addFile(dirname(__FILE__) . '/embed.xml', 'test/embed.xml');
$objZip->close();
~~~~
Exp: test.zip with embed.xml
Act: test.zip without embed.xml . addFile() return false;
Test script:
---------------
$objZip = new ZipArchive();
$objZip->open("test.zip", ZIPARCHIVE::CREATE);
$objZip->addFile(dirname(__FILE__) . '/embed.xml', 'test/embed.xml');
$objZip->close();
Expected result:
----------------
test.zip with embed.xml
Actual result:
--------------
test.zip without embed.xml . addFile() return false;
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=66972&edit=1