<?php

namespace Blazemedia\Affiliation;

use Blazemedia\Affiliation\Affiliation;
use Blazemedia\Affiliation\Support\Environment;
use Blazemedia\Affiliation\API\Proxy;

final class AffiliationFacade
{
    /** @var Affiliation */
    protected static Affiliation $affiliation;

    /**
     * Inizializza il plugin e carica l'ambiente
     */
    public static function init(): void
    {
        Environment::setup();

        /*
        if (defined('DOING_CRON')) {
            return;
        }
        */

        self::$affiliation = new Affiliation();
        self::$affiliation->boot();
    }

    /**
     * Restituisce l'istanza principale del Affiliation
     */
    public static function affiliation(): Affiliation
    {
        return self::$affiliation;
    }

    // === Accessori helper statici (opzionali ma consigliati) ===

    /**
     * @return Proxy
     */
    public static function proxy(): Proxy
    {
        return new Proxy();
    }

    
}
