original_string: public function zip_tempfiles($filename='portfolio-export.zip', $filepath='/final/') {
          $zipper = new zip_packer();
  
          list ($contextid, $component, $filearea, $itemid) = array_values($this->get_base_filearea());
          if ($newfile = $zipper->archive_to_storage($this->get_tempfiles(), $contextid, $component, $filearea, $itemid, $filepath, $filename, $this->user->id)) {
              return $newfile;
          }
          return false;
  
      }
code: public function zip_tempfiles($filename='portfolio-export.zip', $filepath='/final/') {
          $zipper = new zip_packer();
  
          list ($contextid, $component, $filearea, $itemid) = array_values($this->get_base_filearea());
          if ($newfile = $zipper->archive_to_storage($this->get_tempfiles(), $contextid, $component, $filearea, $itemid, $filepath, $filename, $this->user->id)) {
              return $newfile;
          }
          return false;
  
      }
code_tokens: public function zip_tempfiles ( $ filename = 'portfolio-export.zip' , $ filepath = '/final/' ) { $ zipper = new zip_packer ( ) ; list ( $ contextid , $ component , $ filearea , $ itemid ) = array_values ( $ this -> get_base_filearea ( ) ) ; if ( $ newfile = $ zipper -> archive_to_storage ( $ this -> get_tempfiles ( ) , $ contextid , $ component , $ filearea , $ itemid , $ filepath , $ filename , $ this -> user -> id ) ) { return $ newfile ; } return false ; }
docstring: Zips all files in the temporary directory
  
  @param string $filename name of resulting zipfile (optional, defaults to portfolio-export.zip)
  @param string $filepath subpath in the filearea (optional, defaults to final)
  @return stored_file|bool resulting stored_file object, or false
docstring_tokens: Zips all files in the temporary directory