|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #66972 $ZipArchive->addFile() don't see phar-inside file
Submitted: 2014-03-28 15:08 UTC Modified: 2021-06-13 04:22 UTC
From: sailormax at inbox dot lv Assigned: cmb (profile)
Status: No Feedback Package: Zip Related
PHP Version: master-Git-2014-03-28 (Git) OS:
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.
Block user comment
Status: Assign to:
Bug Type:
From: sailormax at inbox dot lv
New email:
PHP Version: OS:


 [2014-03-28 15:08 UTC] sailormax at inbox dot lv
Looks like $ZipArchive->addFile() don't see source file, if it placed near the executed script inside PHAR.

1. create phar-file with:
- embed.xml with any data;
- index.php with:
$objZip = new ZipArchive();
$objZip->open("", ZIPARCHIVE::CREATE);
$objZip->addFile(dirname(__FILE__) . '/embed.xml', 'test/embed.xml');

Exp: with embed.xml
Act: without embed.xml . addFile() return false;

Test script:
$objZip = new ZipArchive();
$objZip->open("", ZIPARCHIVE::CREATE);
$objZip->addFile(dirname(__FILE__) . '/embed.xml', 'test/embed.xml');

Expected result:
---------------- with embed.xml

Actual result:
-------------- without embed.xml . addFile() return false;


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2014-04-02 08:02 UTC]
-Status: Open +Status: Feedback
 [2014-04-02 08:02 UTC]
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-04-02 20:35 UTC] sailormax at inbox dot lv
-Status: Feedback +Status: Open
 [2014-04-02 20:35 UTC] sailormax at inbox dot lv
Actually I compressed PHPWord ( ) and result has this error.
I'll retest my sample little later.

thank you.
 [2015-04-16 12:52 UTC]
-Package: zip +Package: Zip Related
 [2021-05-31 14:42 UTC]
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-05-31 14:42 UTC]
So, is this still an issue with any of the actively supported PHP

[1] <>
 [2021-06-13 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Mon Jun 21 22:01:23 2021 UTC