-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
32 lines (27 loc) · 1.06 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
require_once('inc/init.php');
$oai2 = new OAI2Server(get_conf('baseURL'), $_GET, identifyResponse(), get_conf('listSize'),
array(
'ListMetadataFormats' =>
function($identifier = '') {
return ListMetadataFormats($identifier);
},
'ListSets' => function($count, $maxItems=5, $resumptionToken='') {
return listSets($count, $maxItems, $resumptionToken);
},
'ListRecords' =>
# TODO better order, put maxitems before count
function($metadataPrefix, $from='', $until='', $set='', $count=false, $list_records, $deliveredRecords=0, $maxItems=5) {
return ListRecords($metadataPrefix, $from, $until, $set, $count, $list_records, $deliveredRecords, $maxItems);
},
'GetRecord' =>
function($identifier, $metadataPrefix) {
return GetRecord($identifier, $metadataPrefix);
},
)
);
$response = $oai2->response();
$response->formatOutput = true;
$response->preserveWhiteSpace = false;
header('Content-Type: text/xml');
echo $response->saveXML();