server/src/app/Providers/SparqlClientServiceProvider.php
changeset 531 48f5380c26d0
parent 405 f239c8c5bb94
child 537 d2e6ee099125
equal deleted inserted replaced
530:a76bae4795d5 531:48f5380c26d0
    12     public function register() {
    12     public function register() {
    13         $this->app->bind(
    13         $this->app->bind(
    14             'CorpusParole\Libraries\Sparql\SparqlClient',
    14             'CorpusParole\Libraries\Sparql\SparqlClient',
    15             function($app) {
    15             function($app) {
    16                 $httpClient = $app->make('GuzzleHttp\Client', [[ 'base_uri' => config('corpusparole.rdf4j_query_url'), 'http_errors' => false]]);
    16                 $httpClient = $app->make('GuzzleHttp\Client', [[ 'base_uri' => config('corpusparole.rdf4j_query_url'), 'http_errors' => false]]);
    17                 $sparqlClient = $app->make('EasyRdf\Sparql\Client', [config('corpusparole.rdf4j_query_url'), config('corpusparole.rdf4j_update_url')]);
    17                 // we create another guzzle client to avoid interference with the base_uri parameter
       
    18                 $sparqlClient = $app->make('CorpusParole\Libraries\Sparql\GuzzleSparqlClient', [$app['Guzzle'], config('corpusparole.rdf4j_query_url'), config('corpusparole.rdf4j_update_url')]);
    18                 return new SparqlClient($httpClient, $sparqlClient);
    19                 return new SparqlClient($httpClient, $sparqlClient);
    19             }
    20             }
    20         );
    21         );
    21     }
    22     }
    22 }
    23 }