Skip to content
This repository was archived by the owner on Mar 9, 2023. It is now read-only.

Update of the FACT-Finder PHP library and solution for #117 #132

Merged
merged 1 commit into from
Mar 3, 2016
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
17 changes: 15 additions & 2 deletions src/lib/FACTFinder/Adapter/AbstractAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ protected function useJsonResponseContentProcessor()
"json_decode() raised an error: ".json_last_error()
);

if(is_array($jsonData) && isset($jsonData['error'])) {
$this->log->error("FACT-Finder returned error: " . strip_tags($jsonData['error']));
if(isset($jsonData['stacktrace'])) {
$this->log->error("Stacktrace:\n" . $jsonData['stacktrace']);
}
}
return $jsonData;
};
}
Expand All @@ -113,7 +119,14 @@ protected function useXmlResponseContentProcessor()
$this->responseContentProcessor = function($string) {
libxml_use_internal_errors(true);
// The constructor throws an exception on error
return new \SimpleXMLElement($string);
$response = new \SimpleXMLElement($string);
if(isset($response->error)) {
$this->log->error("FACT-Finder returned error: " . strip_tags($response->error));
if(isset($response->stacktrace)) {
$this->log->error("Stacktrace:\n" . $response->stacktrace);
}
}
return $response;
};
}

Expand Down Expand Up @@ -153,7 +166,7 @@ protected function getResponseContent()
// properties

if($content !== null) {
$this->responseContent = $this->responseContentProcessor->__invoke($content);
$this->responseContent = $this->responseContentProcessor->__invoke($content);
if ($this->encodingConverter != null)
{
$this->responseContent = $this->encodingConverter->encodeContentForPage($this->responseContent);
Expand Down
279 changes: 0 additions & 279 deletions src/lib/FACTFinder/Adapter/ScicTracking.php

This file was deleted.

Loading