From af9b269cb8157f8fb35b5cc08ddd91f6ae6aaeb8 Mon Sep 17 00:00:00 2001 From: skodak Date: Tue, 30 Dec 2008 19:17:39 +0000 Subject: [PATCH] MDL-15928 PHP 5.2.8 has new zip support - all know problems seem to be solved - yay! --- lib/packer/zip_archive.php | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) 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 ?? + } } } -- 2.39.5