Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/Jenssegers/Chef/ChefServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ class ChefServiceProvider extends ServiceProvider {
*/
public function boot()
{
$this->package('jenssegers/chef');
$this->publishes([
__DIR__ . '/../../config/config.php' => config_path('chef.php')
], 'config');
}

/**
Expand All @@ -28,16 +30,15 @@ public function boot()
*/
public function register()
{
$this->app['chef'] = $this->app->share(function($app)
{
$this->app['chef'] = $this->app->share(function () {
// load settings from configuration
$server = $app['config']->get('chef::server');
$client = $app['config']->get('chef::client');
$key = $app['config']->get('chef::key');
$version = $app['config']->get('chef::version');
$enterprise = $app['config']->get('chef::enterprise');
$server = config('chef.server');
$client = config('chef.client');
$key = config('chef.key');
$version = config('chef.version');
$enterprise = config('chef.enterprise');

return new Chef($server, $client, $key, $version,$enterprise);
return new Chef($server, $client, $key, $version, $enterprise);
});
}

Expand All @@ -50,5 +51,4 @@ public function provides()
{
return array('Chef');
}

}
6 changes: 3 additions & 3 deletions src/config/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
| 'version' = the version of the Chef Server API that is being used
*/

return array(
return [
'server' => 'https://localhost',
'client' => 'client',
'key' => '/etc/chef/client.pem',
'version' => '0.11.4',
'version' => '12.0.0',
"enterprise" => false
);
];