chamilo / pclzip

Unofficial PclZip library loosely maintained for PHP 7.4 by the Chamilo team, from static PclZip 2.8.4
GNU Affero General Public License v3.0
19 stars 27 forks source link

zip file is not created in php 8.0 #3

Open sandeepavasthi01 opened 2 years ago

sandeepavasthi01 commented 2 years ago

Errors are coming on PHP 8.0

Fatal error: Uncaught ValueError: Path cannot be empty in /var/www/html/socialapp/ls-local/pclzip.lib.php:2353 Stack trace:

0 /var/www/html/socialapp/ls-local/pclzip.lib.php(2353): fopen()

1 /var/www/html/socialapp/ls-local/pclzip.lib.php(2133): PclZip->privOpenFd()

2 /var/www/html/socialapp/ls-local/pclzip.lib.php(2169): PclZip->privCreate()

3 /var/www/html/socialapp/ls-local/pclzip.lib.php(592): PclZip->privAdd()

4 /var/www/html/socialapp/ls-local/index.php(404): PclZip->add()

5 {main}

thrown in /var/www/html/socialapp/ls-local/pclzip.lib.php on line 2353

PHP Platform : 8.0

jawharjob commented 1 year ago

I have the same problem

sandeepavasthi01 commented 1 year ago

I have the same problem

You have used $zip = new ZipArchive; this function in php 8.0

williamdes commented 2 months ago

Read the code and you will notice that new PclZip() needs a first argument to set the zipname and fopen should be happy let me know