public static function getEnvNameByDomain(string $defaultEnv = null, string $domain = null): string
    {
        $domain = $domain ?: PhpHelper::serverParam('HTTP_HOST');

        if (!$domain) {
            return $defaultEnv;
        }

        foreach (self::$domain2env as $kw => $env) {
            if (false !== strpos($domain, $kw)) {
                return $env;
            }
        }

        return $defaultEnv;
    }