|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2010-12-03 20:31 UTC] 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 PatchesPull Requests
Pull requests:
HistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 07 01:00:01 2025 UTC |
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 GmbHStill present with PHP 5.4 as well (with Ubuntu 12.04). PHP 5.4.12-1~quantal+1 (cli) (built: Feb 25 2013 19:19:48) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.4.0, Copyright (c) 1998-2013 Zend Technologies with Xdebug v2.2.1, Copyright (c) 2002-2012, by Derick Rethans