diff --git a/src/helpers.php b/src/helpers.php index 69729cf..acae534 100644 --- a/src/helpers.php +++ b/src/helpers.php @@ -38,6 +38,25 @@ function tpl(string $file, string $type = 'structure', string $site = 'main'): v } } +function app_primary_domain(): string +{ + if (defined('APP_DOMAIN_PRIMARY')) { + return APP_DOMAIN_PRIMARY; + } + if (defined('APP_DOMAIN_NAME')) { + return APP_DOMAIN_NAME; + } + return $_SERVER['HTTP_HOST'] ?? ''; +} + +function app_fakecheck_domain(): string +{ + if (defined('APP_DOMAIN_FAKECHECK')) { + return APP_DOMAIN_FAKECHECK; + } + return app_primary_domain(); +} + function asset_styles(): void { $styles = app()->assets()->styles();