| 123456789101112131415161718192021222324252627282930 |
- <?php
- namespace ModulesGarden\Servers\ProxmoxVps\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;
- }
- }
|