Skip to content

Latest commit

 

History

History
21 lines (16 loc) · 641 Bytes

File metadata and controls

21 lines (16 loc) · 641 Bytes

Working with HTTP-Clients

Change timeout and other settings

/**
 * Change the timeout setting for external requests
 *
 * @source https://github.com/NatLibFi/Skosmos/blob/main/src/model/resolver/LinkedDataResource.php
 */
$httpclient = EasyRdf\Http::getDefaultHttpClient();

//                  Set different timeout ----,
//                                            v
$httpclient->setConfig(array('timeout' => $timeout, 'useragent' => 'Skosmos'));
EasyRdf\Http::setDefaultHttpClient($httpclient);

$uri = 'https://your-sexy-triple-store';

$graph = EasyRdf\Graph::newAndLoad(EasyRdf\Utils::removeFragmentFromUri($uri));