| @@ 48-62 (lines=15) @@ | ||
| 45 | /** |
|
| 46 | * {@inheritdoc} |
|
| 47 | */ |
|
| 48 | protected function registerServices() |
|
| 49 | { |
|
| 50 | $this->app->singleton(Contracts\RepositoryInterface::class, function ($app) { |
|
| 51 | $path = $app['config']->get('modules.paths.modules'); |
|
| 52 | ||
| 53 | return new Laravel\LaravelFileRepository($app, $path); |
|
| 54 | }); |
|
| 55 | $this->app->singleton(Contracts\ActivatorInterface::class, function ($app) { |
|
| 56 | $activator = $app['config']->get('modules.activator'); |
|
| 57 | $class = $app['config']->get('modules.activators.' . $activator)['class']; |
|
| 58 | ||
| 59 | return new $class($app); |
|
| 60 | }); |
|
| 61 | $this->app->alias(Contracts\RepositoryInterface::class, 'modules'); |
|
| 62 | } |
|
| 63 | } |
|
| 64 | ||
| @@ 44-58 (lines=15) @@ | ||
| 41 | /** |
|
| 42 | * {@inheritdoc} |
|
| 43 | */ |
|
| 44 | protected function registerServices() |
|
| 45 | { |
|
| 46 | $this->app->singleton(Contracts\RepositoryInterface::class, function ($app) { |
|
| 47 | $path = $app['config']->get('modules.paths.modules'); |
|
| 48 | ||
| 49 | return new Lumen\LumenFileRepository($app, $path); |
|
| 50 | }); |
|
| 51 | $this->app->singleton(Contracts\ActivatorInterface::class, function ($app) { |
|
| 52 | $activator = $app['config']->get('modules.activator'); |
|
| 53 | $class = $app['config']->get('modules.activators.' . $activator)['class']; |
|
| 54 | ||
| 55 | return new $class($app); |
|
| 56 | }); |
|
| 57 | $this->app->alias(Contracts\RepositoryInterface::class, 'modules'); |
|
| 58 | } |
|
| 59 | } |
|
| 60 | ||