protected function pack_files($filesforzipping) {
        global $CFG;
        // Create path for new zip file.
        $tempzip = tempnam($CFG->tempdir . '/', 'assignment_');
        // Zip files.
        $zipper = new zip_packer();
        if ($zipper->archive_to_pathname($filesforzipping, $tempzip)) {
            return $tempzip;
        }
        return false;
    }
protected function pack_files($filesforzipping) {
        global $CFG;
        // Create path for new zip file.
        $tempzip = tempnam($CFG->tempdir . '/', 'assignment_');
        // Zip files.
        $zipper = new zip_packer();
        if ($zipper->archive_to_pathname($filesforzipping, $tempzip)) {
            return $tempzip;
        }
        return false;
    }
protected function pack_files ( $ filesforzipping ) { global $ CFG ; // Create path for new zip file. $ tempzip = tempnam ( $ CFG -> tempdir . '/' , 'assignment_' ) ; // Zip files. $ zipper = new zip_packer ( ) ; if ( $ zipper -> archive_to_pathname ( $ filesforzipping , $ tempzip ) ) { return $ tempzip ; } return false ; }
Generate zip file from array of given files.

@param array $filesforzipping - array of files to pass into archive_to_pathname.
This array is indexed by the final file name and each
element in the array is an instance of a stored_file object.
@return path of temp file - note this returned file does
not have a .zip extension - it is a temp file.
Generate zip file from array of given files .