You are here

function EndNoteXMLParser::biblio_xml_check_md5 in Bibliography Module 6.2

Same name and namespace in other branches
  1. 7 modules/endnote/endnote_xml_parser.inc \EndNoteXMLParser::biblio_xml_check_md5()
  2. 7.2 modules/endnote/endnote_xml_parser.inc \EndNoteXMLParser::biblio_xml_check_md5()
2 calls to EndNoteXMLParser::biblio_xml_check_md5()
EndNoteXMLParser::endnote7_endElement in modules/endnote/endnote_xml_parser.inc
EndNoteXMLParser::endnote8_endElement in modules/endnote/endnote_xml_parser.inc

File

modules/endnote/endnote_xml_parser.inc, line 431

Class

EndNoteXMLParser

Code

function biblio_xml_check_md5($md5) {
  static $xml_md5s = array();
  if (empty($xml_md5s)) {
    $result = db_query("SELECT * FROM {biblio_xml} ");
    while ($row = db_fetch_object($result)) {
      $xml_md5s[$row->biblio_xml_md5] = $row->nid;
    }
  }
  if (isset($xml_md5s[$md5])) {
    return $xml_md5s[$md5];
  }
  else {
    $xml_md5s[$md5] = TRUE;

    // gaurd against duplicates in the same import
    return;
  }
}