public function determineFromPath()
    {
        $releaseStage = null;
        // Create paths variable with host name, document root and file path
        $httpHost = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '';
        $documentRoot = isset($_SERVER['DOCUMENT_ROOT']) ? $_SERVER['DOCUMENT_ROOT'] : '';
        $paths = __DIR__ . $httpHost . $documentRoot;

        // Now check if paths variable contains "stage" or "staging" keywords
        if (strpos($paths, 'stage') !== false || strpos($paths, 'staging') !== false) {
            // Set release stage to staging
            $releaseStage = self::STAGING;
        } elseif (strpos(__FILE__, '/home') !== false && strpos(__FILE__, 'vhosts') !== false) {
            //Check for dev environment that works with cli scripts
            $releaseStage = self::DEVELOPMENT;
        } elseif (substr($httpHost, -6) == '.local' || substr($httpHost, -4) == '.dev') {
            $releaseStage = self::DEVELOPMENT;
        }
        return $releaseStage;
    }
public function determineFromPath()
    {
        $releaseStage = null;
        // Create paths variable with host name, document root and file path
        $httpHost = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '';
        $documentRoot = isset($_SERVER['DOCUMENT_ROOT']) ? $_SERVER['DOCUMENT_ROOT'] : '';
        $paths = __DIR__ . $httpHost . $documentRoot;

        // Now check if paths variable contains "stage" or "staging" keywords
        if (strpos($paths, 'stage') !== false || strpos($paths, 'staging') !== false) {
            // Set release stage to staging
            $releaseStage = self::STAGING;
        } elseif (strpos(__FILE__, '/home') !== false && strpos(__FILE__, 'vhosts') !== false) {
            //Check for dev environment that works with cli scripts
            $releaseStage = self::DEVELOPMENT;
        } elseif (substr($httpHost, -6) == '.local' || substr($httpHost, -4) == '.dev') {
            $releaseStage = self::DEVELOPMENT;
        }
        return $releaseStage;
    }
public function determineFromPath ( ) { $ releaseStage = null ; // Create paths variable with host name, document root and file path $ httpHost = isset ( $ _SERVER [ 'HTTP_HOST' ] ) ? $ _SERVER [ 'HTTP_HOST' ] : '' ; $ documentRoot = isset ( $ _SERVER [ 'DOCUMENT_ROOT' ] ) ? $ _SERVER [ 'DOCUMENT_ROOT' ] : '' ; $ paths = __DIR__ . $ httpHost . $ documentRoot ; // Now check if paths variable contains "stage" or "staging" keywords if ( strpos ( $ paths , 'stage' ) !== false || strpos ( $ paths , 'staging' ) !== false ) { // Set release stage to staging $ releaseStage = self :: STAGING ; } elseif ( strpos ( __FILE__ , '/home' ) !== false && strpos ( __FILE__ , 'vhosts' ) !== false ) { //Check for dev environment that works with cli scripts $ releaseStage = self :: DEVELOPMENT ; } elseif ( substr ( $ httpHost , - 6 ) == '.local' || substr ( $ httpHost , - 4 ) == '.dev' ) { $ releaseStage = self :: DEVELOPMENT ; } return $ releaseStage ; }
Determine the current environment based on the path

@return string
Determine the current environment based on the path