本文整理汇总了PHP中WURFL_Handlers_Utils::isDesktopBrowserHeavyDutyAnalysis方法的典型用法代码示例。如果您正苦于以下问题:PHP WURFL_Handlers_Utils::isDesktopBrowserHeavyDutyAnalysis方法的具体用法?PHP WURFL_Handlers_Utils::isDesktopBrowserHeavyDutyAnalysis怎么用?PHP WURFL_Handlers_Utils::isDesktopBrowserHeavyDutyAnalysis使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WURFL_Handlers_Utils
的用法示例。
在下文中一共展示了WURFL_Handlers_Utils::isDesktopBrowserHeavyDutyAnalysis方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getDeviceForRequest
/**
* Return a device the given WURFL_Request_GenericRequest request(user-agent..)
*
* @param WURFL_Request_GenericRequest $request
* @return WURFL_CustomDevice device
* @throws Exception if the $request parameter is not set
*/
public function getDeviceForRequest(WURFL_Request_GenericRequest $request)
{
if (!isset($request)) {
throw new Exception("The request parameter must be set.");
}
WURFL_Handlers_Utils::reset();
if (WURFL_Configuration_ConfigHolder::getWURFLConfig()->isHighPerformance() && WURFL_Handlers_Utils::isDesktopBrowserHeavyDutyAnalysis($request->userAgent)) {
// This device has been identified as a web browser programatically, so no call to WURFL is necessary
return $this->_wurflService->getDevice(WURFL_Constants::GENERIC_WEB_BROWSER);
}
return $this->_wurflService->getDeviceForRequest($request);
}
示例2: applyRecoveryCatchAllMatch
/**
* Applies Catch-All match
* @param string $userAgent
* @return string WURFL deviceID
*/
public function applyRecoveryCatchAllMatch($userAgent)
{
if (WURFL_Handlers_Utils::isDesktopBrowserHeavyDutyAnalysis($userAgent)) {
return WURFL_Constants::GENERIC_WEB_BROWSER;
}
$mobile = WURFL_Handlers_Utils::isMobileBrowser($userAgent);
$desktop = WURFL_Handlers_Utils::isDesktopBrowser($userAgent);
if (!$desktop) {
$deviceId = WURFL_Handlers_Utils::getMobileCatchAllId($userAgent);
if ($deviceId !== WURFL_Constants::NO_MATCH) {
return $deviceId;
}
}
if ($mobile) {
return WURFL_Constants::GENERIC_MOBILE;
}
if ($desktop) {
return WURFL_Constants::GENERIC_WEB_BROWSER;
}
return WURFL_Constants::GENERIC;
}
示例3: deviceIdForRequest
/**
* Returns the device id for the device that matches the $request
* @param WURFL_Request_GenericRequest $request WURFL Request object
* @return string WURFL device id
*/
private function deviceIdForRequest($request)
{
$deviceId = $this->_cacheProvider->load($request->id);
if (empty($deviceId)) {
$generic_normalizer = WURFL_UserAgentHandlerChainFactory::createGenericNormalizers();
$request->userAgentNormalized = $generic_normalizer->normalize($request->userAgent);
if (WURFL_Configuration_ConfigHolder::getWURFLConfig()->isHighPerformance() && WURFL_Handlers_Utils::isDesktopBrowserHeavyDutyAnalysis($request->userAgentNormalized)) {
// This device has been identified as a web browser programatically, so no call to WURFL is necessary
return WURFL_Constants::GENERIC_WEB_BROWSER;
}
$deviceId = $this->_userAgentHandlerChain->match($request);
// save it in cache
$this->_cacheProvider->save($request->id, $deviceId);
} else {
$request->matchInfo->from_cache = true;
$request->matchInfo->lookup_time = 0.0;
}
return $deviceId;
}
示例4: applyRecoveryCatchAllMatch
/**
* Applies Catch-All match
* @param string $userAgent
* @return string WURFL deviceID
*/
public function applyRecoveryCatchAllMatch($userAgent)
{
if (WURFL_Handlers_Utils::isDesktopBrowserHeavyDutyAnalysis($userAgent)) {
return WURFL_Constants::GENERIC_WEB_BROWSER;
}
if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'CoreMedia')) {
return 'apple_iphone_coremedia_ver1';
}
if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'Windows CE')) {
return 'generic_ms_mobile';
}
if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'UP.Browser/7.2')) {
return 'opwv_v72_generic';
}
if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'UP.Browser/7')) {
return 'opwv_v7_generic';
}
if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'UP.Browser/6.2')) {
return 'opwv_v62_generic';
}
if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'UP.Browser/6')) {
return 'opwv_v6_generic';
}
if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'UP.Browser/5')) {
return 'upgui_generic';
}
if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'UP.Browser/4')) {
return 'uptext_generic';
}
if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'UP.Browser/3')) {
return 'uptext_generic';
}
// Series 60
if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'Series60')) {
return 'nokia_generic_series60';
}
// Access/Net Front
if (WURFL_Handlers_Utils::checkIfContainsAnyOf($userAgent, array('NetFront/3.0', 'ACS-NF/3.0'))) {
return 'generic_netfront_ver3';
}
if (WURFL_Handlers_Utils::checkIfContainsAnyOf($userAgent, array('NetFront/3.1', 'ACS-NF/3.1'))) {
return 'generic_netfront_ver3_1';
}
if (WURFL_Handlers_Utils::checkIfContainsAnyOf($userAgent, array('NetFront/3.2', 'ACS-NF/3.2'))) {
return 'generic_netfront_ver3_2';
}
if (WURFL_Handlers_Utils::checkIfContainsAnyOf($userAgent, array('NetFront/3.3', 'ACS-NF/3.3'))) {
return 'generic_netfront_ver3_3';
}
if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'NetFront/3.4')) {
return 'generic_netfront_ver3_4';
}
if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'NetFront/3.5')) {
return 'generic_netfront_ver3_5';
}
if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'NetFront/4.0')) {
return 'generic_netfront_ver4_0';
}
// Contains Mozilla/, but not at the beginning of the UA
// ie: MOTORAZR V8/R601_G_80.41.17R Mozilla/4.0 (compatible; MSIE 6.0 Linux; MOTORAZR V88.50) Profile/MIDP-2.0 Configuration/CLDC-1.1 Opera 8.50[zh]
if (strpos($userAgent, 'Mozilla/') > 0) {
return WURFL_Constants::GENERIC_XHTML;
}
if (WURFL_Handlers_Utils::checkIfContainsAnyOf($userAgent, array('Obigo', 'AU-MIC/2', 'AU-MIC-', 'AU-OBIGO/', 'Teleca Q03B1'))) {
return WURFL_Constants::GENERIC_XHTML;
}
// DoCoMo
if (WURFL_Handlers_Utils::checkIfStartsWithAnyOf($userAgent, array('DoCoMo', 'KDDI'))) {
return 'docomo_generic_jap_ver1';
}
if (WURFL_Handlers_Utils::isMobileBrowser($userAgent)) {
return WURFL_Constants::GENERIC_MOBILE;
}
return WURFL_Constants::GENERIC;
}