diff -r 000000000000 -r 4eba9c11703f web/Zend/Http/UserAgent/Features/Adapter/TeraWurfl.php --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/web/Zend/Http/UserAgent/Features/Adapter/TeraWurfl.php Mon Dec 13 18:29:26 2010 +0100 @@ -0,0 +1,102 @@ +getDeviceCapabilitiesFromRequest(array_change_key_case($request, CASE_UPPER)); + + return self::getAllCapabilities($wurflObj); + } + + /*** + * Builds an array with all capabilities + * + * @param TeraWurfl $wurflObj TeraWurfl object + */ + public static function getAllCapabilities(TeraWurfl $wurflObj) + { + + foreach ($wurflObj->capabilities as $group) { + if (!is_array($group)) { + continue; + } + while (list ($key, $value) = each($group)) { + if (is_bool($value)) { + // to have the same type than the official WURFL API + $features[$key] = ($value ? 'true' : 'false'); + } else { + $features[$key] = $value; + } + } + } + return $features; + } +}