original_string: public static function backup_includes_file_references($backupid) {
          global $CFG, $DB;
  
          $sql = "SELECT count(r.repositoryid)
                    FROM {files} f
                    LEFT JOIN {files_reference} r
                         ON r.id = f.referencefileid
                    JOIN {backup_ids_temp} bi
                         ON f.id = bi.itemid
                   WHERE bi.backupid = ?
                         AND bi.itemname = 'filefinal'";
          $count = $DB->count_records_sql($sql, array($backupid));
          return (int)(bool)$count;
      }
code: public static function backup_includes_file_references($backupid) {
          global $CFG, $DB;
  
          $sql = "SELECT count(r.repositoryid)
                    FROM {files} f
                    LEFT JOIN {files_reference} r
                         ON r.id = f.referencefileid
                    JOIN {backup_ids_temp} bi
                         ON f.id = bi.itemid
                   WHERE bi.backupid = ?
                         AND bi.itemname = 'filefinal'";
          $count = $DB->count_records_sql($sql, array($backupid));
          return (int)(bool)$count;
      }
code_tokens: public static function backup_includes_file_references ( $ backupid ) { global $ CFG , $ DB ; $ sql = "SELECT count(r.repositoryid)
                    FROM {files} f
                    LEFT JOIN {files_reference} r
                         ON r.id = f.referencefileid
                    JOIN {backup_ids_temp} bi
                         ON f.id = bi.itemid
                   WHERE bi.backupid = ?
                         AND bi.itemname = 'filefinal'" ; $ count = $ DB -> count_records_sql ( $ sql , array ( $ backupid ) ) ; return ( int ) ( bool ) $ count ; }
docstring: Given the backupid, detect if the backup contains references to external contents
  
  @copyright 2012 Dongsheng Cai {@link http://dongsheng.org}
  @return int
docstring_tokens: Given the backupid detect if the backup contains references to external contents