Tables
1 year ago
GeneralMigration.php
1 year ago
MigrationsServiceProvider.php
1 year ago
ProductPageMigrationService.php
1 year ago
RewriteRulesMigrationService.php
1 year ago
Table.php
3 years ago
UpdateMigrationServiceProvider.php
2 years ago
UserMetaMigrationsService.php
3 years ago
VersionMigration.php
1 year ago
WebhookMigrationsService.php
1 year ago
MigrationsServiceProvider.php
64 lines
| 1 | <?php |
| 2 | |
| 3 | namespace SureCart\Database; |
| 4 | |
| 5 | use SureCart\Database\Tables\IncomingWebhook; |
| 6 | use SureCart\Database\Tables\Integrations; |
| 7 | use SureCart\Database\Tables\VariantOptionValues; |
| 8 | use SureCartCore\ServiceProviders\ServiceProviderInterface; |
| 9 | |
| 10 | /** |
| 11 | * WordPress Users service. |
| 12 | */ |
| 13 | class MigrationsServiceProvider implements ServiceProviderInterface { |
| 14 | /** |
| 15 | * {@inheritDoc} |
| 16 | * |
| 17 | * @param \Pimple\Container $container Service Container. |
| 18 | */ |
| 19 | public function register( $container ) { |
| 20 | $container['surecart.tables.integrations'] = function () { |
| 21 | return new Integrations( new Table() ); |
| 22 | }; |
| 23 | |
| 24 | $container['surecart.tables.webhooks.incoming'] = function () { |
| 25 | return new IncomingWebhook( new Table() ); |
| 26 | }; |
| 27 | |
| 28 | $container['surecart.tables.variant_option_values'] = function () { |
| 29 | return new VariantOptionValues( new Table() ); |
| 30 | }; |
| 31 | |
| 32 | $container['surecart.migrations.usermeta'] = function () { |
| 33 | return new UserMetaMigrationsService(); |
| 34 | }; |
| 35 | |
| 36 | $container['surecart.migrations.webhook'] = function () { |
| 37 | return new WebhookMigrationsService(); |
| 38 | }; |
| 39 | |
| 40 | $container['surecart.migrations.rewrites'] = function () { |
| 41 | return new RewriteRulesMigrationService(); |
| 42 | }; |
| 43 | |
| 44 | $container['surecart.migrations.product_page'] = function () { |
| 45 | return new ProductPageMigrationService(); |
| 46 | }; |
| 47 | } |
| 48 | |
| 49 | /** |
| 50 | * {@inheritDoc} |
| 51 | * |
| 52 | * @param \Pimple\Container $container Service Container. |
| 53 | */ |
| 54 | public function bootstrap( $container ) { |
| 55 | $container['surecart.tables.integrations']->install(); |
| 56 | $container['surecart.tables.webhooks.incoming']->install(); |
| 57 | $container['surecart.tables.variant_option_values']->install(); |
| 58 | $container['surecart.migrations.usermeta']->bootstrap(); |
| 59 | $container['surecart.migrations.webhook']->bootstrap(); |
| 60 | $container['surecart.migrations.rewrites']->bootstrap(); |
| 61 | $container['surecart.migrations.product_page']->bootstrap(); |
| 62 | } |
| 63 | } |
| 64 |