本文整理汇总了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);
}
示例2: applyRecoveryMatch
/**
*
* @param string $userAgent
* @return string
*/
function applyRecoveryMatch($userAgent)
{
if (WURFL_Handlers_Utils::checkIfContains($userAgent, "Opera")) {
return "opera";
}
return "opwv_v62_generic";
}
示例3: canHandle
public function canHandle($userAgent)
{
if (WURFL_Handlers_Utils::isDesktopBrowser($userAgent)) {
return false;
}
return WURFL_Handlers_Utils::checkIfContains($userAgent, 'KDDI-');
}
示例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;
}
示例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";
}
示例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;
}
示例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;
}
示例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");
}
示例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');
}
示例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;
}
示例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');
}
示例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'));
}
示例13: applyRecoveryMatch
public function applyRecoveryMatch($userAgent)
{
if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'MSIE 10.0')) {
return 'microsoft_xbox360_ver1_subie10';
}
return 'microsoft_xbox360_ver1';
}
示例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';
}
示例15: applyRecoveryMatch
public function applyRecoveryMatch($userAgent)
{
if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'Windows CE;')) {
return 'generic_ms_mobile';
}
return WURFL_Constants::NO_MATCH;
}