]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-15928 PHP 5.2.8 has new zip support - all know problems seem to be solved - yay!
authorskodak <skodak>
Tue, 30 Dec 2008 19:17:39 +0000 (19:17 +0000)
committerskodak <skodak>
Tue, 30 Dec 2008 19:17:39 +0000 (19:17 +0000)
lib/packer/zip_archive.php

index c889235d6eda97b0ccc7853c7de8135c71167601..7cae281fe1d0057473fd4e42b8941561a5b9f7f1 100644 (file)
@@ -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 ??
+                }
             }
         }