src/Components/EnvDetector.php
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;
    }
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;
    }
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 ; }
get Env Name By Domain
@param string $defaultEnv
@param null|string $domain
@return string
get Env Name By Domain