FEATURE: prevent running some service providers in artisan

This commit is contained in:
Michal Kváček
2016-03-22 16:02:08 +01:00
parent 98090f69df
commit 28c065e106
3 changed files with 18 additions and 3 deletions
+6 -3
View File
@@ -3,17 +3,22 @@
namespace App\Providers;
use App\Models\Module;
use Illuminate\Support\Facades\App;
use Illuminate\Support\ServiceProvider;
class ModuleManager extends ServiceProvider
{
/**
* Bootstrap the application services.
*
* @return void
*/
public function boot()
{
// ignore running from artisan
if (App::runningInConsole()) {
return;
}
// this service provider needs published config - config is merged right after this service provider
$modules = Module::get();
@@ -25,7 +30,6 @@ class ModuleManager extends ServiceProvider
/**
* Register the application services.
*
* @return void
*/
public function register()
@@ -34,7 +38,6 @@ class ModuleManager extends ServiceProvider
/**
* Read config file and merge it with module config in database.
*
* This method REQUIRES published config of given module (otherwise config(modulename) is not available)!
*
* @param Module $module