-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prevent FeedFactory from throwing a "Undefined index: ssl_check.disab…
…led" error for anybody upgrading, and reformat some stuff.
- Loading branch information
1 parent
eb369fe
commit 758659c
Showing
2 changed files
with
114 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,53 @@ | ||
<?php namespace willvincent\Feeds; | ||
|
||
use Illuminate\Support\ServiceProvider; | ||
use willvincent\Feeds\FeedsFactory; | ||
|
||
class FeedsServiceProvider extends ServiceProvider { | ||
|
||
/** | ||
* Indicates if loading of the provider is deferred. | ||
* | ||
* @var bool | ||
*/ | ||
protected $defer = true; | ||
|
||
public function boot() { | ||
$this->publishes([ | ||
__DIR__ . '/config/feeds.php' => config_path('feeds.php'), | ||
]); | ||
} | ||
|
||
/** | ||
* Register the service provider. | ||
* | ||
* @return void | ||
*/ | ||
public function register() { | ||
$this->app->singleton('Feeds', function () { | ||
$config = config('feeds'); | ||
|
||
if (!$config) { | ||
throw new \RunTimeException('Feeds configuration not found. Please run `php artisan vendor:publish`'); | ||
} | ||
|
||
return new FeedsFactory($config); | ||
}); | ||
} | ||
|
||
/** | ||
* Get the services provided by the provider. | ||
* | ||
* @return array | ||
*/ | ||
public function provides() { | ||
return ['Feeds']; | ||
} | ||
|
||
class FeedsServiceProvider extends ServiceProvider | ||
{ | ||
/** | ||
* Indicates if loading of the provider is deferred. | ||
* | ||
* @var bool | ||
*/ | ||
protected $defer = true; | ||
|
||
/** | ||
* Bootstrap any application services. | ||
* | ||
* @return void | ||
*/ | ||
public function boot() | ||
{ | ||
$this->publishes([ | ||
__DIR__ . '/config/feeds.php' => config_path('feeds.php'), | ||
]); | ||
} | ||
|
||
/** | ||
* Register the service provider. | ||
* | ||
* @return void | ||
*/ | ||
public function register() | ||
{ | ||
$this->app->singleton('Feeds', function () { | ||
$config = config('feeds'); | ||
|
||
if (! $config) { | ||
throw new \RunTimeException('Feeds configuration not found. Please run `php artisan vendor:publish`'); | ||
} | ||
|
||
return new FeedsFactory($config); | ||
}); | ||
} | ||
|
||
/** | ||
* Get the services provided by the provider. | ||
* | ||
* @return array | ||
*/ | ||
public function provides() | ||
{ | ||
return ['Feeds']; | ||
} | ||
} |