Admin
3 years ago
Assets
3 years ago
Pages
3 years ago
PostTypes
3 years ago
Shortcodes
3 years ago
Users
3 years ago
ActionsService.php
3 years ago
PluginService.php
3 years ago
PluginServiceProvider.php
3 years ago
RecaptchaValidationService.php
3 years ago
ThemeServiceProvider.php
3 years ago
TranslationsServiceProvider.php
3 years ago
PluginServiceProvider.php
54 lines
| 1 | <?php |
| 2 | |
| 3 | namespace SureCart\WordPress; |
| 4 | |
| 5 | use SureCart\WordPress\PluginService; |
| 6 | use SureCartCore\ServiceProviders\ServiceProviderInterface; |
| 7 | |
| 8 | /** |
| 9 | * Register plugin options. |
| 10 | */ |
| 11 | class PluginServiceProvider implements ServiceProviderInterface { |
| 12 | /** |
| 13 | * Register all dependencies in the IoC container. |
| 14 | * |
| 15 | * @param \Pimple\Container $container Service container. |
| 16 | * @return void |
| 17 | */ |
| 18 | public function register( $container ) { |
| 19 | $app = $container[ SURECART_APPLICATION_KEY ]; |
| 20 | |
| 21 | $container['surecart.plugin'] = function( $c ) { |
| 22 | return new PluginService( $c[ SURECART_APPLICATION_KEY ] ); |
| 23 | }; |
| 24 | |
| 25 | $container['surecart.actions'] = function() { |
| 26 | return new ActionsService(); |
| 27 | }; |
| 28 | $container['surecart.config.setting'] = function($c) { |
| 29 | return json_decode(json_encode($c[SURECART_CONFIG_KEY])); |
| 30 | }; |
| 31 | |
| 32 | $app = $container[ SURECART_APPLICATION_KEY ]; |
| 33 | $app->alias( 'plugin', 'surecart.plugin' ); |
| 34 | $app->alias( 'actions', 'surecart.actions' ); |
| 35 | $app->alias( 'config', 'surecart.config.setting' ); |
| 36 | } |
| 37 | |
| 38 | /** |
| 39 | * {@inheritDoc} |
| 40 | */ |
| 41 | public function bootstrap( $container ) { |
| 42 | /** Nothing to bootstrap */ |
| 43 | } |
| 44 | |
| 45 | /** |
| 46 | * Load textdomain. |
| 47 | * |
| 48 | * @return void |
| 49 | */ |
| 50 | public function loadTextdomain() { |
| 51 | load_plugin_textdomain( 'surecart', false, basename( dirname( SURECART_PLUGIN_FILE ) ) . DIRECTORY_SEPARATOR . 'languages' ); |
| 52 | } |
| 53 | } |
| 54 |