note 87663 added to function.ziparchive-addfile
| From: | marco at maranao dot ca | Date: | Mon, 15 Dec 2008 18:45:46 +0000 |
| Subject: | note 87663 added to function.ziparchive-addfile | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-148193@lists.php.net to get a copy of this message | ||
This is my workaround for the file descriptor limit by closing/opening the archive file
periodically.
if($backup = new ZipArchive()) {
if($backup->open($zip, ZIPARCHIVE::OVERWRITE) === true) {
$backup->addFile($file['realpath'], $file['path']);
if(($count++) == 200) { // the file descriptor limit
$backup->close();
if($backup = new ZipArchive()) {
$backup->open($zip);
$count = 0;
}
}
}
$backup->close();
}
Hope it helps someone.
----
Server IP: 66.207.199.35
Probable Submitter: 68.145.111.192
----
Manual Page -- http://www.php.net/manual/en/function.ziparchive-addfile.php
Edit -- https://master.php.net/note/edit/87663
Del: integrated -- https://master.php.net/note/delete/87663/integrated
Del: useless -- https://master.php.net/note/delete/87663/useless
Del: bad code -- https://master.php.net/note/delete/87663/bad+code
Del: spam -- https://master.php.net/note/delete/87663/spam
Del: non-english -- https://master.php.net/note/delete/87663/non-english
Del: in docs -- https://master.php.net/note/delete/87663/in+docs
Del: other reasons-- https://master.php.net/note/delete/87663
Reject -- https://master.php.net/note/reject/87663
Search -- https://master.php.net/manage/user-notes.php