| 1 |
<?php |
| 2 |
/** |
| 3 |
* @package WPEmergeAppCore |
| 4 |
* @author Atanas Angelov <hi@atanas.dev> |
| 5 |
* @copyright 2017-2020 Atanas Angelov |
| 6 |
* @license https://www.gnu.org/licenses/gpl-2.0.html GPL-2.0 |
| 7 |
* @link https://wpemerge.com/ |
| 8 |
*/ |
| 9 |
|
| 10 |
namespace WPEmergeAppCore\Assets; |
| 11 |
|
| 12 |
use WPEmerge\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['wpemerge_app_core.assets.manifest'] = function( $c ) { |
| 25 |
return new Manifest( $c[ WPEMERGE_CONFIG_KEY ]['app_core']['path'] ); |
| 26 |
}; |
| 27 |
|
| 28 |
$container['wpemerge_app_core.assets.assets'] = function( $container ) { |
| 29 |
return new Assets( |
| 30 |
$container[ WPEMERGE_CONFIG_KEY ]['app_core']['path'], |
| 31 |
$container[ WPEMERGE_CONFIG_KEY ]['app_core']['url'], |
| 32 |
$container['wpemerge_app_core.config.config'], |
| 33 |
$container['wpemerge_app_core.assets.manifest'], |
| 34 |
$container[ WPEMERGE_APPLICATION_FILESYSTEM_KEY ] |
| 35 |
); |
| 36 |
}; |
| 37 |
} |
| 38 |
|
| 39 |
/** |
| 40 |
* {@inheritDoc} |
| 41 |
*/ |
| 42 |
public function bootstrap( $container ) { |
| 43 |
// Nothing to bootstrap. |
| 44 |
} |
| 45 |
} |
| 46 |
|