From 52eb3ed48d31f77d9c0b376b3d460a4cbe5b4d22 Mon Sep 17 00:00:00 2001 From: Nicolas Le Goff Date: Tue, 23 Oct 2012 18:01:21 +0200 Subject: [PATCH] Update functions signature for compatibility with PHP 5.4 --- lib/classes/ZipArchiveImproved.class.php | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/lib/classes/ZipArchiveImproved.class.php b/lib/classes/ZipArchiveImproved.class.php index 6a07b40a31..c0a33ef9d2 100644 --- a/lib/classes/ZipArchiveImproved.class.php +++ b/lib/classes/ZipArchiveImproved.class.php @@ -61,7 +61,7 @@ class ZipArchiveImproved extends ZipArchive * @param int $flags * return mixed */ - public function open($fileName, $flags) + public function open($fileName, $flags = null) { $this->_archiveFileName = $fileName; $this->_newAddedFilesCounter = 0; @@ -106,26 +106,18 @@ class ZipArchiveImproved extends ZipArchive * @param string [optional] $localname the name of the file in the ZIP archive * @return bool */ - public function addFile($fileName) + public function addFile($fileName, $localname = null, $start = 0, $length = 0) { if ($this->_newAddedFilesCounter >= $this->_newAddedFilesSize) { $this->reopen(); } - if (func_num_args() > 1) { - $flags = func_get_arg(1); - $added = parent::addFile($fileName, $flags); - if ($added) { - $this->_newAddedFilesCounter ++; - } - return $added; - } - $added = parent::addFile($fileName); + $added = parent::addFile($fileName, $localname, $start, $length); + if ($added) { $this->_newAddedFilesCounter ++; } return $added; } -// public function addFile() }