From: skodak Date: Tue, 30 Dec 2008 19:17:39 +0000 (+0000) Subject: MDL-15928 PHP 5.2.8 has new zip support - all know problems seem to be solved - yay! X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=af9b269cb8157f8fb35b5cc08ddd91f6ae6aaeb8;p=moodle.git MDL-15928 PHP 5.2.8 has new zip support - all know problems seem to be solved - yay! --- diff --git a/lib/packer/zip_archive.php b/lib/packer/zip_archive.php index c889235d6e..7cae281fe1 100644 --- a/lib/packer/zip_archive.php +++ b/lib/packer/zip_archive.php @@ -189,12 +189,14 @@ class zip_archive extends file_archive { return false; } - if ($this->count() > 0 and $this->count() % 500 === 0) { - // workaround for open file handles problem, ZipArchive uses file locking in order to prevent file modifications before the close() (strange, eh?) - $this->close(); - $res = $this->open($this->archivepathname, file_archive::OPEN, $this->encoding); - if ($res !== true) { - print_error('cannotopenzip'); //TODO ?? + if (!check_php_version('5.2.8')) { + // workaround for open file handles problem, ZipArchive uses file locking in order to prevent file modifications before the close() (strange, eh?) + if ($this->count() > 0 and $this->count() % 500 === 0) { + $this->close(); + $res = $this->open($this->archivepathname, file_archive::OPEN, $this->encoding); + if ($res !== true) { + print_error('cannotopenzip'); //TODO ?? + } } }