当前位置: 首页>>代码示例>>PHP>>正文


PHP WURFL_Handlers_Utils::isDesktopBrowserHeavyDutyAnalysis方法代码示例

本文整理汇总了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);
 }
开发者ID:giangnh264,项目名称:mobileplus,代码行数:19,代码来源:WURFLManager.php

示例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;
 }
开发者ID:vazahat,项目名称:dudex,代码行数:26,代码来源:Handler.php

示例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;
 }
开发者ID:acasademont,项目名称:wurfl,代码行数:24,代码来源:WURFLService.php

示例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;
 }
开发者ID:acasademont,项目名称:wurfl,代码行数:80,代码来源:Handler.php


注:本文中的WURFL_Handlers_Utils::isDesktopBrowserHeavyDutyAnalysis方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。