src/Zend/Http/UserAgent.php
protected function _getUserAgentDevice($browserType)
    {
        $browserType = strtolower($browserType);
        if (isset($this->_browserTypeClass[$browserType])) {
            return $this->_browserTypeClass[$browserType];
        }

        if (isset($this->_config[$browserType])
            && isset($this->_config[$browserType]['device'])
        ) {
            $deviceConfig = $this->_config[$browserType]['device'];
            if (is_array($deviceConfig) && isset($deviceConfig['classname'])) {
                $device = (string) $deviceConfig['classname'];
                if (!class_exists($device)) {

                    throw new Zend_Http_UserAgent_Exception(sprintf(
                        'Invalid classname "%s" provided in device configuration for browser type "%s"',
                        $device,
                        $browserType
                    ));
                }
            } elseif (is_array($deviceConfig) && isset($deviceConfig['path'])) {
                $loader = $this->getPluginLoader('device');
                $path   = $deviceConfig['path'];
                $prefix = isset($deviceConfig['prefix']) ? $deviceConfig['prefix'] : 'Zend_Http_UserAgent';
                $loader->addPrefixPath($prefix, $path);

                $device = $loader->load($browserType);
            } else {
                $loader = $this->getPluginLoader('device');
                $device = $loader->load($browserType);
            }
        } else {
            $loader = $this->getPluginLoader('device');
            $device = $loader->load($browserType);
        }

        $this->_browserTypeClass[$browserType] = $device;

        return $device;
    }
protected function _getUserAgentDevice($browserType)
    {
        $browserType = strtolower($browserType);
        if (isset($this->_browserTypeClass[$browserType])) {
            return $this->_browserTypeClass[$browserType];
        }

        if (isset($this->_config[$browserType])
            && isset($this->_config[$browserType]['device'])
        ) {
            $deviceConfig = $this->_config[$browserType]['device'];
            if (is_array($deviceConfig) && isset($deviceConfig['classname'])) {
                $device = (string) $deviceConfig['classname'];
                if (!class_exists($device)) {

                    throw new Zend_Http_UserAgent_Exception(sprintf(
                        'Invalid classname "%s" provided in device configuration for browser type "%s"',
                        $device,
                        $browserType
                    ));
                }
            } elseif (is_array($deviceConfig) && isset($deviceConfig['path'])) {
                $loader = $this->getPluginLoader('device');
                $path   = $deviceConfig['path'];
                $prefix = isset($deviceConfig['prefix']) ? $deviceConfig['prefix'] : 'Zend_Http_UserAgent';
                $loader->addPrefixPath($prefix, $path);

                $device = $loader->load($browserType);
            } else {
                $loader = $this->getPluginLoader('device');
                $device = $loader->load($browserType);
            }
        } else {
            $loader = $this->getPluginLoader('device');
            $device = $loader->load($browserType);
        }

        $this->_browserTypeClass[$browserType] = $device;

        return $device;
    }
protected function _getUserAgentDevice ( $ browserType ) { $ browserType = strtolower ( $ browserType ) ; if ( isset ( $ this -> _browserTypeClass [ $ browserType ] ) ) { return $ this -> _browserTypeClass [ $ browserType ] ; } if ( isset ( $ this -> _config [ $ browserType ] ) && isset ( $ this -> _config [ $ browserType ] [ 'device' ] ) ) { $ deviceConfig = $ this -> _config [ $ browserType ] [ 'device' ] ; if ( is_array ( $ deviceConfig ) && isset ( $ deviceConfig [ 'classname' ] ) ) { $ device = ( string ) $ deviceConfig [ 'classname' ] ; if ( ! class_exists ( $ device ) ) { throw new Zend_Http_UserAgent_Exception ( sprintf ( 'Invalid classname "%s" provided in device configuration for browser type "%s"' , $ device , $ browserType ) ) ; } } elseif ( is_array ( $ deviceConfig ) && isset ( $ deviceConfig [ 'path' ] ) ) { $ loader = $ this -> getPluginLoader ( 'device' ) ; $ path = $ deviceConfig [ 'path' ] ; $ prefix = isset ( $ deviceConfig [ 'prefix' ] ) ? $ deviceConfig [ 'prefix' ] : 'Zend_Http_UserAgent' ; $ loader -> addPrefixPath ( $ prefix , $ path ) ; $ device = $ loader -> load ( $ browserType ) ; } else { $ loader = $ this -> getPluginLoader ( 'device' ) ; $ device = $ loader -> load ( $ browserType ) ; } } else { $ loader = $ this -> getPluginLoader ( 'device' ) ; $ device = $ loader -> load ( $ browserType ) ; } $ this -> _browserTypeClass [ $ browserType ] = $ device ; return $ device ; }
Loads class for a user agent device

@param  string $browserType Browser type
@return string
@throws Zend_Loader_PluginLoader_Exception if unable to load UA device
Loads class for a user agent device