| Conditions | 2 |
| Paths | 6 |
| Total Lines | 13 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 5 | public function resolve(int $timeout): ?EasyRdf\Resource |
||
| 6 | { |
||
| 7 | try { |
||
| 8 | // change the timeout setting for external requests |
||
| 9 | $httpclient = EasyRdf\Http::getDefaultHttpClient(); |
||
| 10 | $httpclient->setConfig(array('timeout' => $timeout, 'useragent' => 'Skosmos')); |
||
| 11 | EasyRdf\Http::setDefaultHttpClient($httpclient); |
||
| 12 | |||
| 13 | $graph = EasyRdf\Graph::newAndLoad(EasyRdf\Utils::removeFragmentFromUri($this->uri)); |
||
| 14 | return $graph->resource($this->uri); |
||
| 15 | } catch (Exception $e) { |
||
| 16 | $this->model->getLogger()->info("LD resolution failed for <{$this->uri}>: $e"); |
||
| 17 | return null; |
||
| 18 | } |
||
| 23 |