/** * Controls the actual harvesting */ function harvest() { $oaisp = new OAIServiceProvider($this->config['oai_server'], $this->logger); try { $params = array('metadataPrefix' => $this->config['metadataPrefix']); if (!@$this->config['full_harvest']) { $params['from'] = $this->get_last_datestamp(); } $oaisp->query_listrecords(array($this, 'record_reader'), $params); } catch (OAIServiceProviderOAIErrorNoRecordsMatchException $e) { $this->log('no new records.'); } }
function __test($server_url) { try { $oaisp = new OAIServiceProvider($server_url); $oaisp->query_identify(array($oaisp, '__test_xml_dump')); //$oaisp->query_listsets(array($oaisp,'__test_xml_dump')); $oaisp->query_listmetadataformats(array($oaisp, '__test_xml_dump')); $oaisp->query_listidentifiers(array($oaisp, '__test_xml_dump'), array('metadataPrefix' => 'oas')); $oaisp->query_listrecords(array($oaisp, '__test_xml_dump'), array('metadataPrefix' => 'oas')); } catch (Exception $e) { echo "Error:\n"; var_dump($e); } }