Initial version of CloudObjectsServiceProvider
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
/vendor/
|
||||||
14
composer.json
Normal file
14
composer.json
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
{
|
||||||
|
"name": "cloudobjects/laravel-sdk",
|
||||||
|
"description" : "CloudObjects SDK for Laravel Applications.",
|
||||||
|
"type": "library",
|
||||||
|
"license": "MPL-2.0",
|
||||||
|
"require": {
|
||||||
|
"cloudobjects/sdk" : "*"
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"psr-4" : {
|
||||||
|
"CloudObjects\\SDK\\Laravel\\" : "src"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
28
src/CloudObjectsServiceProvider.php
Normal file
28
src/CloudObjectsServiceProvider.php
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
|
|
||||||
|
namespace CloudObjects\SDK\Laravel;
|
||||||
|
|
||||||
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
use CloudObjects\SDK\ObjectRetriever;
|
||||||
|
use CloudObjects\SDK\WebAPI\APIClientFactory;
|
||||||
|
|
||||||
|
class CloudObjectsServiceProvider extends ServiceProvider {
|
||||||
|
|
||||||
|
public function boot() {
|
||||||
|
// nothing to do here
|
||||||
|
}
|
||||||
|
|
||||||
|
public function register() {
|
||||||
|
$this->app->bind(ObjectRetriever::class, function() {
|
||||||
|
return new ObjectRetriever($this->app['config']->get('cloudobjects.core'));
|
||||||
|
});
|
||||||
|
$this->app->bind(APIClientFactory::class, function() {
|
||||||
|
return new APIClientFactory(app(ObjectRetriever::class));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user