Bug #53467 [NEW]: Phar cannot compress large archives
From:
Operating system: Windows 7 - 64
PHP version: 5.3.3
Package: PHAR related
Bug Type: Bug
Bug description:Phar cannot compress large archives
Description:
------------
I tried to create a large phar (exactly 2347 files). However compressing
the phar simply fails. That may be a similar problem as closed pecl bug:
http://pecl.php.net/bugs/bug.php?id=13727
Smaller phars are working. If using the commented section (compress them by
hand) it does work but this is really slow.
Test script:
---------------
<?php
if
(file_exists('D:\\Dev\\ws\\mavenphp-flow3\\FLOW3\\target'.DIRECTORY_SEPARATOR.'FLOW3-1.0.0-alpha-13.phar'))
unlink('D:\\Dev\\ws\\mavenphp-flow3\\FLOW3\\target'.DIRECTORY_SEPARATOR.'FLOW3-1.0.0-alpha-13.phar');
$phar = new
Phar('D:\\Dev\\ws\\mavenphp-flow3\\FLOW3\\target'.DIRECTORY_SEPARATOR.'FLOW3-1.0.0-alpha-13.phar',
0, 'FLOW3-1.0.0-alpha-13.phar');
$phar->startBuffering();
//$localDir =
realpath('D:\\Dev\\ws\\mavenphp-flow3\\FLOW3\\target\\classes\\Packages\\This\\FLOW3');
//$iter = new RecursiveIteratorIterator(new
RecursiveDirectoryIterator(realpath('D:\\Dev\\ws\\mavenphp-flow3\\FLOW3\\target\\classes\\Packages\\This\\FLOW3')));
//foreach ($iter as $file)
//{
// $pathName = $file->getPathname();
// $localName = substr($pathName, strlen($localDir));
// $phar->addFile($pathName, $localName);
// echo "adding $localName".PHP_EOL;
// $phar[$localName]->compress(Phar::GZ);
//}
$phar->buildFromIterator(new RecursiveIteratorIterator(new
RecursiveDirectoryIterator(realpath('D:\\Dev\\ws\\mavenphp-flow3\\FLOW3\\target\\classes\\Packages\\This\\FLOW3'))),
realpath('D:\\Dev\\ws\\mavenphp-flow3\\FLOW3\\target\\classes\\Packages\\This\\FLOW3'));
echo "packed ".$phar->count()." files".PHP_EOL;
echo "compressing".PHP_EOL;
$phar->compressFiles(Phar::GZ);
$phar->setStub('<?php die(\'Unable to execute this phar\');
__HALT_COMPILER(); ?>');
$phar->stopBuffering();
Expected result:
----------------
expected to get the phar.
Actual result:
--------------
BadMethodCallException: unable to create temporary file in
D:\Dev\ws\mavenphp-fl
ow3\FLOW3\target\packagePhar.php on line 20
Call Stack:
0.0011 332160 1. {main}()
D:\Dev\ws\mavenphp-flow3\FLOW3\target\packag
ePhar.php:0
5.1570 1068784 2. Phar->compressFiles()
D:\Dev\ws\mavenphp-flow3\FLOW3\
target\packagePhar.php:20
--
Edit bug report at http://bugs.php.net/bug.php?id=53467&edit=1
--
Try a snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=53467&r=trysnapshot52
Try a snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=53467&r=trysnapshot53
Try a snapshot (trunk): http://bugs.php.net/fix.php?id=53467&r=trysnapshottrunk
Fixed in SVN: http://bugs.php.net/fix.php?id=53467&r=fixed
Fixed in SVN and need be documented: http://bugs.php.net/fix.php?id=53467&r=needdocs
Fixed in release: http://bugs.php.net/fix.php?id=53467&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=53467&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=53467&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=53467&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=53467&r=support
Expected behavior: http://bugs.php.net/fix.php?id=53467&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=53467&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=53467&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=53467&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=53467&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=53467&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=53467&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=53467&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=53467&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=53467&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=53467&r=mysqlcfg
Thread (11 messages)
- mep_eisen at web dot de
- d dot kreuer at kremedia dot deBug #53467 [Com]: Phar cannot compress large archives
- mep_eisen at web dot deBug #53467 [Com]: Phar cannot compress large archives
- cicerchia@php.netBug #53467 [Com]: Phar cannot compress large archives
- Tr at visPaul dot meBug #53467 [Com]: Phar cannot compress large archives
- kevin at herrera dot ioBug #53467 [Com]: Phar cannot compress large archives
- hanskrentel at yahoo dot deBug #53467 [Com]: Phar cannot compress large archives
- cmb@php.netBug #53467 [Opn]: Phar cannot compress large archives
- flavio dot lisboa at fgsl dot eti dot brBug #53467 [Com]: Phar cannot compress large archives
- cmb@php.netBug #53467 [PATCH]: Phar cannot compress large archives
- cmb@php.netBug #53467 [Asn->Csd]: Phar cannot compress large archives