Closed nabeeljavaid closed 2 years ago
I have the same issue? any workarounds?
I have worked around by overriding the class:
<?php
namespace App\Classes\Zip;
class Zip extends \ZanySoft\Zip\Zip{
/**
* Class constructor
*
* @param string $zip_file ZIP file name
*
*/
public function __construct($zip_file)
{
if (empty($zip_file)) {
throw new \Exception(self::getStatus(ZipArchive::ER_NOENT));
}
if(is_string($zip_file) == true) {
$this->zip_file = $zip_file;
}
}
}
And in my controller i use use App\Classes\Zip\Zip;
or whatever namespace you have.
Same issue, using Laravel 9
use the workaround suggested by @giagara
Use V2 if you are using PHP 7.4+ or 8.x
@zanysoft It is V2 that has the issue
@zanysoft the problem is relevant
any solution?
Hi, I have recently upgraded the package and now I am getting following error, I think $zip_file must be type of object not string
Error: Cannot assign Illuminate\Foundation\Application to property ZanySoft\Zip\Zip::$zip_file of type ?string Code:
$zipFiles = [ '/var/www/cml/public/data/temp/new/01.pdf', '/var/www/cml/public/data/temp/new/02.pdf', '/var/www/cml/public/data/temp/new/02.pdf', ]; $zip = Zip::create('/var/www/cml/public/data/temp/new.zip'); $zip->add($zipFiles); $zip->close();
Screenshot: