public function merge(string $output_zip_file, bool $separate = true): bool {

        $pathinfo = pathinfo($output_zip_file);
        $temporary_folder = $pathinfo['dirname']."/".ManagerTools::getTemporaryFolder();

        try {

            $this->extract($temporary_folder, $separate);
            $zip = Zip::create($output_zip_file);
            $zip->add($temporary_folder, true)->close();
            ManagerTools::recursiveUnlink($temporary_folder);
            return true;

        } catch (ZipException $ze) {
            throw $ze;
        } catch (Exception $e) {
            throw $e;
        }

    }
public function merge(string $output_zip_file, bool $separate = true): bool {

        $pathinfo = pathinfo($output_zip_file);
        $temporary_folder = $pathinfo['dirname']."/".ManagerTools::getTemporaryFolder();

        try {

            $this->extract($temporary_folder, $separate);
            $zip = Zip::create($output_zip_file);
            $zip->add($temporary_folder, true)->close();
            ManagerTools::recursiveUnlink($temporary_folder);
            return true;

        } catch (ZipException $ze) {
            throw $ze;
        } catch (Exception $e) {
            throw $e;
        }

    }
public function merge ( string $ output_zip_file , bool $ separate = true ) : bool { $ pathinfo = pathinfo ( $ output_zip_file ) ; $ temporary_folder = $ pathinfo [ 'dirname' ] . "/" . ManagerTools :: getTemporaryFolder ( ) ; try { $ this -> extract ( $ temporary_folder , $ separate ) ; $ zip = Zip :: create ( $ output_zip_file ) ; $ zip -> add ( $ temporary_folder , true ) -> close ( ) ; ManagerTools :: recursiveUnlink ( $ temporary_folder ) ; return true ; } catch ( ZipException $ ze ) { throw $ ze ; } catch ( Exception $ e ) { throw $ e ; } }
Merge multiple Zips into one

@param string $output_zip_file
Destination zip
@param bool $separate (optional)
If true (default), files will be placed in different directories

@return bool
@throws ZipException
Merge multiple Zips into one