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


PHP WURFL_Handlers_Utils::checkIfContainsAll方法代码示例

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


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

示例1: canHandle

 public function canHandle($userAgent)
 {
     if (WURFL_Handlers_Utils::isDesktopBrowser($userAgent)) {
         return false;
     }
     return WURFL_Handlers_Utils::checkIfContainsAll($userAgent, array('Android', 'Opera Mini'));
 }
开发者ID:vazahat,项目名称:dudex,代码行数:7,代码来源:OperaMiniOnAndroidHandler.php

示例2: canHandle

 public function canHandle($userAgent)
 {
     if (WURFL_Handlers_Utils::checkIfContainsAll($userAgent, array('Android', '/Kindle'))) {
         return false;
     }
     return WURFL_Handlers_Utils::checkIfContainsAnyOf($userAgent, array('Kindle', 'Silk'));
 }
开发者ID:dcunited08,项目名称:wurfl-api,代码行数:7,代码来源:KindleHandler.php

示例3: 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

示例4: applyRecoveryMatch

 public function applyRecoveryMatch($userAgent)
 {
     if (WURFL_Handlers_Utils::checkIfContainsAll($userAgent, array('like Gecko'))) {
         return 'windows_8_rt_ver1_subos81';
     } else {
         return 'generic_windows_8_rt';
     }
 }
开发者ID:conversionstudio,项目名称:cpatracker,代码行数:8,代码来源:WindowsRTHandler.php

示例5: applyRecoveryMatch

 public function applyRecoveryMatch($userAgent)
 {
     foreach ($this->lgupluses as $deviceId => $values) {
         if (WURFL_Handlers_Utils::checkIfContainsAll($userAgent, $values)) {
             return $deviceId;
         }
     }
     return null;
 }
开发者ID:godboko,项目名称:modules,代码行数:9,代码来源:LGUPLUSHandler.php

示例6: normalize

 public function normalize($userAgent)
 {
     if (WURFL_Handlers_Utils::checkIfContainsAll($userAgent, array('Android', 'Kindle Fire'))) {
         $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:godboko,项目名称:modules,代码行数:12,代码来源:Kindle.php

示例7: applyRecoveryMatch

 public function applyRecoveryMatch($userAgent)
 {
     if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'Nintendo Wii')) {
         return 'nintendo_wii_ver1';
     }
     if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'Nintendo DSi')) {
         return 'nintendo_dsi_ver1';
     }
     if (WURFL_Handlers_Utils::checkIfStartsWith($userAgent, 'Mozilla/') && WURFL_Handlers_Utils::checkIfContainsAll($userAgent, array('Nitro', 'Opera'))) {
         return 'nintendo_ds_ver1';
     }
     return 'nintendo_wii_ver1';
 }
开发者ID:conversionstudio,项目名称:cpatracker,代码行数:13,代码来源:NintendoHandler.php

示例8: applyRecoveryMatch

 public function applyRecoveryMatch($userAgent)
 {
     if (WURFL_Handlers_Utils::checkIfContainsAll($userAgent, array('Windows NT 5', 'POLARIS'))) {
         return 'generic_lguplus_rexos_facebook_browser';
     }
     if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'Windows NT 5')) {
         return 'generic_lguplus_rexos_webviewer_browser';
     }
     if (WURFL_Handlers_Utils::checkIfContainsAll($userAgent, array('Windows CE', 'POLARIS'))) {
         return 'generic_lguplus_winmo_facebook_browser';
     }
     if (WURFL_Handlers_Utils::checkIfContainsAll($userAgent, array('Android', 'AppleWebKit'))) {
         return 'generic_lguplus_android_webkit_browser';
     }
     return WURFL_Constants::NO_MATCH;
 }
开发者ID:vazahat,项目名称:dudex,代码行数:16,代码来源:LGUPLUSHandler.php

