| @@ -1,23 +1,39 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | namespace Give\License; |
| 4 | 4 | |
| 5 | +use Give\Framework\Migrations\MigrationsRegister; | |
| 6 | +use Give\Helpers\Hooks; | |
| 7 | +use Give\License\Actions\AddPlatformFeeAmountToSystemInfo; | |
| 8 | +use Give\License\Migrations\RefreshLicensesForPlatformFee; | |
| 9 | +use Give\License\Migrations\RefreshLicensesForLastActiveDate; | |
| 10 | +use Give\License\Repositories\LicenseRepository; | |
| 5 | 11 | use Give\ServiceProviders\ServiceProvider; |
| 6 | 12 | |
| 7 | 13 | class LicenseServiceProvider implements ServiceProvider |
| 8 | 14 | { |
| 9 | 15 | /** |
| 16 | + * @since 4.3.0 added LicenseRepository singleton | |
| 10 | 17 | * @since 2.11.3 |
| 11 | 18 | */ |
| 12 | 19 | public function register() |
| 13 | 20 | { |
| 14 | 21 | give()->singleton(PremiumAddonsListManager::class); |
| 22 | + give()->singleton(LicenseRepository::class); | |
| 15 | 23 | } |
| 16 | 24 | |
| 17 | 25 | /** |
| 26 | + * @since 4.3.0 added refresh-licenses-for-platform-fee migration | |
| 18 | 27 | * @since 2.11.3 |
| 19 | 28 | */ |
| 20 | 29 | public function boot() |
| 21 | 30 | { |
| 31 | + /** @var MigrationsRegister $migrationRegistrar */ | |
| 32 | + $migrationRegistrar = give(MigrationsRegister::class); | |
| 33 | + | |
| 34 | + $migrationRegistrar->addMigration(RefreshLicensesForPlatformFee::class); | |
| 35 | + $migrationRegistrar->addMigration(RefreshLicensesForLastActiveDate::class); | |
| 36 | + | |
| 37 | + Hooks::addAction('give_add_system_info_configuration', AddPlatformFeeAmountToSystemInfo::class); | |
| 22 | 38 | } |
| 23 | 39 | } |