<?php


namespace ModulesGarden\Servers\ProxmoxCloudVps\App\Helpers;


class ProxmoxAddonValidator
{
    const ERROR_MESSAGE = 'ProxmoxAddon is not installed or activated';

    public static function isInstalled(){

        if(!class_exists('\ModulesGarden\ProxmoxAddon\Core\ModuleConstants') ){
            return false;
        }
        return !is_null(\ModulesGarden\ProxmoxAddon\Core\ModuleConstants::getModuleRootDir());
    }

    public static function isInstalledOrFail(){
        if(!self::isInstalled()){
            throw new ProxmoxAddonNotInstalledException(self::ERROR_MESSAGE);
        }
    }

    public static function failAsString(){
        return self::ERROR_MESSAGE;
    }


}