示例9: applyRecoveryMatch

 public function applyRecoveryMatch($userAgent)
 {
     if (WURFL_Handlers_Utils::checkIfContainsAnyOf($userAgent, array('WPDesktop', 'ZuneWP7')) || WURFL_Handlers_Utils::checkIfContainsAll($userAgent, array('Mozilla/5.0 (Windows NT ', ' ARM;', ' Edge/'))) {
         if (WURFL_Handlers_Utils::checkIfContainsAll($userAgent, array('Mozilla/5.0 (Windows NT ', ' ARM;', ' Edge/'))) {
             return 'generic_ms_phone_os10_desktopmode';
         }
         if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'WPDesktop')) {
             return 'generic_ms_phone_os8_desktopmode';
         }
         if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'Trident/5.0')) {
             return 'generic_ms_phone_os7_5_desktopmode';
         }
         return 'generic_ms_phone_os7_desktopmode';
     }
     $version = self::getWindowsPhoneVersion($userAgent);
     if ($version == "10.0") {
         return 'generic_ms_phone_os10';
     }
     if ($version == "8.1") {
         return 'generic_ms_phone_os8_1';
     }
     if ($version == "8.0") {
         return 'generic_ms_phone_os8';
     }
     if ($version == "7.8") {
         return 'generic_ms_phone_os7_8';
     }
     if ($version == "7.5") {
         return 'generic_ms_phone_os7_5';
     }
     if ($version == "7.0") {
         return 'generic_ms_phone_os7';
     }
     if ($version == "6.5") {
         return 'generic_ms_winmo6_5';
     }
     //These are probably UAs of the type "Windows Phone Ad Client (Xna)/5.1.0.0 BMID/E67970D969"
     if (WURFL_Handlers_Utils::checkIfStartsWithAnyOf($userAgent, array('Windows Phone Ad Client', 'WindowsPhoneAdClient'))) {
         return 'generic_ms_phone_os7';
     }
     return WURFL_Constants::NO_MATCH;
 }
开发者ID:acasademont,项目名称:wurfl,代码行数:42,代码来源:WindowsPhoneHandler.php

示例10: isDesktopBrowserHeavyDutyAnalysis

 /**
  * Is the given user agent very likely to be a desktop browser
  * @param string $userAgent
  * @return bool
  */
 public static function isDesktopBrowserHeavyDutyAnalysis($userAgent)
 {
     // Check Smart TV keywords
     if (WURFL_Handlers_Utils::isSmartTV($userAgent)) {
         return false;
     }
     //WP Desktop - Edge Mode
     if (WURFL_Handlers_Utils::checkIfContainsAll($userAgent, array('Mozilla/5.0 (Windows NT ', ' ARM;', ' Edge/'))) {
         return false;
     }
     // Chrome
     if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'Chrome') && !WURFL_Handlers_Utils::checkIfContainsAnyOf($userAgent, array('Android', 'Ventana'))) {
         return true;
     }
     // Check mobile keywords
     if (WURFL_Handlers_Utils::isMobileBrowser($userAgent)) {
         return false;
     }
     if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'PPC')) {
         return false;
     }
     // PowerPC; not always mobile, but we'll kick it out
     // Firefox;  fennec is already handled in the WURFL_Constants::$MOBILE_BROWSERS keywords
     if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'Firefox') && !WURFL_Handlers_Utils::checkIfContains($userAgent, 'Tablet')) {
         return true;
     }
     // Safari
     if (preg_match('#^Mozilla/5\\.0 \\((?:Macintosh|Windows)[^\\)]+\\) AppleWebKit/[\\d\\.]+ \\(KHTML, like Gecko\\) Version/[\\d\\.]+ Safari/[\\d\\.]+$#', $userAgent)) {
         return true;
     }
     // Opera Desktop
     if (WURFL_Handlers_Utils::checkIfStartsWith($userAgent, 'Opera/9.80 (Windows NT', 'Opera/9.80 (Macintosh')) {
         return true;
     }
     // Check desktop keywords
     if (WURFL_Handlers_Utils::isDesktopBrowser($userAgent)) {
         return true;
     }
     // Internet Explorer 11
     if (preg_match('/^Mozilla\\/5\\.0 \\(Windows NT.+?Trident.+?; rv:\\d\\d\\.\\d+\\)/', $userAgent)) {
         return true;
     }
     // Internet Explorer 9 or 10
     if (preg_match('/^Mozilla\\/5\\.0 \\(compatible; MSIE (9|10)\\.0; Windows NT \\d\\.\\d/', $userAgent)) {
         return true;
     }
     // Internet Explorer <9
     if (preg_match('/^Mozilla\\/4\\.0 \\(compatible; MSIE \\d\\.\\d; Windows NT \\d\\.\\d/', $userAgent)) {
         return true;
     }
     return false;
 }
开发者ID:acasademont,项目名称:wurfl,代码行数:57,代码来源:Utils.php

示例11: testContainsAll

 /**
  * @dataProvider containsAllDataProvider
  */
 public function testContainsAll($haystack, $needles, $contains)
 {
     $expected = WURFL_Handlers_Utils::checkIfContainsAll($haystack, $needles);
     $this->assertEquals($contains, $expected);
 }
开发者ID:acasademont,项目名称:wurfl,代码行数:8,代码来源:UtilsTest.php

示例12: canHandle

 public function canHandle($userAgent)
 {
     return WURFL_Handlers_Utils::checkIfContainsAll($userAgent, array('Windows NT 6.2', ' ARM;'));
 }
开发者ID:vazahat,项目名称:dudex,代码行数:4,代码来源:WindowsRTHandler.php


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