__construct() public method

public __construct ( Http\Client\HttpClient $client, string $rootUrl, string $locale = null )
$client Http\Client\HttpClient An HTTP adapter.
$rootUrl string Root URL of the nominatim server
$locale string A locale (optional).
 /**
  * @param HttpAdapterInterface $adapter An HTTP adapter.
  * @param string               $locale  A locale (optional).
  */
 public function __construct(HttpAdapterInterface $adapter, $kbid = null, $secretKey = null, $endpoint = null)
 {
     parent::__construct($adapter, static::ROOT_URL, 'it_IT');
     if (is_null($kbid)) {
         $kbid = 'demo';
     }
     if (is_null($secretKey)) {
         $secretKey = 'demo';
     }
     if (is_null($endpoint)) {
         $endpoint = "https://hub1.linkeddata.center/{$kbid}";
     }
     HttpClient::useIdentity($kbid, $secretKey);
     $this->sparql = new SparqlClient("{$endpoint}/sparql");
     $this->factory = new AddressFactory();
 }
Beispiel #2
0
 /**
  * @param HttpAdapterInterface $adapter An HTTP adapter.
  * @param string               $locale  A locale (optional).
  */
 public function __construct(HttpAdapterInterface $adapter, $locale = null)
 {
     parent::__construct($adapter, static::ROOT_URL, $locale);
 }
Beispiel #3
0
 /**
  * @param HttpClient $client An HTTP adapter.
  * @param string     $locale A locale (optional).
  */
 public function __construct(HttpClient $client, $locale = null)
 {
     parent::__construct($client, static::ROOT_URL, $locale);
 }