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


PHP WURFL_Handlers_Utils::checkIfContains方法代码示例

本文整理汇总了PHP中WURFL_Handlers_Utils::checkIfContains方法的典型用法代码示例。如果您正苦于以下问题:PHP WURFL_Handlers_Utils::checkIfContains方法的具体用法?PHP WURFL_Handlers_Utils::checkIfContains怎么用?PHP WURFL_Handlers_Utils::checkIfContains使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在WURFL_Handlers_Utils的用法示例。


在下文中一共展示了WURFL_Handlers_Utils::checkIfContains方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: applyRecoveryMatch

 public function applyRecoveryMatch($userAgent)
 {
     if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'Windows CE;')) {
         return 'generic_ms_mobile';
     }
     return $this->getDeviceIDFromRIS($userAgent, 6);
 }
开发者ID:vazahat,项目名称:dudex,代码行数:7,代码来源:HTCHandler.php

示例2: applyRecoveryMatch

 /**
  *
  * @param string $userAgent
  * @return string
  */
 function applyRecoveryMatch($userAgent)
 {
     if (WURFL_Handlers_Utils::checkIfContains($userAgent, "Opera")) {
         return "opera";
     }
     return "opwv_v62_generic";
 }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:12,代码来源:KDDIHandler.php

示例3: canHandle

 public function canHandle($userAgent)
 {
     if (WURFL_Handlers_Utils::isDesktopBrowser($userAgent)) {
         return false;
     }
     return WURFL_Handlers_Utils::checkIfContains($userAgent, 'KDDI-');
 }
开发者ID:vazahat,项目名称:dudex,代码行数:7,代码来源:KDDIHandler.php

示例4: normalize

 public function normalize($userAgent)
 {
     if (WURFL_Handlers_Utils::checkIfContainsAnyOf($userAgent, array('WPDesktop', 'ZuneWP7')) || WURFL_Handlers_Utils::checkIfContainsAll($userAgent, array('Mozilla/5.0 (Windows NT ', ' ARM;', ' Edge/'))) {
         $model = WURFL_Handlers_WindowsPhoneHandler::getWindowsPhoneDesktopModel($userAgent);
         $version = WURFL_Handlers_WindowsPhoneHandler::getWindowsPhoneDesktopVersion($userAgent);
     } else {
         if (WURFL_Handlers_Utils::checkIfStartsWithAnyOf($userAgent, array('Windows Phone Ad Client', 'WindowsPhoneAdClient'))) {
             $model = WURFL_Handlers_WindowsPhoneHandler::getWindowsPhoneAdClientModel($userAgent);
             $version = WURFL_Handlers_WindowsPhoneHandler::getWindowsPhoneVersion($userAgent);
         } else {
             if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'NativeHost')) {
                 return $userAgent;
             } else {
                 $model = WURFL_Handlers_WindowsPhoneHandler::getWindowsPhoneModel($userAgent);
                 $version = WURFL_Handlers_WindowsPhoneHandler::getWindowsPhoneVersion($userAgent);
             }
         }
     }
     if ($model !== null && $version !== null) {
         // "WP" is for Windows Phone
         $prefix = 'WP' . $version . ' ' . $model . WURFL_Constants::RIS_DELIMITER;
         return $prefix . $userAgent;
     }
     return $userAgent;
 }
开发者ID:dcunited08,项目名称:wurfl-api,代码行数:25,代码来源:WindowsPhone.php

示例5: applyRecoveryMatch

 /**
  * if the UA contains "iPhone" return "apple_iphone_ver1"
  * if the UA contains "iPod" return "apple_ipod_touch_ver1"
  *
  * @param string $userAgent
  * @return string
  */
 function applyRecoveryMatch($userAgent)
 {
     if (WURFL_Handlers_Utils::checkIfContains($userAgent, "iPhone")) {
         return "apple_iphone_ver1";
     }
     return "apple_ipod_touch_ver1";
 }
开发者ID:eusholli,项目名称:drupal,代码行数:14,代码来源:AppleHandler.php

