From 67acc1e2cb31fc68528a2be9c617e9766405f03f Mon Sep 17 00:00:00 2001 From: Sebastian Meyer Date: Wed, 8 Jan 2020 16:03:16 +0100 Subject: [PATCH] Rename metadataFormats to metadataPrefix --- index.php | 6 +++--- oai2config.php | 2 +- update.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/index.php b/index.php index a20fc4c..479018a 100644 --- a/index.php +++ b/index.php @@ -29,7 +29,7 @@ $deleted = array(); $timestamps = array(); $earliest = time(); -foreach($config['metadataFormats'] as $prefix => $uris) { +foreach($config['metadataPrefix'] as $prefix => $uris) { $files = glob(rtrim($config['dataDirectory'], '/').'/'.$prefix.'/*.xml'); foreach($files as $file) { $records[$prefix][pathinfo($file, PATHINFO_FILENAME)] = $file; @@ -112,7 +112,7 @@ $oai2 = new OAI2Server( $formats = array(); foreach($records as $format => $record) { if (!empty($record[$identifier])) { - $formats[$format] = $config['metadataFormats'][$format]; + $formats[$format] = $config['metadataPrefix'][$format]; } } if (!empty($formats)) { @@ -121,7 +121,7 @@ $oai2 = new OAI2Server( throw new OAI2Exception('idDoesNotExist'); } } else { - return $config['metadataFormats']; + return $config['metadataPrefix']; } } ), diff --git a/oai2config.php b/oai2config.php index d997772..d0be1e7 100644 --- a/oai2config.php +++ b/oai2config.php @@ -49,7 +49,7 @@ $config['deletedRecord'] = 'transient'; // but technically you can deliver any XML based data format you want. Just add // another entry with the 'metadataPrefix' as key and schema/namespace URIs as // array values or replace the default 'oai_dc' entry (not recommended). -$config['metadataFormats'] = array( +$config['metadataPrefix'] = array( 'oai_dc' => array( 'schema' => 'http://www.openarchives.org/OAI/2.0/oai_dc.xsd', 'namespace' => 'http://www.openarchives.org/OAI/2.0/oai_dc/', diff --git a/update.php b/update.php index 03f34ca..1aea31d 100644 --- a/update.php +++ b/update.php @@ -56,7 +56,7 @@ if (empty($argc) || $argc != 3) { } list(, $sourceDir, $metadataPrefix) = $argv; // Check metadataPrefix -if (empty($config['metadataFormats'][$metadataPrefix])) { +if (empty($config['metadataPrefix'][$metadataPrefix])) { echo "Error: metadataPrefix $metadataPrefix not defined in oai2config.php\n"; exit; }