server/src/app/Providers/RepositoryServiceProvider.php
author ymh <ymh.work@gmail.com>
Mon, 22 Feb 2016 18:06:39 +0100
changeset 126 e87a340711a4
parent 4 f55970e41793
child 405 f239c8c5bb94
permissions -rw-r--r--
improve on dataloading. add fixture management with proper interface to load data.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
     1
<?php
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
     2
namespace CorpusParole\Providers;
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
     3
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
     4
use Illuminate\Support\ServiceProvider;
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
     5
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
     6
/**
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
     7
 * Service provider charged to bind repository interfaces to implementations
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
     8
 */
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
     9
class RepositoryServiceProvider extends ServiceProvider {
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
    10
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
    11
    public function register() {
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
    12
        $this->app->bind(
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
    13
            'CorpusParole\Repositories\DocumentRepository',
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
    14
            function($app) {
126
e87a340711a4 improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    15
                // $httpClient = $app->make('GuzzleHttp\Client', [[ 'base_uri' => config('corpusparole.sesame_query_url'), 'http_errors' => false]]);
e87a340711a4 improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    16
                // $sparqlClient = $app->make('EasyRdf\Sparql\Client', [config('corpusparole.sesame_query_url'), config('corpusparole.sesame_update_url')]);
e87a340711a4 improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    17
                // $cpSparqlClient = $app->make('CorpusParole\Libraries\Sparql\SparqlClient', [$httpClient, $sparqlClient]);
e87a340711a4 improve on dataloading. add fixture management with proper interface to load data.
ymh <ymh.work@gmail.com>
parents: 4
diff changeset
    18
                $cpSparqlClient = $app->make('CorpusParole\Libraries\Sparql\SparqlClient');
4
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
    19
                return $app->make('CorpusParole\Repositories\RdfDocumentRepository', [$cpSparqlClient,]);
f55970e41793 first skeleton of bo client in ember
ymh <ymh.work@gmail.com>
parents: 2
diff changeset
    20
            }
2
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
    21
        );
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
    22
    }
00e2916104fe Migrate to php 5.6 + Laravel 5.1 + add phpunit test
ymh <ymh.work@gmail.com>
parents:
diff changeset
    23
}