示例6: normalize

 public function normalize($userAgent)
 {
     $ucb_version = WURFL_Handlers_UcwebU3Handler::getUcBrowserVersion($userAgent);
     if ($ucb_version === null) {
         return $userAgent;
     }
     //Android U3K Mobile + Tablet
     if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'Android')) {
         // Apply Version+Model--- matching normalization
         $model = WURFL_Handlers_AndroidHandler::getAndroidModel($userAgent, false);
         $version = WURFL_Handlers_AndroidHandler::getAndroidVersion($userAgent, false);
         if ($model !== null && $version !== null) {
             $prefix = "{$version} U3Android {$ucb_version} {$model}" . WURFL_Constants::RIS_DELIMITER;
             return $prefix . $userAgent;
         }
     } else {
         if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'iPhone;')) {
             if (preg_match('/iPhone OS (\\d+)(?:_(\\d+))?(?:_\\d+)* like/', $userAgent, $matches)) {
                 $version = $matches[1] . '.' . $matches[2];
                 $prefix = "{$version} U3iPhone {$ucb_version}" . WURFL_Constants::RIS_DELIMITER;
                 return $prefix . $userAgent;
             }
         } else {
             if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'iPad')) {
                 if (preg_match('/CPU OS (\\d)_?(\\d)?.+like Mac.+; iPad([0-9,]+)\\) AppleWebKit/', $userAgent, $matches)) {
                     $version = $matches[1] . '.' . $matches[2];
                     $model = $matches[3];
                     $prefix = "{$version} U3iPad {$ucb_version} {$model}" . WURFL_Constants::RIS_DELIMITER;
                     return $prefix . $userAgent;
                 }
             }
         }
     }
     return $userAgent;
 }
开发者ID:ricardoh,项目名称:wurfl-php-api,代码行数:35,代码来源:UcwebU3.php

示例7: applyRecoveryMatch

 /**
  * If the User Agent contains "MIB/2.2" or "MIB/BER2.2", 
  * return "mot_mib22_generic"
  *
  * @param string $userAgent
  * @return string
  */
 function applyRecoveryMatch($userAgent)
 {
     if (WURFL_Handlers_Utils::checkIfContains($userAgent, "MIB/2.2") || WURFL_Handlers_Utils::checkIfContains($userAgent, "MIB/BER2.2")) {
         return "mot_mib22_generic";
     }
     return WURFL_Constants::GENERIC;
 }
开发者ID:eusholli,项目名称:drupal,代码行数:14,代码来源:MotorolaHandler.php

示例8: canHandle

 /**
  * Intercept all UAs Containing AOL and are not mobile browsers
  *
  * @param string $userAgent
  * @return boolean
  */
 public function canHandle($userAgent)
 {
     if (WURFL_Handlers_Utils::isMobileBrowser($userAgent)) {
         return false;
     }
     return WURFL_Handlers_Utils::checkIfContains($userAgent, "AOL");
 }
开发者ID:muliadi,项目名称:jfportabledevice,代码行数:13,代码来源:AOLHandler.php

示例9: canHandle

 public function canHandle($userAgent)
 {
     if (WURFL_Handlers_Utils::isDesktopBrowser($userAgent)) {
         return false;
     }
     return WURFL_Handlers_Utils::checkIfStartsWith($userAgent, 'UCWEB') && WURFL_Handlers_Utils::checkIfContains($userAgent, 'UCBrowser');
 }
开发者ID:conversionstudio,项目名称:cpatracker,代码行数:7,代码来源:UcwebU2Handler.php

