original_string: public function zip_plugin_folder($folderpath, $targetzip) {
  
          if (file_exists($targetzip)) {
              throw new coding_exception('Attempting to create already existing ZIP file', $targetzip);
          }
  
          if (!is_writable(dirname($targetzip))) {
              throw new coding_exception('Target ZIP location not writable', dirname($targetzip));
          }
  
          if (!is_dir($folderpath)) {
              throw new coding_exception('Attempting to ZIP non-existing source directory', $folderpath);
          }
  
          $files = $this->list_plugin_folder_files($folderpath);
          $fp = get_file_packer('application/zip');
          return $fp->archive_to_pathname($files, $targetzip, false);
      }
code: public function zip_plugin_folder($folderpath, $targetzip) {
  
          if (file_exists($targetzip)) {
              throw new coding_exception('Attempting to create already existing ZIP file', $targetzip);
          }
  
          if (!is_writable(dirname($targetzip))) {
              throw new coding_exception('Target ZIP location not writable', dirname($targetzip));
          }
  
          if (!is_dir($folderpath)) {
              throw new coding_exception('Attempting to ZIP non-existing source directory', $folderpath);
          }
  
          $files = $this->list_plugin_folder_files($folderpath);
          $fp = get_file_packer('application/zip');
          return $fp->archive_to_pathname($files, $targetzip, false);
      }
code_tokens: public function zip_plugin_folder ( $ folderpath , $ targetzip ) { if ( file_exists ( $ targetzip ) ) { throw new coding_exception ( 'Attempting to create already existing ZIP file' , $ targetzip ) ; } if ( ! is_writable ( dirname ( $ targetzip ) ) ) { throw new coding_exception ( 'Target ZIP location not writable' , dirname ( $ targetzip ) ) ; } if ( ! is_dir ( $ folderpath ) ) { throw new coding_exception ( 'Attempting to ZIP non-existing source directory' , $ folderpath ) ; } $ files = $ this -> list_plugin_folder_files ( $ folderpath ) ; $ fp = get_file_packer ( 'application/zip' ) ; return $ fp -> archive_to_pathname ( $ files , $ targetzip , false ) ; }
docstring: Make an archive backup of the existing plugin folder.
  
  @param string $folderpath full path to the plugin folder
  @param string $targetzip full path to the zip file to be created
  @return bool true if file created, false if not
docstring_tokens: Make an archive backup of the existing plugin folder .