forked from serbanghita/Mobile-Detect
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
serbanghita#385 - Somewhat confusing instruction
serbanghita#384 - Onda Tablet not detected as a tablet. Added all Onda tablets I could get my hands on. serbanghita#378 - Invalidated Xperia SP detected as a tablet serbanghita#377 - Yii2 extension serbanghita#375 - The local cache is not cleared when using the setUserAgent in 2.8.12
- Loading branch information
1 parent
09e31ff
commit e7d623b
Showing
9 changed files
with
107 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
require_once '../Mobile_Detect.php'; | ||
/* | ||
$detect = new Mobile_Detect; | ||
$detect->setUserAgent('Mozilla/5.0 (iPhone; CPU iPhone OS 8_0_2 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) CriOS/38.0.2125.59 Mobile/12A405 Safari/600.1.4'); | ||
var_dump($detect->version('Chrome')); | ||
var_dump($detect->version('iPhone')); | ||
*/ | ||
|
||
$user_agents = array( | ||
'android' => 'Mozilla/5.0 (Linux; Android 4.2; Nexus 7 Build/JOP40C) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.166 Safari/535.19', | ||
'iphone6' => 'Mozilla/5.0 (iPhone; CPU iPhone OS 6_0_1 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10A523 Safari/8536.25', | ||
'blackberry' => 'Mozilla/5.0 (BB10; Touch) AppleWebKit/537.10+ (KHTML, like Gecko) Version/10.0.9.2372 Mobile Safari/537.10+' | ||
); | ||
$mobile_detect = new Mobile_Detect; | ||
|
||
foreach($user_agents as $user_agent) | ||
{ | ||
$mobile_detect->setUserAgent($user_agent); | ||
var_dump($mobile_detect->isAndroidOS()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?php | ||
return array( | ||
'Onda' => array( | ||
'Mozilla/5.0 (Linux; Android 4.2.2; V975i Build/JDQ39) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.108 Safari/537.36' => array('isMobile' => true, 'isTablet' => true), | ||
'Mozilla/5.0 (Android; Tablet; rv:37.0) Gecko/37.0 Firefox/37.0' => array('isMobile' => true, 'isTablet' => true), | ||
'Mozilla/5.0 (Linux; Android 4.4.2; V975m Core4 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.141 Safari/537.36' => array('isMobile' => true, 'isTablet' => true), | ||
'Mozilla/5.0 (Linux; U; Android 4.3; fr-fr; V975m Core4 Build/JSS15J) AppleWebKit/537.16 (KHTML, like Gecko) Version/4.0 Safari/537.16' => array('isMobile' => true, 'isTablet' => true), | ||
'Mozilla/5.0 (Linux; Android 4.3; V975m Core4 Build/JSS15J) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.96 Safari/537.36' => array('isMobile' => true, 'isTablet' => true), | ||
'Mozilla/5.0 (Linux; Android 4.4.2; V812 Core4 Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.93 Safari/537.36' => array('isMobile' => true, 'isTablet' => true), | ||
) | ||
|
||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.