Edit report at https://bugs.php.net/bug.php?id=53467&edit=1

 ID:                 53467
 Comment by:         d dot kreuer at kremedia dot de
 Reported by:        mep_eisen at web dot de
 Summary:            Phar cannot compress large archives
 Status:             Open
 Type:               Bug
 Package:            PHAR related
 Operating System:   Windows 7 - 64
 PHP Version:        5.3.3
 Block user comment: N
 Private report:     N

 New Comment:

I have the same problem under Ubuntu 10.04.3 with PHP 5.3.5

PHP 5.3.5-1ubuntu7.2ppa1~lucid with Suhosin-Patch (cli) (built: May  7 2011 
03:15:14) 
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies
    with the ionCube PHP Loader v4.0.7, Copyright (c) 2002-2011, by ionCube Ltd.
    with Suhosin v0.9.29, Copyright (c) 2007, by SektionEins GmbH


Previous Comments:
------------------------------------------------------------------------
[2010-12-03 20:31:20] mep_eisen at web dot de

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 this bug report at https://bugs.php.net/bug.php?id=53467&edit=1

Reply via email to