Zend_Http_UserAgent_Features_Exception example


    public static function getFromRequest($request, array $config)
    {
        if (!class_exists('TeraWurfl')) {
            // If TeraWurfl class not found, see if we can load it from             // configuration             //             if (!isset($config['terawurfl'])) {
                // No configuration                 throw new Zend_Http_UserAgent_Features_Exception('"TeraWurfl" configuration is not defined');
            }

            $config = $config['terawurfl'];

             if (empty($config['terawurfl_lib_dir'])) {
                // No lib_dir given                 throw new Zend_Http_UserAgent_Features_Exception('The "terawurfl_lib_dir" parameter is not defined');
            }

            // Include the Tera-WURFL file         }


        

    /** * Get features from request * * @param array $request $_SERVER variable * @return array */
    public static function getFromRequest($request, array $config)
    {
        if (!class_exists('Mobi_Mtld_DA_Api')) {
            if (!isset($config['deviceatlas'])) {
                throw new Zend_Http_UserAgent_Features_Exception('"DeviceAtlas" configuration is not defined');
            }
        }

        $config = $config['deviceatlas'];

        if (!class_exists('Mobi_Mtld_DA_Api')) {
            if (empty($config['deviceatlas_lib_dir'])) {
                throw new Zend_Http_UserAgent_Features_Exception('The "deviceatlas_lib_dir" parameter is not defined');
            }

            // Include the Device Atlas file from the specified lib_dir

    public function __construct()
    {
        $browscap = ini_get('browscap');
        if (empty($browscap) || !file_exists($browscap)) {
            throw new Zend_Http_UserAgent_Features_Exception(sprintf(
                '%s requires a browscap entry in php.ini pointing to a valid browscap.ini; none present',
                __CLASS__
            ));
        }
    }

    /** * Get features from request * * @param array $request $_SERVER variable * @param array $config ignored; included only to satisfy parent class * @return array */
Home | Imprint | This part of the site doesn't use cookies.