src/Zend/Http/UserAgent.php
protected function _matchUserAgent()
    {
        $type = self::DEFAULT_BROWSER_TYPE;

        // If we have no identification sequence, just return the default type
        if (empty($this->_config['identification_sequence'])) {
            return $type;
        }

        // Get sequence against which to match
        $sequence = explode(',', $this->_config['identification_sequence']);

        // If a browser type is already configured, push that to the front of the list
        if (null !== ($browserType = $this->getBrowserType())) {
            array_unshift($sequence, $browserType);
        }

        // Append the default browser type to the list if not alread in the list
        if (!in_array($type, $sequence)) {
            $sequence[] = $type;
        }

        // Test each type until we find a match
        foreach ($sequence as $browserType) {
            $browserType = trim($browserType);
            $className   = $this->_getUserAgentDevice($browserType);

            // Attempt to match this device class
            if ($this->_match($className)) {
                $type = $browserType;
                $this->_browserTypeClass[$type] = $className;
                break;
            }
        }

        return $type;
    }
protected function _matchUserAgent()
    {
        $type = self::DEFAULT_BROWSER_TYPE;

        // If we have no identification sequence, just return the default type
        if (empty($this->_config['identification_sequence'])) {
            return $type;
        }

        // Get sequence against which to match
        $sequence = explode(',', $this->_config['identification_sequence']);

        // If a browser type is already configured, push that to the front of the list
        if (null !== ($browserType = $this->getBrowserType())) {
            array_unshift($sequence, $browserType);
        }

        // Append the default browser type to the list if not alread in the list
        if (!in_array($type, $sequence)) {
            $sequence[] = $type;
        }

        // Test each type until we find a match
        foreach ($sequence as $browserType) {
            $browserType = trim($browserType);
            $className   = $this->_getUserAgentDevice($browserType);

            // Attempt to match this device class
            if ($this->_match($className)) {
                $type = $browserType;
                $this->_browserTypeClass[$type] = $className;
                break;
            }
        }

        return $type;
    }
protected function _matchUserAgent ( ) { $ type = self :: DEFAULT_BROWSER_TYPE ; // If we have no identification sequence, just return the default type if ( empty ( $ this -> _config [ 'identification_sequence' ] ) ) { return $ type ; } // Get sequence against which to match $ sequence = explode ( ',' , $ this -> _config [ 'identification_sequence' ] ) ; // If a browser type is already configured, push that to the front of the list if ( null !== ( $ browserType = $ this -> getBrowserType ( ) ) ) { array_unshift ( $ sequence , $ browserType ) ; } // Append the default browser type to the list if not alread in the list if ( ! in_array ( $ type , $ sequence ) ) { $ sequence [ ] = $ type ; } // Test each type until we find a match foreach ( $ sequence as $ browserType ) { $ browserType = trim ( $ browserType ) ; $ className = $ this -> _getUserAgentDevice ( $ browserType ) ; // Attempt to match this device class if ( $ this -> _match ( $ className ) ) { $ type = $ browserType ; $ this -> _browserTypeClass [ $ type ] = $ className ; break ; } } return $ type ; }
Run the identification sequence to match the right browser type according to the
user agent

@return Zend_Http_UserAgent_Result
Run the identification sequence to match the right browser type according to the user agent