public function get($force = false)
    {
        // Check if current set
        if (is_null(self::$current) || $force) {
            // Get environment variable (if set and valid)
            $releaseStage = trim(getenv('RELEASE_STAGE'));
            $releaseStage = in_array($releaseStage, $this->getAll()) ? $releaseStage : null;

            // If environment variable not set/valid, try to detect environment by url or path
            $releaseStage = $releaseStage ?: $this->determineFromPath();

            $releaseStage = $releaseStage ?: $this->detectAppServer();

            // If environment variable still not set, assume we are in production!
            $releaseStage = $releaseStage ?: self::PRODUCTION;

            self::$current = $releaseStage;
        }

        return self::$current;
    }
public function get($force = false)
    {
        // Check if current set
        if (is_null(self::$current) || $force) {
            // Get environment variable (if set and valid)
            $releaseStage = trim(getenv('RELEASE_STAGE'));
            $releaseStage = in_array($releaseStage, $this->getAll()) ? $releaseStage : null;

            // If environment variable not set/valid, try to detect environment by url or path
            $releaseStage = $releaseStage ?: $this->determineFromPath();

            $releaseStage = $releaseStage ?: $this->detectAppServer();

            // If environment variable still not set, assume we are in production!
            $releaseStage = $releaseStage ?: self::PRODUCTION;

            self::$current = $releaseStage;
        }

        return self::$current;
    }
public function get ( $ force = false ) { // Check if current set if ( is_null ( self :: $ current ) || $ force ) { // Get environment variable (if set and valid) $ releaseStage = trim ( getenv ( 'RELEASE_STAGE' ) ) ; $ releaseStage = in_array ( $ releaseStage , $ this -> getAll ( ) ) ? $ releaseStage : null ; // If environment variable not set/valid, try to detect environment by url or path $ releaseStage = $ releaseStage ? : $ this -> determineFromPath ( ) ; $ releaseStage = $ releaseStage ? : $ this -> detectAppServer ( ) ; // If environment variable still not set, assume we are in production! $ releaseStage = $ releaseStage ? : self :: PRODUCTION ; self :: $ current = $ releaseStage ; } return self :: $ current ; }
Get release stage

@param boolean $force Bypass any possible caching

@return string textual representation of the current release stage
Get release stage