mirror of
https://github.com/opencultureconsulting/simple-oai-pmh.git
synced 2025-04-13 00:00:28 +02:00
Reindentinf + fixing error messages
This commit is contained in:
parent
d3ec5f3d7c
commit
04669d927b
5
oai2.php
5
oai2.php
@ -30,11 +30,6 @@
|
|||||||
* For generic usage, you can try the ANDS_Response_XML defined in xml_creater.php.
|
* For generic usage, you can try the ANDS_Response_XML defined in xml_creater.php.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// Report all errors except E_NOTICE
|
|
||||||
// This is the default value set in php.ini
|
|
||||||
// If anything else, try them.
|
|
||||||
// error_reporting (E_ALL ^ E_NOTICE);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An array for collecting erros which can be reported later. It will be checked before a new action is taken.
|
* An array for collecting erros which can be reported later. It will be checked before a new action is taken.
|
||||||
*/
|
*/
|
||||||
|
@ -25,7 +25,6 @@
|
|||||||
*
|
*
|
||||||
* \see http://www.openarchives.org/OAI/openarchivesprotocol.html#ErrorConditions
|
* \see http://www.openarchives.org/OAI/openarchivesprotocol.html#ErrorConditions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
http://www.openarchives.org/OAI/openarchivesprotocol.html#ErrorConditions
|
http://www.openarchives.org/OAI/openarchivesprotocol.html#ErrorConditions
|
||||||
|
|
||||||
@ -56,15 +55,15 @@ noSetHierarchy:
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/** utility funciton to mapping error codes to readable messages */
|
/** utility funciton to mapping error codes to readable messages */
|
||||||
function oai_error($code, $argument = '', $value = '')
|
function oai_error($code, $argument = '', $value = '') {
|
||||||
{
|
|
||||||
switch ($code) {
|
switch ($code) {
|
||||||
case 'badArgument' :
|
case 'badArgument' :
|
||||||
$text = "Attribute '{$argument}' is not allowed to appear in element 'request'";
|
$text = "Attribute '{$argument}' is not allowed to appear in element 'request'.";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'badGranularity' :
|
case 'badGranularity' :
|
||||||
$text = "The value '{$value}' of the argument '{$argument}' is not valid.";
|
$text = "The value '{$value}' of attribute '{$argument}' on element 'request' is not valid with respect to its type, 'UTCdatetimeType'.";
|
||||||
$code = 'badArgument';
|
$code = 'badArgument';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -78,7 +77,7 @@ function oai_error($code, $argument = '', $value = '')
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 'badVerb' :
|
case 'badVerb' :
|
||||||
$text = "The verb '{$argument}' provided in the request is illegal.";
|
$text = "The value '{$argument}' of attribute 'verb' on element 'request' is not valid with respect to its type, 'verbType'";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'cannotDisseminateFormat' :
|
case 'cannotDisseminateFormat' :
|
||||||
@ -191,7 +190,6 @@ class ANDS_XML {
|
|||||||
return $added_node;
|
return $added_node;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create an OAI request node.
|
* Create an OAI request node.
|
||||||
*
|
*
|
||||||
@ -252,7 +250,7 @@ class ANDS_Response_XML extends ANDS_XML {
|
|||||||
$this->verbNode = $this->addChild($this->doc->documentElement,$this->verb);
|
$this->verbNode = $this->addChild($this->doc->documentElement,$this->verb);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Add direct child nodes to verb node (OAI-PMH), e.g. response to ListMetadataFormats.
|
/** Add direct child nodes to verb node (OAI-PMH), e.g. response to ListMetadataFormats.
|
||||||
* Different verbs can have different required child nodes.
|
* Different verbs can have different required child nodes.
|
||||||
* \see create_record, create_header
|
* \see create_record, create_header
|
||||||
* \see http://www.openarchives.org/OAI/2.0/openarchivesprotocol.htm.
|
* \see http://www.openarchives.org/OAI/2.0/openarchivesprotocol.htm.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user