| 1 |
<?php |
| 2 |
/** |
| 3 |
* Setup Service for Yatra Plugin |
| 4 |
* |
| 5 |
* Handles plugin activation and setup tasks |
| 6 |
* |
| 7 |
* @package Yatra\Services |
| 8 |
*/ |
| 9 |
|
| 10 |
namespace Yatra\Services; |
| 11 |
|
| 12 |
class SetupService |
| 13 |
{ |
| 14 |
/** |
| 15 |
* Register activation hook |
| 16 |
*/ |
| 17 |
public static function registerActivationHook(): void |
| 18 |
{ |
| 19 |
register_activation_hook(YATRA_PLUGIN_FILE, [self::class, 'activate']); |
| 20 |
} |
| 21 |
|
| 22 |
/** |
| 23 |
* Plugin activation callback |
| 24 |
*/ |
| 25 |
public static function activate(): void |
| 26 |
{ |
| 27 |
// Run centralized installer for default settings |
| 28 |
InstallerService::install(); |
| 29 |
|
| 30 |
if (class_exists('Yatra\Services\SetupWizardService')) { |
| 31 |
SetupWizardService::triggerWizardOnActivation(); |
| 32 |
} |
| 33 |
} |
| 34 |
} |
| 35 |
|