|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58091 compressAllFiles*() fails with Phar
Submitted: 2008-03-08 22:18 UTC Modified: 2008-03-22 18:30 UTC
From: Assigned:
Status: Not a bug Package: phar (PECL)
PHP Version: 5_2 CVS-2008-03-08 OS: win32
Private report: No CVE-ID: None
 [2008-03-08 22:18 UTC]
Although the compression tests phar_bz2.phpt and phar_gzip.phpt both pass, they actually test the PHP version of phar creation/compression and not the C version.

Tar works fine (both Phar and PharData).

NB this is with 5_3, but there's no option for that :)

Reproduce code:

$fname = dirname(__FILE__) . '/myphar.phar';
$phar = new Phar($fname);
$phar['index.php'] = '<?php echo "hello world\n"; ?>';
$phar['bulk.txt'] = str_repeat('a', 8000);


Expected result:

Actual result:


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2008-03-22 18:30 UTC] greg at chiaraquartet dot net
This results from a serious confusion over what is being compressed.  compressAllFilesGZ() compresses internal files inside a phar, but compresses the whole file for a tar.  isCompressed() only returns 4096 if the whole file is compressed with GZ.

Needless to say, this API must be cleaned up, it is too confusing
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Feb 26 22:01:28 2024 UTC