<?php

declare(strict_types=1);

if (!defined('ABSPATH')) {
	exit;
}

use Signocore\Multilanguage\Application\Constants;
use Signocore\Multilanguage\Application\Installer;
use Signocore\Multilanguage\Application\LicenseManager;
use Signocore\Multilanguage\Application\SignocoreMultilanguage;

require_once __DIR__ . '/../vendor/autoload.php';

// Register activation/deactivation hooks immediately so they fire during activate_plugin()
register_activation_hook(SIGNOCORE_ML_FILE, static function (): void {
	Constants::load();
	Installer::activate();
});

register_deactivation_hook(SIGNOCORE_ML_FILE, static function (): void {
	Constants::load();
	Installer::deactivate();
});

add_action('plugins_loaded', static function (): void {
	Constants::load();
	LicenseManager::load();
	SignocoreMultilanguage::load();
});
