fixes indents whole file

This commit is contained in:
Rodrigo de Oliveira 2021-04-17 18:05:11 -03:00
parent 87912f3153
commit faa6783af0
1 changed files with 863 additions and 867 deletions

View File

@ -42,11 +42,10 @@ class Oaipmh_Importer extends Importer {
$this->remove_import_method('file'); $this->remove_import_method('file');
$this->add_import_method('url'); $this->add_import_method('url');
} }
/** /**
* Method implemented by the child importer class to proccess each item * Method implemented by child importer class to proccess each item
* @return int * @return int
*/ */
public function process_item( $index, $collection_id ){ public function process_item( $index, $collection_id ){
@ -54,8 +53,7 @@ class Oaipmh_Importer extends Importer {
$records = [ 'records' => [] , 'collection_definition' => $collection_id ]; $records = [ 'records' => [] , 'collection_definition' => $collection_id ];
$record_processed = []; $record_processed = [];
if( $index === 0 ){ if ($index === 0) {
if( $collection_id['source_id'] !== 'sets' && $this->has_sets ){ if( $collection_id['source_id'] !== 'sets' && $this->has_sets ){
$info = $this->requester( $this->get_url() . "?verb=ListRecords&metadataPrefix=oai_dc&set=" . $collection_id['source_id'] ); $info = $this->requester( $this->get_url() . "?verb=ListRecords&metadataPrefix=oai_dc&set=" . $collection_id['source_id'] );
$this->add_log('fetching ' . $this->get_url() . "?verb=ListRecords&metadataPrefix=oai_dc&set=" . $collection_id['source_id']); $this->add_log('fetching ' . $this->get_url() . "?verb=ListRecords&metadataPrefix=oai_dc&set=" . $collection_id['source_id']);
@ -63,19 +61,17 @@ class Oaipmh_Importer extends Importer {
$info = $this->requester( $this->get_url() . "?verb=ListRecords&metadataPrefix=oai_dc" ); $info = $this->requester( $this->get_url() . "?verb=ListRecords&metadataPrefix=oai_dc" );
$this->add_log('fetching ' . $this->get_url() . "?verb=ListRecords&metadataPrefix=oai_dc"); $this->add_log('fetching ' . $this->get_url() . "?verb=ListRecords&metadataPrefix=oai_dc");
} }
} else { } else {
$token = $this->get_transient('resumptionToken'); $token = $this->get_transient('resumptionToken');
$info = $this->requester( $this->get_url() . "?verb=ListRecords&resumptionToken=" . $token); $info = $this->requester( $this->get_url() . "?verb=ListRecords&resumptionToken=" . $token);
$this->add_log('fetching ' . $this->get_url() . "?verb=ListRecords&resumptionToken=" . $token); $this->add_log('fetching ' . $this->get_url() . "?verb=ListRecords&resumptionToken=" . $token);
} }
if( !isset($info['body']) ){ if (!isset($info['body'])) {
$this->add_log('no answer'); $this->add_log('no answer');
return false; return false;
} }
try { try {
$xml = new \SimpleXMLElement($info['body']); $xml = new \SimpleXMLElement($info['body']);