The Gitlab instance will be restarted on Monday April 28th at 2AM. There will be a short interruption of service.

Skip to content
Snippets Groups Projects
Commit bf856047 authored by Demian Katz's avatar Demian Katz
Browse files

Fixed support for large docs; improved error message.

parent b3db12fd
No related merge requests found
...@@ -495,7 +495,7 @@ class OAI ...@@ -495,7 +495,7 @@ class OAI
sleep($delay); sleep($delay);
} }
} else if (!$result->isSuccess()) { } else if (!$result->isSuccess()) {
throw new \Exception('HTTP Error'); throw new \Exception('HTTP Error ' . $result->getStatusCode());
} else { } else {
// If we didn't get an error, we can leave the retry loop: // If we didn't get an error, we can leave the retry loop:
break; break;
...@@ -558,8 +558,10 @@ class OAI ...@@ -558,8 +558,10 @@ class OAI
$xml = $this->sanitizeXML($xml); $xml = $this->sanitizeXML($xml);
} }
// Parse the XML: // Parse the XML (newer versions of LibXML require a special flag for
$result = simplexml_load_string($xml); // large documents, and responses may be quite large):
$flags = LIBXML_VERSION >= 20900 ? LIBXML_PARSEHUGE : 0;
$result = simplexml_load_string($xml, null, $flags);
if (!$result) { if (!$result) {
throw new \Exception("Problem loading XML: {$xml}"); throw new \Exception("Problem loading XML: {$xml}");
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment