本文整理汇总了PHP中WURFL_Handlers_Utils::checkIfContainsAnyOf方法的典型用法代码示例。如果您正苦于以下问题:PHP WURFL_Handlers_Utils::checkIfContainsAnyOf方法的具体用法?PHP WURFL_Handlers_Utils::checkIfContainsAnyOf怎么用?PHP WURFL_Handlers_Utils::checkIfContainsAnyOf使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WURFL_Handlers_Utils
的用法示例。
在下文中一共展示了WURFL_Handlers_Utils::checkIfContainsAnyOf方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: canHandle
public function canHandle($userAgent)
{
if (WURFL_Handlers_Utils::isDesktopBrowser($userAgent)) {
return false;
}
return WURFL_Handlers_Utils::checkIfStartsWith($userAgent, 'Mozilla/5') && WURFL_Handlers_Utils::checkIfContainsAnyOf($userAgent, array('iPhone', 'iPod', 'iPad'));
}
示例2: canHandle
public function canHandle($userAgent)
{
if (WURFL_Handlers_Utils::isDesktopBrowser($userAgent)) {
return false;
}
return WURFL_Handlers_Utils::checkIfContainsAnyOf($userAgent, array('iPhone', 'iPod', 'iPad')) && !WURFL_Handlers_Utils::checkIfContains($userAgent, 'Symbian');
}
示例3: canHandle
public function canHandle($userAgent)
{
if (WURFL_Handlers_Utils::isDesktopBrowser($userAgent)) {
return false;
}
return WURFL_Handlers_Utils::checkIfContains($userAgent, 'Android') && WURFL_Handlers_Utils::checkIfContainsAnyOf($userAgent, array('Opera Mobi', 'Opera Tablet'));
}
示例4: 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;
}
示例5: applyRecoveryMatch
public function applyRecoveryMatch($userAgent)
{
if (WURFL_Handlers_Utils::checkIfContainsAnyOf($userAgent, array('SLCC1', 'Media Center PC', '.NET CLR', 'OfficeLiveConnector'))) {
return WURFL_Constants::GENERIC_WEB_BROWSER;
}
return WURFL_Constants::NO_MATCH;
}
示例6: applyRecoveryMatch
public function applyRecoveryMatch($userAgent)
{
if (WURFL_Handlers_Utils::checkIfContainsAnyOf($userAgent, array('Macintosh', 'Windows'))) {
return WURFL_Constants::GENERIC_WEB_BROWSER;
}
return WURFL_Constants::NO_MATCH;
}
示例7: canHandle
public function canHandle($userAgent)
{
if (WURFL_Handlers_Utils::isDesktopBrowser($userAgent)) {
return false;
}
return WURFL_Handlers_Utils::checkIfContainsAnyOf($userAgent, array("LGUPLUS", "lgtelecom"));
}
示例8: 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'));
}
示例9: canHandle
public function canHandle($userAgent)
{
if (WURFL_Handlers_Utils::isDesktopBrowser($userAgent)) {
return false;
}
return WURFL_Handlers_Utils::checkIfContains($userAgent, 'Nokia') && !WURFL_Handlers_Utils::checkIfContainsAnyOf($userAgent, array('Android', 'iPhone'));
}
示例10: canHandle
public function canHandle($userAgent)
{
if (WURFL_Handlers_Utils::isDesktopBrowser($userAgent)) {
return false;
}
return WURFL_Handlers_Utils::checkIfContainsAnyOf($userAgent, array('Samsung', 'SAMSUNG')) || WURFL_Handlers_Utils::checkIfStartsWithAnyOf($userAgent, array('SEC-', 'SPH', 'SGH', 'SCH'));
}
示例11: canHandle
public function canHandle($userAgent)
{
if (WURFL_Handlers_Utils::isMobileBrowser($userAgent)) {
return false;
}
return WURFL_Handlers_Utils::checkIfContainsAnyOf($userAgent, array('Thunderbird', 'Microsoft Outlook', 'MSOffice'));
}
示例12: canHandle
public function canHandle($userAgent)
{
if (WURFL_Handlers_Utils::isDesktopBrowser($userAgent)) {
return false;
}
return WURFL_Handlers_Utils::checkIfContainsAnyOf($userAgent, array('Windows Phone', 'WindowsPhone', 'NativeHost'));
}
示例13: 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;
}
示例14: applyRecoveryMatch
public function applyRecoveryMatch($userAgent)
{
if (WURFL_Handlers_Utils::checkIfContainsAnyOf($userAgent, array('MIB/2.2', 'MIB/BER2.2'))) {
return "mot_mib22_generic";
}
return null;
}
示例15: canHandle
public function canHandle($userAgent)
{
if (WURFL_Handlers_Utils::isMobileBrowser($userAgent)) {
return false;
}
return WURFL_Handlers_Utils::checkIfContainsAnyOf($userAgent, array('Opera', 'OPR/'));
}