2015-01-23 17:24:34 +00:00
|
|
|
<?php
|
|
|
|
|
2015-04-19 08:52:39 +01:00
|
|
|
/*
|
|
|
|
* This file is part of Cachet.
|
|
|
|
*
|
|
|
|
* (c) James Brooks <james@cachethq.io>
|
2015-05-19 10:45:38 +01:00
|
|
|
* (c) Joseph Cohen <joseph.cohen@dinkbit.com>
|
|
|
|
* (c) Graham Campbell <graham@mineuk.com>
|
2015-04-19 08:52:39 +01:00
|
|
|
*
|
|
|
|
* For the full copyright and license information, please view the LICENSE
|
|
|
|
* file that was distributed with this source code.
|
|
|
|
*/
|
|
|
|
|
2015-01-23 17:24:34 +00:00
|
|
|
namespace CachetHQ\Cachet\Providers;
|
|
|
|
|
|
|
|
use CachetHQ\Cachet\Segment\CacheRepository;
|
|
|
|
use CachetHQ\Cachet\Segment\HttpRepository;
|
|
|
|
use GuzzleHttp\Client;
|
|
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
|
|
|
|
class SegmentApiServiceProvider extends ServiceProvider
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Boot the service provider.
|
|
|
|
*/
|
|
|
|
public function boot()
|
|
|
|
{
|
|
|
|
//
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Register the service provider.
|
|
|
|
*/
|
|
|
|
public function register()
|
|
|
|
{
|
|
|
|
$this->app->singleton('CachetHQ\Cachet\Segment\RepositoryInterface', function () {
|
|
|
|
$url = 'https://gist.githubusercontent.com/jbrooksuk/5de24bc1cf90fb1a3d57/raw/cachet.json';
|
|
|
|
$guzzleClient = new Client();
|
|
|
|
$client = new HttpRepository($guzzleClient, $url);
|
|
|
|
|
|
|
|
return new CacheRepository($client);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|