AssetsServiceProvider.php
45 lines
| 1 | <?php |
| 2 | /** |
| 3 | * @package SureCartAppCore |
| 4 | * @author SureCart <support@surecart.com> |
| 5 | * @copyright SureCart |
| 6 | * @license https://www.gnu.org/licenses/gpl-2.0.html GPL-2.0 |
| 7 | * @link https://surecart.com |
| 8 | */ |
| 9 | |
| 10 | namespace SureCartAppCore\Assets; |
| 11 | |
| 12 | use SureCartCore\ServiceProviders\ServiceProviderInterface; |
| 13 | |
| 14 | /** |
| 15 | * Provide assets dependencies. |
| 16 | * |
| 17 | * @codeCoverageIgnore |
| 18 | */ |
| 19 | class AssetsServiceProvider implements ServiceProviderInterface { |
| 20 | /** |
| 21 | * {@inheritDoc} |
| 22 | */ |
| 23 | public function register( $container ) { |
| 24 | $container['surecart_app_core.assets.manifest'] = function( $c ) { |
| 25 | return new Manifest( $c[ SURECART_CONFIG_KEY ]['app_core']['path'] ); |
| 26 | }; |
| 27 | |
| 28 | $container['surecart_app_core.assets.assets'] = function( $container ) { |
| 29 | return new Assets( |
| 30 | $container[ SURECART_CONFIG_KEY ]['app_core']['path'], |
| 31 | $container[ SURECART_CONFIG_KEY ]['app_core']['url'], |
| 32 | $container['surecart_app_core.config.config'], |
| 33 | $container['surecart_app_core.assets.manifest'] |
| 34 | ); |
| 35 | }; |
| 36 | } |
| 37 | |
| 38 | /** |
| 39 | * {@inheritDoc} |
| 40 | */ |
| 41 | public function bootstrap( $container ) { |
| 42 | // Nothing to bootstrap. |
| 43 | } |
| 44 | } |
| 45 |