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


PHP WURFL_Handlers_Utils::checkIfStartsWithAnyOf方法代码示例

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


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

示例1: canHandle

 public function canHandle($userAgent)
 {
     if (WURFL_Handlers_Utils::isDesktopBrowser($userAgent)) {
         return false;
     }
     return WURFL_Handlers_Utils::checkIfStartsWithAnyOf($userAgent, array('Sagem', 'SAGEM'));
 }
开发者ID:acasademont,项目名称:wurfl,代码行数:7,代码来源:SagemHandler.php

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

示例3: canHandle

 public function canHandle($userAgent)
 {
     if (WURFL_Handlers_Utils::isDesktopBrowser($userAgent)) {
         return false;
     }
     return WURFL_Handlers_Utils::checkIfStartsWithAnyOf($userAgent, array('Pantech', 'PT-', 'PANTECH', 'PG-'));
 }
开发者ID:dcunited08,项目名称:wurfl-api,代码行数:7,代码来源:PantechHandler.php

示例4: canHandle

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

示例5: canHandle

 public function canHandle($userAgent)
 {
     if (WURFL_Handlers_Utils::isDesktopBrowser($userAgent)) {
         return false;
     }
     return WURFL_Handlers_Utils::checkIfStartsWithAnyOf($userAgent, array('Sanyo', 'SANYO')) || WURFL_Handlers_Utils::checkIfContains($userAgent, 'MobilePhone');
 }
开发者ID:acasademont,项目名称:wurfl,代码行数:7,代码来源:SanyoHandler.php

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

示例7: applyConclusiveMatch

 public function applyConclusiveMatch($userAgent)
 {
     if (WURFL_Handlers_Utils::checkIfStartsWithAnyOf($userAgent, array('Mot-', 'MOT-', 'Motorola'))) {
         return $this->getDeviceIDFromRIS($userAgent, WURFL_Handlers_Utils::firstSlash($userAgent));
     }
     return $this->getDeviceIDFromLD($userAgent, 5);
 }
开发者ID:godboko,项目名称:modules,代码行数:7,代码来源:MotorolaHandler.php

示例8: canHandle

 public function canHandle($userAgent)
 {
     if (WURFL_Handlers_Utils::isDesktopBrowser($userAgent)) {
         return false;
     }
     return WURFL_Handlers_Utils::checkIfStartsWithAnyOf($userAgent, array('Mot-', 'MOT-', 'MOTO', 'moto')) || WURFL_Handlers_Utils::checkIfContains($userAgent, 'Motorola');
 }
开发者ID:dcunited08,项目名称:wurfl-api,代码行数:7,代码来源:MotorolaHandler.php

示例9: applyConclusiveMatch

 public function applyConclusiveMatch($userAgent)
 {
     $tolerance = WURFL_Handlers_Utils::indexOfAnyOrLength($userAgent, array('/', ' '), strpos($userAgent, 'Nokia'));
     if (WURFL_Handlers_Utils::checkIfStartsWithAnyOf($userAgent, array('Nokia/', 'Nokia '))) {
         $tolerance = strlen($userAgent);
     }
     return $this->getDeviceIDFromRIS($userAgent, $tolerance);
 }
开发者ID:acasademont,项目名称:wurfl,代码行数:8,代码来源:NokiaHandler.php

示例10: applyConclusiveMatch

 public function applyConclusiveMatch($userAgent)
 {
     if (WURFL_Handlers_Utils::checkIfStartsWithAnyOf($userAgent, array("SEC-", "SAMSUNG-", "SCH"))) {
         $tolerance = WURFL_Handlers_Utils::firstSlash($userAgent);
     } elseif (WURFL_Handlers_Utils::checkIfStartsWithAnyOf($userAgent, array("Samsung", "SPH", "SGH"))) {
         $tolerance = WURFL_Handlers_Utils::firstSpace($userAgent);
     } else {
         $tolerance = WURFL_Handlers_Utils::secondSlash($userAgent);
     }
     return $this->getDeviceIDFromRIS($userAgent, $tolerance);
 }
开发者ID:acasademont,项目名称:wurfl,代码行数:11,代码来源:SamsungHandler.php

示例11: tolerance

 private function tolerance($userAgent)
 {
     if (WURFL_Handlers_Utils::checkIfStartsWithAnyOf($userAgent, array("SEC-", "SAMSUNG-", "SCH"))) {
         return WURFL_Handlers_Utils::firstSlash($userAgent);
     }
     if (WURFL_Handlers_Utils::checkIfStartsWithAnyOf($userAgent, array("Samsung-", "SPH", "SGH"))) {
         return WURFL_Handlers_Utils::firstSpace($userAgent);
     }
     if (WURFL_Handlers_Utils::checkIfStartsWith($userAgent, "SAMSUNG/")) {
         return WURFL_Handlers_Utils::secondSlash($userAgent);
     }
     return WURFL_Handlers_Utils::firstSlash($userAgent);
 }
开发者ID:realsoc,项目名称:mediawiki-extensions,代码行数:13,代码来源:SamsungHandler.php

示例12: applyConclusiveMatch

 public function applyConclusiveMatch($userAgent)
 {
     $tolerance = WURFL_Handlers_Utils::toleranceToRisDelimeter($userAgent);
     if ($tolerance !== false) {
         return $this->getDeviceIDFromRIS($userAgent, $tolerance);
     }
     //Return no match for UAs with no extractable Android version, model and that do not start with either Mozilla or Dalvik
     if (!WURFL_Handlers_Utils::checkIfStartsWithAnyOf($userAgent, array('Mozilla', 'Dalvik'))) {
         return WURFL_Constants::NO_MATCH;
     }
     // Standard RIS Matching
     $tolerance = WURFL_Handlers_Utils::indexOfAnyOrLength($userAgent, array(' Build/', ' AppleWebKit'));
     return $this->getDeviceIDFromRIS($userAgent, $tolerance);
 }
开发者ID:NinjoCat,项目名称:Ninjo,代码行数:14,代码来源:AndroidHandler.php

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

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

示例15: canHandle

 /**
  * Final Interceptor: Intercept
  * Everything that has not been trapped by a previous handler
  *
  * @param string $userAgent
  * @return boolean always true
  */
 public function canHandle($userAgent)
 {
     return WURFL_Handlers_Utils::checkIfStartsWithAnyOf($userAgent, array('Mozilla/4', 'Mozilla/5'));
 }
开发者ID:dcunited08,项目名称:wurfl-api,代码行数:11,代码来源:CatchAllMozillaHandler.php


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