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