server/src/app/Providers/LexvoServiceProvider.php
author ymh <ymh.work@gmail.com>
Mon, 12 Jun 2017 14:53:59 +0200
changeset 537 d2e6ee099125
parent 531 48f5380c26d0
permissions -rw-r--r--
upgrade ember + laravel + make everything work
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
28
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
<?php
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
namespace CorpusParole\Providers;
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
use Config;
537
d2e6ee099125 upgrade ember + laravel + make everything work
ymh <ymh.work@gmail.com>
parents: 531
diff changeset
     6
use CorpusParole\Libraries\Sparql\GuzzleSparqlClient;
d2e6ee099125 upgrade ember + laravel + make everything work
ymh <ymh.work@gmail.com>
parents: 531
diff changeset
     7
use CorpusParole\Services\LexvoResolver;
28
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
use Illuminate\Support\ServiceProvider;
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
class LexvoServiceProvider extends ServiceProvider
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
{
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
    /**
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents:
diff changeset
    14
     * Register the application services.
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents:
diff changeset
    15
     *
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents:
diff changeset
    16
     * @return void
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents:
diff changeset
    17
     */
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents:
diff changeset
    18
    public function register()
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents:
diff changeset
    19
    {
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents:
diff changeset
    20
        $this->app->bind('CorpusParole\Services\LexvoResolverInterface', function($app) {
537
d2e6ee099125 upgrade ember + laravel + make everything work
ymh <ymh.work@gmail.com>
parents: 531
diff changeset
    21
            $sparqlClient = new GuzzleSparqlClient($app['Guzzle'], config('corpusparole.lexvo_rdf4j_query_url'), null);
d2e6ee099125 upgrade ember + laravel + make everything work
ymh <ymh.work@gmail.com>
parents: 531
diff changeset
    22
            return new LexvoResolver($sparqlClient);
28
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents:
diff changeset
    23
        });
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents:
diff changeset
    24
    }
b0b56e0f8c7f Add contributor edition
ymh <ymh.work@gmail.com>
parents:
diff changeset
    25
}