public static function detectEnv(array $environments, $uri)
        {
            foreach ($environments as $environment => $patterns) {
                // Essentially we just want to loop through each environment pattern
                // and determine if the current URI matches the pattern and if so
                // we will simply return the environment for that URI pattern.
                foreach ($patterns as $pattern) {
                    if (Inflector::is($pattern, $uri) or $pattern == gethostname()) {
                        return $environment;
                    }
                }
            }
        }
public static function detectEnv(array $environments, $uri)
        {
            foreach ($environments as $environment => $patterns) {
                // Essentially we just want to loop through each environment pattern
                // and determine if the current URI matches the pattern and if so
                // we will simply return the environment for that URI pattern.
                foreach ($patterns as $pattern) {
                    if (Inflector::is($pattern, $uri) or $pattern == gethostname()) {
                        return $environment;
                    }
                }
            }
        }
public static function detectEnv ( array $ environments , $ uri ) { foreach ( $ environments as $ environment => $ patterns ) { // Essentially we just want to loop through each environment pattern // and determine if the current URI matches the pattern and if so // we will simply return the environment for that URI pattern. foreach ( $ patterns as $ pattern ) { if ( Inflector :: is ( $ pattern , $ uri ) or $ pattern == gethostname ( ) ) { return $ environment ; } } } }
Detect the current environment from an environment configuration.

@param  array        $environments
@param  string       $uri
@return string|null
Detect the current environment from an environment configuration .