Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F3768697
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/app/Providers/DockerHubServiceProvider.php b/app/Providers/DockerHubServiceProvider.php
index c590007..e7c3020 100644
--- a/app/Providers/DockerHubServiceProvider.php
+++ b/app/Providers/DockerHubServiceProvider.php
@@ -1,50 +1,49 @@
<?php
namespace Nasqueron\Notifications\Providers;
-use Illuminate\Config\Repository;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Support\ServiceProvider;
use GuzzleHttp\Client;
use Keruald\DockerHub\Build\TriggerBuildFactory;
class DockerHubServiceProvider extends ServiceProvider {
/**
* Bootstraps the application services.
*
* @return void
*/
public function boot() {
}
/**
* Gets the tokens to trigger build for the Docker Hub images.
*
* @param \Illuminate\Contracts\Foundation\Application $app
* @return array
*/
public static function getTokens (Application $app) {
$file = $app->make('config')->get('services.dockerhub.tokens');
$fs = $app->make('filesystem')->disk('local');
if ($fs->exists($file)) {
$content = $fs->get($file);
return json_decode($content, true);
}
return [];
}
/**
* Registers the application services.
*
* @return void
*/
public function register() {
$this->app->singleton('dockerhub', function (Application $app) {
$tokens = DockerHubServiceProvider::getTokens($app);
return new TriggerBuildFactory(new Client, $tokens);
});
}
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Mon, Nov 25, 09:49 (1 d, 16 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2259956
Default Alt Text
(1 KB)
Attached To
Mode
rNOTIF Notifications center
Attached
Detach File
Event Timeline
Log In to Comment