ActivationServiceProvider.php
37 lines
| 1 | <?php |
| 2 | |
| 3 | namespace SureCart\Activation; |
| 4 | |
| 5 | use SureCartCore\ServiceProviders\ServiceProviderInterface; |
| 6 | |
| 7 | /** |
| 8 | * Provide users dependencies. |
| 9 | */ |
| 10 | class ActivationServiceProvider implements ServiceProviderInterface { |
| 11 | /** |
| 12 | * Register all dependencies in the IoC container. |
| 13 | * |
| 14 | * @param \Pimple\Container $container Service container. |
| 15 | * @return void |
| 16 | */ |
| 17 | public function register( $container ) { |
| 18 | $container['surecart.activation'] = function ( $container ) { |
| 19 | return new ActivationService( $container['surecart.permissions.roles'], $container['surecart.pages.seeder'] ); |
| 20 | }; |
| 21 | |
| 22 | // register alias. |
| 23 | $app = $container[ SURECART_APPLICATION_KEY ]; |
| 24 | $app->alias( 'activation', 'surecart.activation' ); |
| 25 | } |
| 26 | |
| 27 | /** |
| 28 | * Bootstrap any services if needed. |
| 29 | * |
| 30 | * @param \Pimple\Container $container Service container. |
| 31 | * @return void |
| 32 | */ |
| 33 | public function bootstrap( $container ) { |
| 34 | $container['surecart.activation']->bootstrap(); |
| 35 | } |
| 36 | } |
| 37 |