<?php

use \ModulesGarden\ProxmoxAddon\Core\App\AppContext;

require_once __DIR__ . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR . 'WhmcsErrorIntegration.php';

function proxmoxAddon_config()
{
    require_once __DIR__ . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR . 'App' . DIRECTORY_SEPARATOR . 'AppContext.php';
    $appContext = new AppContext();

    return $appContext->runApp(__FUNCTION__);
}

function proxmoxAddon_activate()
{
    require_once __DIR__ . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR . 'App' . DIRECTORY_SEPARATOR . 'AppContext.php';
    $appContext = new AppContext();

    return $appContext->runApp(__FUNCTION__);
}

function proxmoxAddon_deactivate()
{
    require_once __DIR__ . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR . 'App' . DIRECTORY_SEPARATOR . 'AppContext.php';
    $appContext = new AppContext();

    return $appContext->runApp(__FUNCTION__);
}

function proxmoxAddon_upgrade($params)
{
    require_once __DIR__ . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR . 'App' . DIRECTORY_SEPARATOR . 'AppContext.php';
    $appContext = new AppContext();

    return $appContext->runApp(__FUNCTION__, $params);
}

function proxmoxAddon_output($params)
{
    require_once __DIR__ . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR . 'App' . DIRECTORY_SEPARATOR . 'AppContext.php';
    $appContext = new AppContext();


    $html = $appContext->runApp(__FUNCTION__, $params);

    if ($html)
    {
        echo $html;
    }
}

function proxmoxAddon_clientarea($params)
{
    require_once __DIR__ . DIRECTORY_SEPARATOR . 'core' . DIRECTORY_SEPARATOR . 'App' . DIRECTORY_SEPARATOR . 'AppContext.php';
    $appContext = new AppContext();


    return $appContext->runApp(__FUNCTION__, $params);
}