示例10: normalize

 public function normalize($userAgent)
 {
     // Normalize Android version
     $userAgent = preg_replace('/(Android)[ \\-\\/](\\d\\.\\d)([^; \\/\\)]+)/', '$1 $2', $userAgent);
     // Opera Mobi/Tablet
     $is_opera_mobi = WURFL_Handlers_Utils::checkIfContains($userAgent, 'Opera Mobi');
     $is_opera_tablet = WURFL_Handlers_Utils::checkIfContains($userAgent, 'Opera Tablet');
     if ($is_opera_mobi || $is_opera_tablet) {
         $opera_version = WURFL_Handlers_AndroidHandler::getOperaOnAndroidVersion($userAgent, false);
         $android_version = WURFL_Handlers_AndroidHandler::getAndroidVersion($userAgent, false);
         if ($opera_version !== null && $android_version !== null) {
             $opera_model = $is_opera_tablet ? 'Opera Tablet' : 'Opera Mobi';
             $prefix = $opera_model . ' ' . $opera_version . ' Android ' . $android_version . WURFL_Constants::RIS_DELIMITER;
             return $prefix . $userAgent;
         }
     }
     // Stock Android
     if (!WURFL_Handlers_Utils::checkIfContainsAnyOf($userAgent, $this->skip_normalization)) {
         $model = WURFL_Handlers_AndroidHandler::getAndroidModel($userAgent, false);
         $version = WURFL_Handlers_AndroidHandler::getAndroidVersion($userAgent, false);
         if ($model !== null && $version !== null) {
             $prefix = $version . ' ' . $model . WURFL_Constants::RIS_DELIMITER;
             return $prefix . $userAgent;
         }
     }
     return $userAgent;
 }
开发者ID:NinjoCat,项目名称:Ninjo,代码行数:27,代码来源:Android.php

示例11: canHandle

 public function canHandle($userAgent)
 {
     if (WURFL_Handlers_Utils::isDesktopBrowser($userAgent)) {
         return false;
     }
     return WURFL_Handlers_Utils::checkIfContains($userAgent, 'Android') && WURFL_Handlers_Utils::checkIfContains($userAgent, 'NetFrontLifeBrowser/2.2');
 }
开发者ID:dcunited08,项目名称:wurfl-api,代码行数:7,代码来源:NetFrontOnAndroidHandler.php

示例12: canHandle

 public function canHandle($userAgent)
 {
     if (WURFL_Handlers_Utils::isMobileBrowser($userAgent)) {
         return false;
     }
     return WURFL_Handlers_Utils::checkIfContains($userAgent, 'Safari') && WURFL_Handlers_Utils::checkIfStartsWithAnyOf($userAgent, array('Mozilla/5.0 (Macintosh', 'Mozilla/5.0 (Windows'));
 }
开发者ID:dcunited08,项目名称:wurfl-api,代码行数:7,代码来源:SafariHandler.php

示例13: applyRecoveryMatch

 public function applyRecoveryMatch($userAgent)
 {
     if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'MSIE 10.0')) {
         return 'microsoft_xbox360_ver1_subie10';
     }
     return 'microsoft_xbox360_ver1';
 }
开发者ID:vazahat,项目名称:dudex,代码行数:7,代码来源:XboxHandler.php

示例14: applyRecoveryMatch

 public function applyRecoveryMatch($userAgent)
 {
     if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'Froyo')) {
         return 'generic_android_ver2_2';
     }
     $android_version = self::getAndroidVersion($userAgent);
     $version_string = str_replace('.', '_', $android_version);
     $deviceID = 'generic_android_ver' . $version_string;
     if ($deviceID == 'generic_android_ver2_0') {
         $deviceID = 'generic_android_ver2';
     }
     if ($deviceID == 'generic_android_ver4_0') {
         $deviceID = 'generic_android_ver4';
     }
     if (($android_version < 3.0 || $android_version >= 4.0) && WURFL_Handlers_Utils::checkIfContains($userAgent, 'Safari') && !WURFL_Handlers_Utils::checkIfContains($userAgent, 'Mobile')) {
         // This is probably a tablet (Android 3.x is always a tablet, so it doesn't have a "_tablet" ID)
         if (in_array($deviceID . '_tablet', self::$constantIDs)) {
             return $deviceID . '_tablet';
         }
         return 'generic_android_ver1_5_tablet';
     }
     if (in_array($deviceID, self::$constantIDs)) {
         return $deviceID;
     }
     return 'generic_android';
 }
开发者ID:vazahat,项目名称:dudex,代码行数:26,代码来源:AndroidHandler.php

示例15: applyRecoveryMatch

 public function applyRecoveryMatch($userAgent)
 {
     if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'Windows CE;')) {
         return 'generic_ms_mobile';
     }
     return WURFL_Constants::NO_MATCH;
 }
开发者ID:dcunited08,项目名称:wurfl-api,代码行数:7,代码来源:HTCHandler.php


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