Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/fetchers/Oaipmh.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public function __construct($settings)
if (isset($settings['MANIPULATORS']['fetchermanipulators'])) {
$this->fetchermanipulators = $settings['MANIPULATORS']['fetchermanipulators'];
} else {
$this->fetchermanipulators = null;
$this->fetchermanipulators = array();
}

if (!$this->createTempDirectory()) {
Expand All @@ -77,7 +77,10 @@ public function getRecords($limit = null)
$endpoint = new Endpoint($client);
$records = $endpoint->listRecords($this->metadataPrefix, $this->from, $this->until, $this->setSpec);
foreach ($records as $rec) {
$identifier = urlencode($rec->header->identifier);
$identifier = ($rec->header->identifier);
$identifier = json_decode(json_encode($identifier), 1)[0];
$identifier = urlencode(str_replace(':', '_', $identifier));

file_put_contents($this->tempDirectory . DIRECTORY_SEPARATOR . $identifier .
'.metadata', $rec->asXML());
// MIK expects each record to be an object with a ->key property.
Expand Down
6 changes: 3 additions & 3 deletions src/writers/Oaipmh.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ public function writePackages($metadata, $pages, $record_id)
$output_path = $this->outputDirectory . DIRECTORY_SEPARATOR;

$normalized_record_id = $this->normalizeFilename($record_id);
$metadata_file_path = $output_path . $normalized_record_id . '.xml';

$metadata_file_path = $output_path . urlencode($normalized_record_id) . '.xml';
/*
$subdirectory = explode("/", $normalized_record_id);
$subdirectory_path = $output_path;

Expand All @@ -82,7 +82,7 @@ public function writePackages($metadata, $pages, $record_id)
mkdir($subdirectory_path);
}
}

*/
$this->writeMetadataFile($metadata, $metadata_file_path, true);

if ($this->metadata_only) {
Expand Down