protected function _environmentDetector($detect)
    {
        if (isset($detect['env'])) {
            if (isset($detect['value'])) {
                return $this->getEnv($detect['env']) == $detect['value'];
            }
            if (isset($detect['pattern'])) {
                return (bool)preg_match($detect['pattern'], $this->getEnv($detect['env']));
            }
            if (isset($detect['options'])) {
                $pattern = '/' . implode('|', $detect['options']) . '/i';

                return (bool)preg_match($pattern, $this->getEnv($detect['env']));
            }
        }

        return false;
    }
protected function _environmentDetector($detect)
    {
        if (isset($detect['env'])) {
            if (isset($detect['value'])) {
                return $this->getEnv($detect['env']) == $detect['value'];
            }
            if (isset($detect['pattern'])) {
                return (bool)preg_match($detect['pattern'], $this->getEnv($detect['env']));
            }
            if (isset($detect['options'])) {
                $pattern = '/' . implode('|', $detect['options']) . '/i';

                return (bool)preg_match($pattern, $this->getEnv($detect['env']));
            }
        }

        return false;
    }
protected function _environmentDetector ( $ detect ) { if ( isset ( $ detect [ 'env' ] ) ) { if ( isset ( $ detect [ 'value' ] ) ) { return $ this -> getEnv ( $ detect [ 'env' ] ) == $ detect [ 'value' ] ; } if ( isset ( $ detect [ 'pattern' ] ) ) { return ( bool ) preg_match ( $ detect [ 'pattern' ] , $ this -> getEnv ( $ detect [ 'env' ] ) ) ; } if ( isset ( $ detect [ 'options' ] ) ) { $ pattern = '/' . implode ( '|' , $ detect [ 'options' ] ) . '/i' ; return ( bool ) preg_match ( $ pattern , $ this -> getEnv ( $ detect [ 'env' ] ) ) ; } } return false ; }
Detects if a specific environment variable is present.

@param array $detect Detector options array.
@return bool Whether or not the request is the type you are checking.
Detects if a specific environment variable is present .