Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.5.0

Bug #19661 addModify is very slow in a loop
Submitted: 2012-10-22 02:23 UTC
From: aneeska Assigned:
Status: Bogus Package: Archive_Tar (version 1.3.10)
PHP Version: 5.3.7 OS: linux
Roadmaps: 1.3.11    
Subscription  


 [2012-10-22 02:23 UTC] aneeska (anees ka)
Description: ------------ $tar = new Archive_Tar($destination, true); $count = 0; foreach ($valid_files as $first) { $prefix = substr ($first, 0, (strrpos ($first, '/')+1)); $tar->addModify ($first, '', $prefix); $count++; echo "count = ".$count." prefix = ".$prefix." <br/>"; } Expected result: ---------------- I am expecting a tar file by the name $destination Actual result: -------------- I have 188 files to tar and this loop is painfully slow. It takes a long time to create the tar file. Is there anything wrong with the way I have written the code?

Comments

 [2012-10-25 01:59 UTC] mrook (Michiel Rook)
Passing an array instead of individual filenames into addModify() is quite a bit faster :)
 [2012-11-12 18:21 UTC] mrook (Michiel Rook)
-Status: Open +Status: Bogus
Sorry, but your problem does not imply a bug in PEAR itself. For a list of more appropriate places to ask for help using PEAR, please visit http://pear.php.net/support/ as this bug system is not the appropriate forum for asking support questions. Thank you for your interest in PEAR. See my above comment, if you have issues with the package please (re)open a ticket or send a mail directly to me :)