original_string: protected function get_packer_for_read_operation($archivefile) {
          global $CFG;
          require_once($CFG->dirroot . '/lib/filestorage/tgz_packer.php');
  
          if (tgz_packer::is_tgz_file($archivefile)) {
              return get_file_packer('application/x-gzip');
          } else {
              return get_file_packer('application/zip');
          }
      }
code: protected function get_packer_for_read_operation($archivefile) {
          global $CFG;
          require_once($CFG->dirroot . '/lib/filestorage/tgz_packer.php');
  
          if (tgz_packer::is_tgz_file($archivefile)) {
              return get_file_packer('application/x-gzip');
          } else {
              return get_file_packer('application/zip');
          }
      }
code_tokens: protected function get_packer_for_read_operation ( $ archivefile ) { global $ CFG ; require_once ( $ CFG -> dirroot . '/lib/filestorage/tgz_packer.php' ) ; if ( tgz_packer :: is_tgz_file ( $ archivefile ) ) { return get_file_packer ( 'application/x-gzip' ) ; } else { return get_file_packer ( 'application/zip' ) ; } }
docstring: Selects appropriate packer for existing archive depending on file contents.
  
  @param string|stored_file $archivefile full pathname of zip file or stored_file instance
  @return file_packer Suitable packer
docstring_tokens: Selects appropriate packer for existing archive depending on file contents .