Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Aubry <matt@piwik.org>2014-11-26 05:46:47 +0300
committerMatthieu Aubry <matt@piwik.org>2014-11-26 05:46:47 +0300
commit61a703202cea4055368e6def0b8531734d4cdb6e (patch)
tree98c3761ad174437522dba26126195bb50e21c47c /plugins
parentb161911784f9ff91c4dc9be13437b83c10e76bc8 (diff)
parent9d9a7c8056a7d0735a3e12ca2e06d5471d34d978 (diff)
Merge pull request #6565 from piwik/deprecate_usersettings
Remove duplicate reports from UserSettings plugin refs #3962
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Contents/tests/System/expected/test_Contents__Live.getLastVisitsDetails_day.xml32
-rw-r--r--plugins/Contents/tests/System/expected/test_Contents__Live.getLastVisitsDetails_month.xml32
-rw-r--r--plugins/Contents/tests/System/expected/test_Contents_contentInteractionMatch__Live.getLastVisitsDetails_day.xml32
-rw-r--r--plugins/Contents/tests/System/expected/test_Contents_contentTargetMatch__Live.getLastVisitsDetails_day.xml32
-rw-r--r--plugins/Contents/tests/System/expected/test_ContentscontentNameOrPieceMatch__Live.getLastVisitsDetails_day.xml32
-rw-r--r--plugins/CustomVariables/tests/System/expected/test_CustomVariablesSystemTest__Live.getLastVisitsDetails_day.xml16
-rw-r--r--plugins/Dashboard/Dashboard.php2
-rw-r--r--plugins/Dashboard/Model.php98
-rw-r--r--plugins/DevicesDetection/API.php59
-rw-r--r--plugins/DevicesDetection/Archiver.php2
-rw-r--r--plugins/DevicesDetection/Columns/BrowserName.php13
-rw-r--r--plugins/DevicesDetection/Columns/BrowserVersion.php13
-rw-r--r--plugins/DevicesDetection/Columns/Os.php13
-rw-r--r--plugins/DevicesDetection/Controller.php24
-rw-r--r--plugins/DevicesDetection/DevicesDetection.php13
-rw-r--r--plugins/DevicesDetection/Reports/GetBrowserVersions.php10
-rw-r--r--plugins/DevicesDetection/Reports/GetBrowsers.php (renamed from plugins/DevicesDetection/Reports/GetBrowserFamilies.php)12
-rw-r--r--plugins/DevicesDetection/Reports/GetOsFamilies.php2
-rw-r--r--plugins/DevicesDetection/Visitor.php40
-rw-r--r--plugins/DevicesDetection/functions.php71
-rw-r--r--plugins/DevicesDetection/templates/index.twig4
-rw-r--r--plugins/Live/templates/getSingleVisitSummary.twig2
-rw-r--r--plugins/UserSettings/API.php99
-rw-r--r--plugins/UserSettings/Archiver.php28
-rw-r--r--plugins/UserSettings/Columns/Browser.php33
-rw-r--r--plugins/UserSettings/Columns/BrowserVersion.php32
-rw-r--r--plugins/UserSettings/Columns/MobilevsDesktop.php20
-rw-r--r--plugins/UserSettings/Columns/Operatingsystem.php33
-rw-r--r--plugins/UserSettings/Columns/OperatingsystemFamily.php20
-rw-r--r--plugins/UserSettings/Controller.php8
-rw-r--r--plugins/UserSettings/Reports/GetBrowser.php46
-rw-r--r--plugins/UserSettings/Reports/GetBrowserVersion.php47
-rw-r--r--plugins/UserSettings/Reports/GetMobileVsDesktop.php43
-rw-r--r--plugins/UserSettings/Reports/GetOS.php41
-rw-r--r--plugins/UserSettings/Reports/GetOSFamily.php42
-rw-r--r--plugins/UserSettings/Reports/GetScreenType.php (renamed from plugins/UserSettings/Reports/GetWideScreen.php)9
-rw-r--r--plugins/UserSettings/UserSettings.php36
-rw-r--r--plugins/UserSettings/Visitor.php40
-rw-r--r--plugins/UserSettings/functions.php161
-rw-r--r--plugins/UserSettings/images/os/IOS.gifbin591 -> 594 bytes
-rw-r--r--plugins/UserSettings/lang/en.json1
-rw-r--r--plugins/UserSettings/templates/index.twig20
-rw-r--r--plugins/UserSettings/tests/Unit/UserSettingsTest.php1036
43 files changed, 470 insertions, 1879 deletions
diff --git a/plugins/Contents/tests/System/expected/test_Contents__Live.getLastVisitsDetails_day.xml b/plugins/Contents/tests/System/expected/test_Contents__Live.getLastVisitsDetails_day.xml
index 857c554b17..0a76c67ee3 100644
--- a/plugins/Contents/tests/System/expected/test_Contents__Live.getLastVisitsDetails_day.xml
+++ b/plugins/Contents/tests/System/expected/test_Contents__Live.getLastVisitsDetails_day.xml
@@ -44,8 +44,16 @@
<customVariables>
</customVariables>
<deviceType>Desktop</deviceType>
+ <operatingSystem>Windows XP</operatingSystem>
+ <operatingSystemCode>WXP</operatingSystemCode>
+ <operatingSystemIcon>plugins/UserSettings/images/os/WXP.gif</operatingSystemIcon>
<browserFamily>Gecko</browserFamily>
<browserFamilyDescription>Gecko (Firefox)</browserFamilyDescription>
+ <browser>Firefox 3.6</browser>
+ <browserName>Firefox</browserName>
+ <browserIcon>plugins/UserSettings/images/browsers/FF.gif</browserIcon>
+ <browserCode>FF</browserCode>
+ <browserVersion>3.6</browserVersion>
<events>0</events>
<provider>Unknown</provider>
<providerName>Unknown</providerName>
@@ -69,14 +77,6 @@
<location>France</location>
<latitude />
<longitude />
- <operatingSystem>Windows XP</operatingSystem>
- <operatingSystemCode>WXP</operatingSystemCode>
- <operatingSystemShortName>Win XP</operatingSystemShortName>
- <operatingSystemIcon>plugins/UserSettings/images/os/WXP.gif</operatingSystemIcon>
- <browserName>Firefox 3.6</browserName>
- <browserIcon>plugins/UserSettings/images/browsers/FF.gif</browserIcon>
- <browserCode>FF</browserCode>
- <browserVersion>3.6</browserVersion>
<screenType>normal</screenType>
<resolution>1024x768</resolution>
<screenTypeIcon>plugins/UserSettings/images/screens/normal.gif</screenTypeIcon>
@@ -144,8 +144,16 @@
<customVariables>
</customVariables>
<deviceType>Desktop</deviceType>
+ <operatingSystem>Windows XP</operatingSystem>
+ <operatingSystemCode>WXP</operatingSystemCode>
+ <operatingSystemIcon>plugins/UserSettings/images/os/WXP.gif</operatingSystemIcon>
<browserFamily>Gecko</browserFamily>
<browserFamilyDescription>Gecko (Firefox)</browserFamilyDescription>
+ <browser>Firefox 3.6</browser>
+ <browserName>Firefox</browserName>
+ <browserIcon>plugins/UserSettings/images/browsers/FF.gif</browserIcon>
+ <browserCode>FF</browserCode>
+ <browserVersion>3.6</browserVersion>
<events>0</events>
<provider>Unknown</provider>
<providerName>Unknown</providerName>
@@ -169,14 +177,6 @@
<location>France</location>
<latitude />
<longitude />
- <operatingSystem>Windows XP</operatingSystem>
- <operatingSystemCode>WXP</operatingSystemCode>
- <operatingSystemShortName>Win XP</operatingSystemShortName>
- <operatingSystemIcon>plugins/UserSettings/images/os/WXP.gif</operatingSystemIcon>
- <browserName>Firefox 3.6</browserName>
- <browserIcon>plugins/UserSettings/images/browsers/FF.gif</browserIcon>
- <browserCode>FF</browserCode>
- <browserVersion>3.6</browserVersion>
<screenType>normal</screenType>
<resolution>1024x768</resolution>
<screenTypeIcon>plugins/UserSettings/images/screens/normal.gif</screenTypeIcon>
diff --git a/plugins/Contents/tests/System/expected/test_Contents__Live.getLastVisitsDetails_month.xml b/plugins/Contents/tests/System/expected/test_Contents__Live.getLastVisitsDetails_month.xml
index 857c554b17..0a76c67ee3 100644
--- a/plugins/Contents/tests/System/expected/test_Contents__Live.getLastVisitsDetails_month.xml
+++ b/plugins/Contents/tests/System/expected/test_Contents__Live.getLastVisitsDetails_month.xml
@@ -44,8 +44,16 @@
<customVariables>
</customVariables>
<deviceType>Desktop</deviceType>
+ <operatingSystem>Windows XP</operatingSystem>
+ <operatingSystemCode>WXP</operatingSystemCode>
+ <operatingSystemIcon>plugins/UserSettings/images/os/WXP.gif</operatingSystemIcon>
<browserFamily>Gecko</browserFamily>
<browserFamilyDescription>Gecko (Firefox)</browserFamilyDescription>
+ <browser>Firefox 3.6</browser>
+ <browserName>Firefox</browserName>
+ <browserIcon>plugins/UserSettings/images/browsers/FF.gif</browserIcon>
+ <browserCode>FF</browserCode>
+ <browserVersion>3.6</browserVersion>
<events>0</events>
<provider>Unknown</provider>
<providerName>Unknown</providerName>
@@ -69,14 +77,6 @@
<location>France</location>
<latitude />
<longitude />
- <operatingSystem>Windows XP</operatingSystem>
- <operatingSystemCode>WXP</operatingSystemCode>
- <operatingSystemShortName>Win XP</operatingSystemShortName>
- <operatingSystemIcon>plugins/UserSettings/images/os/WXP.gif</operatingSystemIcon>
- <browserName>Firefox 3.6</browserName>
- <browserIcon>plugins/UserSettings/images/browsers/FF.gif</browserIcon>
- <browserCode>FF</browserCode>
- <browserVersion>3.6</browserVersion>
<screenType>normal</screenType>
<resolution>1024x768</resolution>
<screenTypeIcon>plugins/UserSettings/images/screens/normal.gif</screenTypeIcon>
@@ -144,8 +144,16 @@
<customVariables>
</customVariables>
<deviceType>Desktop</deviceType>
+ <operatingSystem>Windows XP</operatingSystem>
+ <operatingSystemCode>WXP</operatingSystemCode>
+ <operatingSystemIcon>plugins/UserSettings/images/os/WXP.gif</operatingSystemIcon>
<browserFamily>Gecko</browserFamily>
<browserFamilyDescription>Gecko (Firefox)</browserFamilyDescription>
+ <browser>Firefox 3.6</browser>
+ <browserName>Firefox</browserName>
+ <browserIcon>plugins/UserSettings/images/browsers/FF.gif</browserIcon>
+ <browserCode>FF</browserCode>
+ <browserVersion>3.6</browserVersion>
<events>0</events>
<provider>Unknown</provider>
<providerName>Unknown</providerName>
@@ -169,14 +177,6 @@
<location>France</location>
<latitude />
<longitude />
- <operatingSystem>Windows XP</operatingSystem>
- <operatingSystemCode>WXP</operatingSystemCode>
- <operatingSystemShortName>Win XP</operatingSystemShortName>
- <operatingSystemIcon>plugins/UserSettings/images/os/WXP.gif</operatingSystemIcon>
- <browserName>Firefox 3.6</browserName>
- <browserIcon>plugins/UserSettings/images/browsers/FF.gif</browserIcon>
- <browserCode>FF</browserCode>
- <browserVersion>3.6</browserVersion>
<screenType>normal</screenType>
<resolution>1024x768</resolution>
<screenTypeIcon>plugins/UserSettings/images/screens/normal.gif</screenTypeIcon>
diff --git a/plugins/Contents/tests/System/expected/test_Contents_contentInteractionMatch__Live.getLastVisitsDetails_day.xml b/plugins/Contents/tests/System/expected/test_Contents_contentInteractionMatch__Live.getLastVisitsDetails_day.xml
index 857c554b17..0a76c67ee3 100644
--- a/plugins/Contents/tests/System/expected/test_Contents_contentInteractionMatch__Live.getLastVisitsDetails_day.xml
+++ b/plugins/Contents/tests/System/expected/test_Contents_contentInteractionMatch__Live.getLastVisitsDetails_day.xml
@@ -44,8 +44,16 @@
<customVariables>
</customVariables>
<deviceType>Desktop</deviceType>
+ <operatingSystem>Windows XP</operatingSystem>
+ <operatingSystemCode>WXP</operatingSystemCode>
+ <operatingSystemIcon>plugins/UserSettings/images/os/WXP.gif</operatingSystemIcon>
<browserFamily>Gecko</browserFamily>
<browserFamilyDescription>Gecko (Firefox)</browserFamilyDescription>
+ <browser>Firefox 3.6</browser>
+ <browserName>Firefox</browserName>
+ <browserIcon>plugins/UserSettings/images/browsers/FF.gif</browserIcon>
+ <browserCode>FF</browserCode>
+ <browserVersion>3.6</browserVersion>
<events>0</events>
<provider>Unknown</provider>
<providerName>Unknown</providerName>
@@ -69,14 +77,6 @@
<location>France</location>
<latitude />
<longitude />
- <operatingSystem>Windows XP</operatingSystem>
- <operatingSystemCode>WXP</operatingSystemCode>
- <operatingSystemShortName>Win XP</operatingSystemShortName>
- <operatingSystemIcon>plugins/UserSettings/images/os/WXP.gif</operatingSystemIcon>
- <browserName>Firefox 3.6</browserName>
- <browserIcon>plugins/UserSettings/images/browsers/FF.gif</browserIcon>
- <browserCode>FF</browserCode>
- <browserVersion>3.6</browserVersion>
<screenType>normal</screenType>
<resolution>1024x768</resolution>
<screenTypeIcon>plugins/UserSettings/images/screens/normal.gif</screenTypeIcon>
@@ -144,8 +144,16 @@
<customVariables>
</customVariables>
<deviceType>Desktop</deviceType>
+ <operatingSystem>Windows XP</operatingSystem>
+ <operatingSystemCode>WXP</operatingSystemCode>
+ <operatingSystemIcon>plugins/UserSettings/images/os/WXP.gif</operatingSystemIcon>
<browserFamily>Gecko</browserFamily>
<browserFamilyDescription>Gecko (Firefox)</browserFamilyDescription>
+ <browser>Firefox 3.6</browser>
+ <browserName>Firefox</browserName>
+ <browserIcon>plugins/UserSettings/images/browsers/FF.gif</browserIcon>
+ <browserCode>FF</browserCode>
+ <browserVersion>3.6</browserVersion>
<events>0</events>
<provider>Unknown</provider>
<providerName>Unknown</providerName>
@@ -169,14 +177,6 @@
<location>France</location>
<latitude />
<longitude />
- <operatingSystem>Windows XP</operatingSystem>
- <operatingSystemCode>WXP</operatingSystemCode>
- <operatingSystemShortName>Win XP</operatingSystemShortName>
- <operatingSystemIcon>plugins/UserSettings/images/os/WXP.gif</operatingSystemIcon>
- <browserName>Firefox 3.6</browserName>
- <browserIcon>plugins/UserSettings/images/browsers/FF.gif</browserIcon>
- <browserCode>FF</browserCode>
- <browserVersion>3.6</browserVersion>
<screenType>normal</screenType>
<resolution>1024x768</resolution>
<screenTypeIcon>plugins/UserSettings/images/screens/normal.gif</screenTypeIcon>
diff --git a/plugins/Contents/tests/System/expected/test_Contents_contentTargetMatch__Live.getLastVisitsDetails_day.xml b/plugins/Contents/tests/System/expected/test_Contents_contentTargetMatch__Live.getLastVisitsDetails_day.xml
index 857c554b17..0a76c67ee3 100644
--- a/plugins/Contents/tests/System/expected/test_Contents_contentTargetMatch__Live.getLastVisitsDetails_day.xml
+++ b/plugins/Contents/tests/System/expected/test_Contents_contentTargetMatch__Live.getLastVisitsDetails_day.xml
@@ -44,8 +44,16 @@
<customVariables>
</customVariables>
<deviceType>Desktop</deviceType>
+ <operatingSystem>Windows XP</operatingSystem>
+ <operatingSystemCode>WXP</operatingSystemCode>
+ <operatingSystemIcon>plugins/UserSettings/images/os/WXP.gif</operatingSystemIcon>
<browserFamily>Gecko</browserFamily>
<browserFamilyDescription>Gecko (Firefox)</browserFamilyDescription>
+ <browser>Firefox 3.6</browser>
+ <browserName>Firefox</browserName>
+ <browserIcon>plugins/UserSettings/images/browsers/FF.gif</browserIcon>
+ <browserCode>FF</browserCode>
+ <browserVersion>3.6</browserVersion>
<events>0</events>
<provider>Unknown</provider>
<providerName>Unknown</providerName>
@@ -69,14 +77,6 @@
<location>France</location>
<latitude />
<longitude />
- <operatingSystem>Windows XP</operatingSystem>
- <operatingSystemCode>WXP</operatingSystemCode>
- <operatingSystemShortName>Win XP</operatingSystemShortName>
- <operatingSystemIcon>plugins/UserSettings/images/os/WXP.gif</operatingSystemIcon>
- <browserName>Firefox 3.6</browserName>
- <browserIcon>plugins/UserSettings/images/browsers/FF.gif</browserIcon>
- <browserCode>FF</browserCode>
- <browserVersion>3.6</browserVersion>
<screenType>normal</screenType>
<resolution>1024x768</resolution>
<screenTypeIcon>plugins/UserSettings/images/screens/normal.gif</screenTypeIcon>
@@ -144,8 +144,16 @@
<customVariables>
</customVariables>
<deviceType>Desktop</deviceType>
+ <operatingSystem>Windows XP</operatingSystem>
+ <operatingSystemCode>WXP</operatingSystemCode>
+ <operatingSystemIcon>plugins/UserSettings/images/os/WXP.gif</operatingSystemIcon>
<browserFamily>Gecko</browserFamily>
<browserFamilyDescription>Gecko (Firefox)</browserFamilyDescription>
+ <browser>Firefox 3.6</browser>
+ <browserName>Firefox</browserName>
+ <browserIcon>plugins/UserSettings/images/browsers/FF.gif</browserIcon>
+ <browserCode>FF</browserCode>
+ <browserVersion>3.6</browserVersion>
<events>0</events>
<provider>Unknown</provider>
<providerName>Unknown</providerName>
@@ -169,14 +177,6 @@
<location>France</location>
<latitude />
<longitude />
- <operatingSystem>Windows XP</operatingSystem>
- <operatingSystemCode>WXP</operatingSystemCode>
- <operatingSystemShortName>Win XP</operatingSystemShortName>
- <operatingSystemIcon>plugins/UserSettings/images/os/WXP.gif</operatingSystemIcon>
- <browserName>Firefox 3.6</browserName>
- <browserIcon>plugins/UserSettings/images/browsers/FF.gif</browserIcon>
- <browserCode>FF</browserCode>
- <browserVersion>3.6</browserVersion>
<screenType>normal</screenType>
<resolution>1024x768</resolution>
<screenTypeIcon>plugins/UserSettings/images/screens/normal.gif</screenTypeIcon>
diff --git a/plugins/Contents/tests/System/expected/test_ContentscontentNameOrPieceMatch__Live.getLastVisitsDetails_day.xml b/plugins/Contents/tests/System/expected/test_ContentscontentNameOrPieceMatch__Live.getLastVisitsDetails_day.xml
index 857c554b17..0a76c67ee3 100644
--- a/plugins/Contents/tests/System/expected/test_ContentscontentNameOrPieceMatch__Live.getLastVisitsDetails_day.xml
+++ b/plugins/Contents/tests/System/expected/test_ContentscontentNameOrPieceMatch__Live.getLastVisitsDetails_day.xml
@@ -44,8 +44,16 @@
<customVariables>
</customVariables>
<deviceType>Desktop</deviceType>
+ <operatingSystem>Windows XP</operatingSystem>
+ <operatingSystemCode>WXP</operatingSystemCode>
+ <operatingSystemIcon>plugins/UserSettings/images/os/WXP.gif</operatingSystemIcon>
<browserFamily>Gecko</browserFamily>
<browserFamilyDescription>Gecko (Firefox)</browserFamilyDescription>
+ <browser>Firefox 3.6</browser>
+ <browserName>Firefox</browserName>
+ <browserIcon>plugins/UserSettings/images/browsers/FF.gif</browserIcon>
+ <browserCode>FF</browserCode>
+ <browserVersion>3.6</browserVersion>
<events>0</events>
<provider>Unknown</provider>
<providerName>Unknown</providerName>
@@ -69,14 +77,6 @@
<location>France</location>
<latitude />
<longitude />
- <operatingSystem>Windows XP</operatingSystem>
- <operatingSystemCode>WXP</operatingSystemCode>
- <operatingSystemShortName>Win XP</operatingSystemShortName>
- <operatingSystemIcon>plugins/UserSettings/images/os/WXP.gif</operatingSystemIcon>
- <browserName>Firefox 3.6</browserName>
- <browserIcon>plugins/UserSettings/images/browsers/FF.gif</browserIcon>
- <browserCode>FF</browserCode>
- <browserVersion>3.6</browserVersion>
<screenType>normal</screenType>
<resolution>1024x768</resolution>
<screenTypeIcon>plugins/UserSettings/images/screens/normal.gif</screenTypeIcon>
@@ -144,8 +144,16 @@
<customVariables>
</customVariables>
<deviceType>Desktop</deviceType>
+ <operatingSystem>Windows XP</operatingSystem>
+ <operatingSystemCode>WXP</operatingSystemCode>
+ <operatingSystemIcon>plugins/UserSettings/images/os/WXP.gif</operatingSystemIcon>
<browserFamily>Gecko</browserFamily>
<browserFamilyDescription>Gecko (Firefox)</browserFamilyDescription>
+ <browser>Firefox 3.6</browser>
+ <browserName>Firefox</browserName>
+ <browserIcon>plugins/UserSettings/images/browsers/FF.gif</browserIcon>
+ <browserCode>FF</browserCode>
+ <browserVersion>3.6</browserVersion>
<events>0</events>
<provider>Unknown</provider>
<providerName>Unknown</providerName>
@@ -169,14 +177,6 @@
<location>France</location>
<latitude />
<longitude />
- <operatingSystem>Windows XP</operatingSystem>
- <operatingSystemCode>WXP</operatingSystemCode>
- <operatingSystemShortName>Win XP</operatingSystemShortName>
- <operatingSystemIcon>plugins/UserSettings/images/os/WXP.gif</operatingSystemIcon>
- <browserName>Firefox 3.6</browserName>
- <browserIcon>plugins/UserSettings/images/browsers/FF.gif</browserIcon>
- <browserCode>FF</browserCode>
- <browserVersion>3.6</browserVersion>
<screenType>normal</screenType>
<resolution>1024x768</resolution>
<screenTypeIcon>plugins/UserSettings/images/screens/normal.gif</screenTypeIcon>
diff --git a/plugins/CustomVariables/tests/System/expected/test_CustomVariablesSystemTest__Live.getLastVisitsDetails_day.xml b/plugins/CustomVariables/tests/System/expected/test_CustomVariablesSystemTest__Live.getLastVisitsDetails_day.xml
index 91f9066c9b..1fbae717c6 100644
--- a/plugins/CustomVariables/tests/System/expected/test_CustomVariablesSystemTest__Live.getLastVisitsDetails_day.xml
+++ b/plugins/CustomVariables/tests/System/expected/test_CustomVariablesSystemTest__Live.getLastVisitsDetails_day.xml
@@ -117,8 +117,16 @@
</row>
</customVariables>
<deviceType>Desktop</deviceType>
+ <operatingSystem>Windows XP</operatingSystem>
+ <operatingSystemCode>WXP</operatingSystemCode>
+ <operatingSystemIcon>plugins/UserSettings/images/os/WXP.gif</operatingSystemIcon>
<browserFamily>Gecko</browserFamily>
<browserFamilyDescription>Gecko (Firefox)</browserFamilyDescription>
+ <browser>Firefox 3.6</browser>
+ <browserName>Firefox</browserName>
+ <browserIcon>plugins/UserSettings/images/browsers/FF.gif</browserIcon>
+ <browserCode>FF</browserCode>
+ <browserVersion>3.6</browserVersion>
<events>0</events>
<provider>Unknown</provider>
<providerName>Unknown</providerName>
@@ -142,14 +150,6 @@
<location>France</location>
<latitude />
<longitude />
- <operatingSystem>Windows XP</operatingSystem>
- <operatingSystemCode>WXP</operatingSystemCode>
- <operatingSystemShortName>Win XP</operatingSystemShortName>
- <operatingSystemIcon>plugins/UserSettings/images/os/WXP.gif</operatingSystemIcon>
- <browserName>Firefox 3.6</browserName>
- <browserIcon>plugins/UserSettings/images/browsers/FF.gif</browserIcon>
- <browserCode>FF</browserCode>
- <browserVersion>3.6</browserVersion>
<screenType>normal</screenType>
<resolution>1024x768</resolution>
<screenTypeIcon>plugins/UserSettings/images/screens/normal.gif</screenTypeIcon>
diff --git a/plugins/Dashboard/Dashboard.php b/plugins/Dashboard/Dashboard.php
index a0a12985c3..bfb3fc9870 100644
--- a/plugins/Dashboard/Dashboard.php
+++ b/plugins/Dashboard/Dashboard.php
@@ -81,7 +81,7 @@ class Dashboard extends \Piwik\Plugin
],
[
{"uniqueId":"widgetUserCountryMapvisitorMap","parameters":{"module":"UserCountryMap","action":"visitorMap"}},
- {"uniqueId":"widgetUserSettingsgetBrowser","parameters":{"module":"UserSettings","action":"getBrowser"}},
+ {"uniqueId":"widgetDevicesDetecionGetBrowser","parameters":{"module":"DevicesDetection","action":"getBrowsers"}},
{"uniqueId":"widgetReferrersgetSearchEngines","parameters":{"module":"Referrers","action":"getSearchEngines"}},
{"uniqueId":"widgetVisitTimegetVisitInformationPerServerTime","parameters":{"module":"VisitTime","action":"getVisitInformationPerServerTime"}},
{"uniqueId":"widgetExampleRssWidgetrssPiwik","parameters":{"module":"ExampleRssWidget","action":"rssPiwik"}}
diff --git a/plugins/Dashboard/Model.php b/plugins/Dashboard/Model.php
index 39dcb06557..790076c1a9 100644
--- a/plugins/Dashboard/Model.php
+++ b/plugins/Dashboard/Model.php
@@ -10,6 +10,7 @@ namespace Piwik\Plugins\Dashboard;
use Piwik\Common;
use Piwik\Db;
use Piwik\DbHelper;
+use Piwik\WidgetsList;
class Model
{
@@ -144,4 +145,101 @@ class Model
{
Db::dropTables(Common::prefixTable(self::$rawPrefix));
}
+
+ /**
+ * Replaces widgets on the given dashboard layout with other ones
+ *
+ * It uses the given widget definitions to find the old and to create the new widgets
+ * Each widget is defined with an array containing the following information
+ * array (
+ * 'module' => string
+ * 'action' => string
+ * 'params' => array()
+ * )
+ *
+ * if $newWidget does not contain a widget definition at the current position,
+ * the old widget will simply be removed
+ *
+ * @param array $oldWidgets array containing widget definitions
+ * @param array $newWidgets array containing widget definitions
+ */
+ public static function replaceDashboardWidgets($dashboardLayout, $oldWidgets, $newWidgets)
+ {
+ if (empty($dashboardLayout) || !isset($dashboardLayout->columns)) {
+ return $dashboardLayout;
+ }
+
+ $newColumns = array();
+
+ foreach ($dashboardLayout->columns as $id => $column) {
+
+ $newColumn = array();
+
+ foreach ($column as $widget) {
+
+ foreach ($oldWidgets AS $pos => $oldWidgetData) {
+
+ $oldWidgetId = WidgetsList::getWidgetUniqueId($oldWidgetData['module'], $oldWidgetData['action'], $oldWidgetData['params']);
+
+ if (empty($newWidgets[$pos])) {
+ continue 2;
+ }
+
+ $newWidget = $newWidgets[$pos];
+
+ if ($widget->uniqueId == $oldWidgetId) {
+
+ $newWidgetId = WidgetsList::getWidgetUniqueId($newWidget['module'], $newWidget['action'], $newWidget['params']);
+
+ // is new widget already is on dashboard just remove the old one
+ if (self::layoutContainsWidget($dashboardLayout, $newWidgetId)) {
+ continue 2;
+ }
+
+ $widget->uniqueId = $newWidgetId;
+ $widget->parameters->module = $newWidget['module'];
+ $widget->parameters->action = $newWidget['action'];
+ foreach ($newWidget['params'] as $key => $value) {
+ $widget->parameters->{$key} = $value;
+ }
+ }
+ }
+
+
+ $newColumn[] = $widget;
+ }
+
+ $newColumns[] = $newColumn;
+ }
+
+ $dashboardLayout->columns = $newColumns;
+
+ return $dashboardLayout;
+ }
+
+ /**
+ * Checks if a given dashboard layout contains a given widget
+ *
+ * @param $dashboardLayout
+ * @param $widgetId
+ * @return bool
+ */
+ protected static function layoutContainsWidget($dashboardLayout, $widgetId)
+ {
+ if (!isset($dashboardLayout->columns)) {
+ return false;
+ }
+
+ foreach ($dashboardLayout->columns as $id => $column) {
+
+ foreach ($column as $widget) {
+
+ if ($widget->uniqueId == $widgetId) {
+ return true;
+ }
+ }
+ }
+
+ return false;
+ }
}
diff --git a/plugins/DevicesDetection/API.php b/plugins/DevicesDetection/API.php
index b54b79c635..b6c58388b9 100644
--- a/plugins/DevicesDetection/API.php
+++ b/plugins/DevicesDetection/API.php
@@ -9,6 +9,7 @@
namespace Piwik\Plugins\DevicesDetection;
+use DeviceDetector\Parser\Device\DeviceParserAbstract;
use Piwik\Archive;
use Piwik\DataTable;
use Piwik\Metrics;
@@ -50,11 +51,36 @@ class API extends \Piwik\Plugin\API
public function getType($idSite, $period, $date, $segment = false)
{
$dataTable = $this->getDataTable('DevicesDetection_types', $idSite, $period, $date, $segment);
+ // ensure all device types are in the list
+ $this->ensureDefaultRowsInTable($dataTable);
$dataTable->filter('ColumnCallbackAddMetadata', array('label', 'logo', __NAMESPACE__ . '\getDeviceTypeLogo'));
$dataTable->filter('ColumnCallbackReplace', array('label', __NAMESPACE__ . '\getDeviceTypeLabel'));
return $dataTable;
}
+ protected function ensureDefaultRowsInTable($dataTable)
+ {
+ $requiredRows = array_fill(0, count(DeviceParserAbstract::getAvailableDeviceTypes()), Metrics::INDEX_NB_VISITS);
+
+ $dataTables = array($dataTable);
+
+ if (!($dataTable instanceof DataTable\Map)) {
+ foreach ($dataTables as $table) {
+ if ($table->getRowsCount() == 0) {
+ continue;
+ }
+ foreach ($requiredRows as $requiredRow => $key) {
+ $row = $table->getRowFromLabel($requiredRow);
+ if (empty($row)) {
+ $table->addRowsFromSimpleArray(array(
+ array('label' => $requiredRow, $key => 0)
+ ));
+ }
+ }
+ }
+ }
+ }
+
/**
* Gets datatable displaying number of visits by device manufacturer name
* @param int $idSite
@@ -97,8 +123,8 @@ class API extends \Piwik\Plugin\API
public function getOsFamilies($idSite, $period, $date, $segment = false)
{
$dataTable = $this->getDataTable('DevicesDetection_os', $idSite, $period, $date, $segment);
- $dataTable->filter('GroupBy', array('label', __NAMESPACE__ . '\getOSFamilyFullNameExtended'));
- $dataTable->filter('ColumnCallbackAddMetadata', array('label', 'logo', __NAMESPACE__ . '\getOsFamilyLogoExtended'));
+ $dataTable->filter('GroupBy', array('label', __NAMESPACE__ . '\getOSFamilyFullName'));
+ $dataTable->filter('ColumnCallbackAddMetadata', array('label', 'logo', __NAMESPACE__ . '\getOsFamilyLogo'));
return $dataTable;
}
@@ -113,9 +139,9 @@ class API extends \Piwik\Plugin\API
public function getOsVersions($idSite, $period, $date, $segment = false)
{
$dataTable = $this->getDataTable('DevicesDetection_osVersions', $idSite, $period, $date, $segment);
- $dataTable->filter('ColumnCallbackAddMetadata', array('label', 'logo', __NAMESPACE__ . '\getOsLogoExtended'));
- $dataTable->filter('ColumnCallbackReplace', array('label', __NAMESPACE__ . '\getOsFullNameExtended'));
-
+ $dataTable->filter('ColumnCallbackAddMetadata', array('label', 'logo', __NAMESPACE__ . '\getOsLogo'));
+ // use GroupBy filter to avoid duplicate rows if old (UserSettings) and new (DevicesDetection) reports were combined
+ $dataTable->filter('GroupBy', array('label', __NAMESPACE__ . '\getOsFullName'));
return $dataTable;
}
@@ -126,12 +152,27 @@ class API extends \Piwik\Plugin\API
* @param string $date
* @param bool|string $segment
* @return DataTable
+ *
+ * @deprecated since 2.9.0 Use {@link getBrowsers} instead.
*/
public function getBrowserFamilies($idSite, $period, $date, $segment = false)
{
+ return $this->getBrowsers($idSite, $period, $date, $segment);
+ }
+
+ /**
+ * Gets datatable displaying number of visits by Browser (Without version)
+ * @param int $idSite
+ * @param string $period
+ * @param string $date
+ * @param bool|string $segment
+ * @return DataTable
+ */
+ public function getBrowsers($idSite, $period, $date, $segment = false)
+ {
$dataTable = $this->getDataTable('DevicesDetection_browsers', $idSite, $period, $date, $segment);
- $dataTable->filter('GroupBy', array('label', __NAMESPACE__ . '\getBrowserFamilyFullNameExtended'));
- $dataTable->filter('ColumnCallbackAddMetadata', array('label', 'logo', __NAMESPACE__ . '\getBrowserFamilyLogoExtended'));
+ $dataTable->filter('GroupBy', array('label', __NAMESPACE__ . '\getBrowserName'));
+ $dataTable->filter('ColumnCallbackAddMetadata', array('label', 'logo', __NAMESPACE__ . '\getBrowserFamilyLogo'));
return $dataTable;
}
@@ -146,8 +187,8 @@ class API extends \Piwik\Plugin\API
public function getBrowserVersions($idSite, $period, $date, $segment = false)
{
$dataTable = $this->getDataTable('DevicesDetection_browserVersions', $idSite, $period, $date, $segment);
- $dataTable->filter('ColumnCallbackAddMetadata', array('label', 'logo', __NAMESPACE__ . '\getBrowserLogoExtended'));
- $dataTable->filter('ColumnCallbackReplace', array('label', __NAMESPACE__ . '\getBrowserNameExtended'));
+ $dataTable->filter('ColumnCallbackAddMetadata', array('label', 'logo', __NAMESPACE__ . '\getBrowserLogo'));
+ $dataTable->filter('ColumnCallbackReplace', array('label', __NAMESPACE__ . '\getBrowserNameWithVersion'));
return $dataTable;
}
diff --git a/plugins/DevicesDetection/Archiver.php b/plugins/DevicesDetection/Archiver.php
index e91a1be0fe..0d6f40c062 100644
--- a/plugins/DevicesDetection/Archiver.php
+++ b/plugins/DevicesDetection/Archiver.php
@@ -26,7 +26,7 @@ class Archiver extends \Piwik\Plugin\Archiver
const DEVICE_BRAND_FIELD = "config_device_brand";
const DEVICE_MODEL_FIELD = "config_device_model";
const OS_FIELD = "config_os";
- const OS_VERSION_FIELD = "CONCAT(log_visit.config_os, ';', log_visit.config_os_version)";
+ const OS_VERSION_FIELD = "CONCAT(log_visit.config_os, ';', COALESCE(log_visit.config_os_version, ''))";
const BROWSER_FIELD = "config_browser_name";
const BROWSER_ENGINE_FIELD = "config_browser_engine";
const BROWSER_VERSION_DIMENSION = "CONCAT(log_visit.config_browser_name, ';', log_visit.config_browser_version)";
diff --git a/plugins/DevicesDetection/Columns/BrowserName.php b/plugins/DevicesDetection/Columns/BrowserName.php
index 1237d6676b..16b0897199 100644
--- a/plugins/DevicesDetection/Columns/BrowserName.php
+++ b/plugins/DevicesDetection/Columns/BrowserName.php
@@ -9,6 +9,7 @@
namespace Piwik\Plugins\DevicesDetection\Columns;
use Piwik\Piwik;
+use Piwik\Plugins\DevicesDetection\Segment;
use Piwik\Tracker\Request;
use Piwik\Tracker\Visitor;
use Piwik\Tracker\Action;
@@ -16,10 +17,20 @@ use Piwik\Tracker\Action;
class BrowserName extends Base
{
protected $columnName = 'config_browser_name';
+ protected $columnType = 'VARCHAR(10) NOT NULL';
+
+ protected function configureSegments()
+ {
+ $segment = new Segment();
+ $segment->setSegment('browserCode');
+ $segment->setName('UserSettings_ColumnBrowser');
+ $segment->setAcceptedValues('FF, IE, CH, SF, OP, etc.');
+ $this->addSegment($segment);
+ }
public function getName()
{
- return Piwik::translate('UserSettings_BrowserFamilies');
+ return Piwik::translate('UserSettings_ColumnBrowser');
}
/**
diff --git a/plugins/DevicesDetection/Columns/BrowserVersion.php b/plugins/DevicesDetection/Columns/BrowserVersion.php
index 1fa60f3ab2..87f7815c8a 100644
--- a/plugins/DevicesDetection/Columns/BrowserVersion.php
+++ b/plugins/DevicesDetection/Columns/BrowserVersion.php
@@ -9,6 +9,7 @@
namespace Piwik\Plugins\DevicesDetection\Columns;
use Piwik\Piwik;
+use Piwik\Plugins\DevicesDetection\Segment;
use Piwik\Tracker\Request;
use Piwik\Tracker\Visitor;
use Piwik\Tracker\Action;
@@ -16,10 +17,20 @@ use Piwik\Tracker\Action;
class BrowserVersion extends Base
{
protected $columnName = 'config_browser_version';
+ protected $columnType = 'VARCHAR(20) NOT NULL';
+
+ protected function configureSegments()
+ {
+ $segment = new Segment();
+ $segment->setSegment('browserVersion');
+ $segment->setName('UserSettings_ColumnBrowserVersion');
+ $segment->setAcceptedValues('1.0, 8.0, etc.');
+ $this->addSegment($segment);
+ }
public function getName()
{
- return Piwik::translate('DevicesDetection_BrowserVersions');
+ return Piwik::translate('UserSettings_ColumnBrowserVersion');
}
/**
diff --git a/plugins/DevicesDetection/Columns/Os.php b/plugins/DevicesDetection/Columns/Os.php
index 599edb3285..62d1a5cb71 100644
--- a/plugins/DevicesDetection/Columns/Os.php
+++ b/plugins/DevicesDetection/Columns/Os.php
@@ -9,6 +9,7 @@
namespace Piwik\Plugins\DevicesDetection\Columns;
use Piwik\Piwik;
+use Piwik\Plugins\DevicesDetection\Segment;
use Piwik\Tracker\Request;
use Piwik\Tracker\Settings;
use Piwik\Tracker\Visitor;
@@ -17,10 +18,20 @@ use Piwik\Tracker\Action;
class Os extends Base
{
protected $columnName = 'config_os';
+ protected $columnType = 'CHAR(3) NOT NULL';
+
+ protected function configureSegments()
+ {
+ $segment = new Segment();
+ $segment->setSegment('operatingSystemCode');
+ $segment->setName('UserSettings_ColumnOperatingSystem');
+ $segment->setAcceptedValues('WXP, WI7, MAC, LIN, AND, IPD, etc.');
+ $this->addSegment($segment);
+ }
public function getName()
{
- return Piwik::translate('DevicesDetection_OperatingSystemFamilies');
+ return Piwik::translate('UserSettings_OperatingSystemFamily');
}
/**
diff --git a/plugins/DevicesDetection/Controller.php b/plugins/DevicesDetection/Controller.php
index 78ed29fa93..cf072bb973 100644
--- a/plugins/DevicesDetection/Controller.php
+++ b/plugins/DevicesDetection/Controller.php
@@ -14,10 +14,10 @@ use Piwik\Db;
use Piwik\Piwik;
use Piwik\Plugin\ControllerAdmin;
use Piwik\Plugins\DevicesDetection\Reports\GetBrand;
-use Piwik\Plugins\DevicesDetection\Reports\GetBrowserFamilies;
use Piwik\Plugins\DevicesDetection\Reports\GetBrowserEngines;
+use Piwik\Plugins\DevicesDetection\Reports\GetBrowsers;
use Piwik\Plugins\DevicesDetection\Reports\GetModel;
-use Piwik\Plugins\DevicesDetection\Reports\GetOsFamilies;
+use Piwik\Plugins\DevicesDetection\Reports\GetOsVersions;
use Piwik\Plugins\DevicesDetection\Reports\GetType;
use Piwik\View;
@@ -30,8 +30,8 @@ class Controller extends \Piwik\Plugin\Controller
$view->deviceTypes = $this->renderReport(new GetType());
$view->deviceBrands = $this->renderReport(new GetBrand());
$view->deviceModels = $this->renderReport(new GetModel());
- $view->osReport = $this->renderReport(new GetOsFamilies());
- $view->browserReport = $this->renderReport(new GetBrowserFamilies());
+ $view->osReport = $this->renderReport(new GetOsVersions());
+ $view->browserReport = $this->renderReport(new GetBrowsers());
$view->browserEngineReport = $this->renderReport(new GetBrowserEngines());
return $view->render();
}
@@ -53,14 +53,14 @@ class Controller extends \Piwik\Plugin\Controller
$view->browser_name = $uaParser->getClient('name');
$view->browser_short_name = $uaParser->getClient('short_name');
$view->browser_version = $uaParser->getClient('version');
- $view->browser_logo = getBrowserLogoExtended($uaParser->getClient('short_name'));
+ $view->browser_logo = getBrowserLogo($uaParser->getClient('short_name'));
$view->browser_family = \DeviceDetector\Parser\Client\Browser::getBrowserFamily($uaParser->getClient('short_name'));
- $view->browser_family_logo = getBrowserFamilyLogoExtended($view->browser_family);
+ $view->browser_family_logo = getBrowserFamilyLogo($view->browser_family);
$view->os_name = $uaParser->getOs('name');
- $view->os_logo = getOsLogoExtended($uaParser->getOs('short_name'));
+ $view->os_logo = getOsLogo($uaParser->getOs('short_name'));
$view->os_short_name = $uaParser->getOs('short_name');
$view->os_family = \DeviceDetector\Parser\OperatingSystem::getOsFamily($uaParser->getOs('short_name'));
- $view->os_family_logo = getOsFamilyLogoExtended($view->os_family);
+ $view->os_family_logo = getOsFamilyLogo($view->os_family);
$view->os_version = $uaParser->getOs('version');
$view->device_type = getDeviceTypeLabel($uaParser->getDeviceName());
$view->device_type_logo = getDeviceTypeLogo($uaParser->getDeviceName());
@@ -96,7 +96,7 @@ class Controller extends \Piwik\Plugin\Controller
$availableBrowsers = \DeviceDetector\Parser\Client\Browser::getAvailableBrowsers();
foreach ($availableBrowsers as $short => $name) {
- $list[$name] = getBrowserLogoExtended($short);
+ $list[$name] = getBrowserLogo($short);
}
break;
@@ -104,7 +104,7 @@ class Controller extends \Piwik\Plugin\Controller
$availableBrowserFamilies = \DeviceDetector\Parser\Client\Browser::getAvailableBrowserFamilies();
foreach ($availableBrowserFamilies as $name => $browsers) {
- $list[$name] = getBrowserFamilyLogoExtended($name);
+ $list[$name] = getBrowserFamilyLogo($name);
}
break;
@@ -112,7 +112,7 @@ class Controller extends \Piwik\Plugin\Controller
$availableOSs = \DeviceDetector\Parser\OperatingSystem::getAvailableOperatingSystems();
foreach ($availableOSs as $short => $name) {
- $list[$name] = getOsLogoExtended($short);
+ $list[$name] = getOsLogo($short);
}
break;
@@ -120,7 +120,7 @@ class Controller extends \Piwik\Plugin\Controller
$osFamilies = \DeviceDetector\Parser\OperatingSystem::getAvailableOperatingSystemFamilies();
foreach ($osFamilies as $name => $oss) {
- $list[$name] = getOsFamilyLogoExtended($name);
+ $list[$name] = getOsFamilyLogo($name);
}
break;
diff --git a/plugins/DevicesDetection/DevicesDetection.php b/plugins/DevicesDetection/DevicesDetection.php
index 004fc96721..312bca614f 100644
--- a/plugins/DevicesDetection/DevicesDetection.php
+++ b/plugins/DevicesDetection/DevicesDetection.php
@@ -49,13 +49,16 @@ class DevicesDetection extends \Piwik\Plugin
$instance = new Visitor($details);
$visitor['deviceType'] = $instance->getDeviceType();
+ $visitor['operatingSystem'] = $instance->getOperatingSystem();
+ $visitor['operatingSystemCode'] = $instance->getOperatingSystemCode();
+ $visitor['operatingSystemIcon'] = $instance->getOperatingSystemIcon();
$visitor['browserFamily'] = $instance->getBrowserEngine();
$visitor['browserFamilyDescription'] = $instance->getBrowserEngineDescription();
-
- if (!PluginManager::getInstance()->isPluginActivated('UserSettings')) {
- $instance = new UserSettings();
- $instance->extendVisitorDetails($visitor, $details);
- }
+ $visitor['browser'] = $instance->getBrowser();
+ $visitor['browserName'] = $instance->getBrowserName();
+ $visitor['browserIcon'] = $instance->getBrowserIcon();
+ $visitor['browserCode'] = $instance->getBrowserCode();
+ $visitor['browserVersion'] = $instance->getBrowserVersion();
}
}
diff --git a/plugins/DevicesDetection/Reports/GetBrowserVersions.php b/plugins/DevicesDetection/Reports/GetBrowserVersions.php
index 22105ff8ac..24c64d052f 100644
--- a/plugins/DevicesDetection/Reports/GetBrowserVersions.php
+++ b/plugins/DevicesDetection/Reports/GetBrowserVersions.php
@@ -18,23 +18,23 @@ class GetBrowserVersions extends Base
{
parent::init();
$this->dimension = new BrowserVersion();
- $this->name = Piwik::translate('DevicesDetection_BrowserVersions');
+ $this->name = Piwik::translate('UserSettings_WidgetBrowserVersion');
$this->documentation = ''; // TODO
- $this->order = 6;
- $this->widgetTitle = 'DevicesDetection_BrowserVersions';
+ $this->order = 2;
+ $this->widgetTitle = 'UserSettings_WidgetBrowserVersion';
}
public function configureView(ViewDataTable $view)
{
$view->config->show_search = false;
$view->config->show_exclude_low_population = false;
- $view->config->addTranslation('label', Piwik::translate("UserSettings_ColumnBrowserVersion"));
+ $view->config->addTranslation('label', $this->dimension->getName());
}
public function getRelatedReports()
{
return array(
- new GetBrowserFamilies()
+ new GetBrowsers()
);
}
}
diff --git a/plugins/DevicesDetection/Reports/GetBrowserFamilies.php b/plugins/DevicesDetection/Reports/GetBrowsers.php
index 0c2c5cd621..07be06d4ba 100644
--- a/plugins/DevicesDetection/Reports/GetBrowserFamilies.php
+++ b/plugins/DevicesDetection/Reports/GetBrowsers.php
@@ -12,16 +12,16 @@ use Piwik\Piwik;
use Piwik\Plugin\ViewDataTable;
use Piwik\Plugins\DevicesDetection\Columns\BrowserName;
-class GetBrowserFamilies extends Base
+class GetBrowsers extends Base
{
protected function init()
{
parent::init();
$this->dimension = new BrowserName();
- $this->name = Piwik::translate('UserSettings_BrowserFamilies');
- $this->documentation = ''; // TODO
- $this->order = 5;
- $this->widgetTitle = 'UserSettings_BrowserFamilies';
+ $this->name = Piwik::translate('UserSettings_WidgetBrowsers');
+ $this->documentation = Piwik::translate('UserSettings_WidgetBrowsersDocumentation', '<br />');
+ $this->order = 1;
+ $this->widgetTitle = 'UserSettings_WidgetBrowsers';
}
public function configureView(ViewDataTable $view)
@@ -29,7 +29,7 @@ class GetBrowserFamilies extends Base
$view->config->title = $this->name;
$view->config->show_search = false;
$view->config->show_exclude_low_population = false;
- $view->config->addTranslation('label', Piwik::translate("DevicesDetection_dataTableLabelBrowserFamily"));
+ $view->config->addTranslation('label', $this->dimension->getName());
}
public function getRelatedReports()
diff --git a/plugins/DevicesDetection/Reports/GetOsFamilies.php b/plugins/DevicesDetection/Reports/GetOsFamilies.php
index 703b42830e..5f9418f75e 100644
--- a/plugins/DevicesDetection/Reports/GetOsFamilies.php
+++ b/plugins/DevicesDetection/Reports/GetOsFamilies.php
@@ -29,7 +29,7 @@ class GetOsFamilies extends Base
$view->config->title = $this->name;
$view->config->show_search = false;
$view->config->show_exclude_low_population = false;
- $view->config->addTranslation('label', Piwik::translate("UserSettings_OperatingSystemFamily"));
+ $view->config->addTranslation('label', $this->dimension->getName());
}
public function getRelatedReports()
diff --git a/plugins/DevicesDetection/Visitor.php b/plugins/DevicesDetection/Visitor.php
index 478b76deea..aa5b16c2ae 100644
--- a/plugins/DevicesDetection/Visitor.php
+++ b/plugins/DevicesDetection/Visitor.php
@@ -24,6 +24,21 @@ class Visitor
return getDeviceTypeLabel($this->details['config_device_type']);
}
+ public function getOperatingSystemCode()
+ {
+ return $this->details['config_os'];
+ }
+
+ public function getOperatingSystem()
+ {
+ return getOsFullName($this->details['config_os']);
+ }
+
+ public function getOperatingSystemIcon()
+ {
+ return getOsLogo($this->details['config_os']);
+ }
+
public function getBrowserEngineDescription()
{
return getBrowserEngineName($this->getBrowserEngine());
@@ -33,4 +48,29 @@ class Visitor
{
return $this->details['config_browser_engine'];
}
+
+ public function getBrowserCode()
+ {
+ return $this->details['config_browser_name'];
+ }
+
+ public function getBrowserVersion()
+ {
+ return $this->details['config_browser_version'];
+ }
+
+ public function getBrowser()
+ {
+ return getBrowserNameWithVersion($this->details['config_browser_name'] . ";" . $this->details['config_browser_version']);
+ }
+
+ public function getBrowserName()
+ {
+ return getBrowserName($this->details['config_browser_name'] . ";" . $this->details['config_browser_version']);
+ }
+
+ public function getBrowserIcon()
+ {
+ return getBrowserLogo($this->details['config_browser_name'] . ";" . $this->details['config_browser_version']);
+ }
} \ No newline at end of file
diff --git a/plugins/DevicesDetection/functions.php b/plugins/DevicesDetection/functions.php
index 12f18b19d1..d158253344 100644
--- a/plugins/DevicesDetection/functions.php
+++ b/plugins/DevicesDetection/functions.php
@@ -25,7 +25,7 @@ function getBrandLogo($label)
}
}
-function getBrowserFamilyFullNameExtended($label)
+function getBrowserFamilyFullName($label)
{
foreach (BrowserParser::getAvailableBrowserFamilies() as $name => $family) {
if (in_array($label, $family)) {
@@ -35,16 +35,16 @@ function getBrowserFamilyFullNameExtended($label)
return Piwik::translate('General_Unknown');
}
-function getBrowserFamilyLogoExtended($label)
+function getBrowserFamilyLogo($label)
{
$browserFamilies = BrowserParser::getAvailableBrowserFamilies();
if (!empty($label) && array_key_exists($label, $browserFamilies)) {
- return getBrowserLogoExtended($browserFamilies[$label][0]);
+ return getBrowserLogo($browserFamilies[$label][0]);
}
- return getBrowserLogoExtended($label);
+ return getBrowserLogo($label);
}
-function getBrowserNameExtended($label)
+function getBrowserNameWithVersion($label)
{
$short = substr($label, 0, 2);
$ver = substr($label, 3, 10);
@@ -56,6 +56,17 @@ function getBrowserNameExtended($label)
}
}
+function getBrowserName($label)
+{
+ $short = substr($label, 0, 2);
+ $browsers = BrowserParser::getAvailableBrowsers();
+ if (array_key_exists($short, $browsers)) {
+ return trim(ucfirst($browsers[$short]));
+ } else {
+ return Piwik::translate('General_Unknown');
+ }
+}
+
/**
* Returns the path to the logo for the given browser
*
@@ -67,7 +78,7 @@ function getBrowserNameExtended($label)
*
* @return string path to image
*/
-function getBrowserLogoExtended($short)
+function getBrowserLogo($short)
{
$path = 'plugins/UserSettings/images/browsers/%s.gif';
@@ -82,7 +93,7 @@ function getBrowserLogoExtended($short)
}
}
- $family = getBrowserFamilyFullNameExtended($short);
+ $family = getBrowserFamilyFullName($short);
$browserFamilies = BrowserParser::getAvailableBrowserFamilies();
@@ -173,28 +184,36 @@ function getModelName($label)
return $label;
}
-function getOSFamilyFullNameExtended($label)
+function getOSFamilyFullName($label)
{
if ($label == \Piwik\Tracker\Settings::OS_BOT) {
return 'Bot';
}
- $label = OperatingSystemParser::getOsFamily($label);
+ $label = OperatingSystemParser::getOsFamily(_mapLegacyOsShortCodes($label));
+
+ if ($label == 'unknown') {
+ $label = Piwik::translate('General_Unknown');
+ } else if ($label == 'Gaming Console') {
+ $label = Piwik::translate('UserSettings_GamingConsole');
+ }
+
if ($label !== false) {
return $label;
}
return Piwik::translate('General_Unknown');
}
-function getOsFamilyLogoExtended($label)
+function getOsFamilyLogo($label)
{
+ $label = _mapLegacyOsShortCodes($label);
$osFamilies = OperatingSystemParser::getAvailableOperatingSystemFamilies();
if (!empty($label) && array_key_exists($label, $osFamilies)) {
- return getOsLogoExtended($osFamilies[$label][0]);
+ return getOsLogo($osFamilies[$label][0]);
}
- return getOsLogoExtended($label);
+ return getOsLogo($label);
}
-function getOsFullNameExtended($label)
+function getOsFullName($label)
{
if (substr($label, 0, 3) == \Piwik\Tracker\Settings::OS_BOT) {
return 'Bot';
@@ -202,7 +221,7 @@ function getOsFullNameExtended($label)
if (!empty($label) && $label != ";") {
$os = substr($label, 0, 3);
$ver = substr($label, 4, 15);
- $name = OperatingSystemParser::getNameFromId($os, $ver);
+ $name = OperatingSystemParser::getNameFromId(_mapLegacyOsShortCodes($os), $ver);
if (!empty($name)) {
return $name;
}
@@ -210,21 +229,39 @@ function getOsFullNameExtended($label)
return Piwik::translate('General_Unknown');
}
+function _mapLegacyOsShortCodes($shortCode)
+{
+ $legacyShortCodes = array(
+ 'IPA' => 'IOS', // iPad => iOS
+ 'IPH' => 'IOS', // iPhone => iOS
+ 'IPD' => 'IOS', // iPod => iOS
+ 'WIU' => 'WII', // WiiU => Nintendo
+ '3DS' => 'NDS', // Nintendo 3DS => Nintendo Mobile
+ 'DSI' => 'NDS', // Nintendo DSi => Nintendo Mobile
+ 'PSV' => 'PSP', // PlayStation Vita => PlayStation Portable
+ 'MAE' => 'SMG', // Maemo => MeeGo
+ //'VMS' => '', // OpenVMS => ??
+ );
+ return array_key_exists($shortCode, $legacyShortCodes) ? $legacyShortCodes[$shortCode] : $shortCode;
+}
+
/**
* Returns the path to the logo for the given OS
*
* First try to find a logo for the given short code
* If none can be found try to find a logo for the os family
- * Return unkown logo otherwise
+ * Return unknown logo otherwise
*
* @param string $short Shortcode or name of OS
*
* @return string path to image
*/
-function getOsLogoExtended($short)
+function getOsLogo($short)
{
$path = 'plugins/UserSettings/images/os/%s.gif';
+ $short = _mapLegacyOsShortCodes($short);
+
// If name is given instead of short code, try to find matching shortcode
if (strlen($short) > 3) {
@@ -235,7 +272,7 @@ function getOsLogoExtended($short)
}
}
- $family = getOsFamilyFullNameExtended($short);
+ $family = getOSFamilyFullName($short);
$osFamilies = OperatingSystemParser::getAvailableOperatingSystemFamilies();
if (!empty($short) &&
diff --git a/plugins/DevicesDetection/templates/index.twig b/plugins/DevicesDetection/templates/index.twig
index aaba67968b..9c0e97710b 100644
--- a/plugins/DevicesDetection/templates/index.twig
+++ b/plugins/DevicesDetection/templates/index.twig
@@ -8,9 +8,9 @@
</div>
<div id='rightcolumn'>
- <h2 piwik-enriched-headline>{{ "DevicesDetection_OperatingSystemFamilies"|translate }}</h2>
+ <h2 piwik-enriched-headline>{{ "UserSettings_OperatingSystems"|translate }}</h2>
{{ osReport | raw}}
- <h2 piwik-enriched-headline>{{ "UserSettings_BrowserFamilies"|translate }}</h2>
+ <h2 piwik-enriched-headline>{{ "UserSettings_Browsers"|translate }}</h2>
{{ browserReport | raw }}
<h2 piwik-enriched-headline>{{ "DevicesDetection_BrowserEngines"|translate }}</h2>
{{ browserEngineReport | raw }}
diff --git a/plugins/Live/templates/getSingleVisitSummary.twig b/plugins/Live/templates/getSingleVisitSummary.twig
index 9206c5ac51..77f1c8f2bb 100644
--- a/plugins/Live/templates/getSingleVisitSummary.twig
+++ b/plugins/Live/templates/getSingleVisitSummary.twig
@@ -31,7 +31,7 @@
{% endif %}
<div class="visitor-profile-os">
- {% if visitData.operatingSystemIcon is defined %}<img src="{{ visitData.operatingSystemIcon }}"/>{% endif %}{% if visitData.operatingSystemShortName is defined %}<span>{{ visitData.operatingSystemShortName }}</span>{% endif %}
+ {% if visitData.operatingSystemIcon is defined %}<img src="{{ visitData.operatingSystemIcon }}"/>{% endif %}{% if visitData.operatingSystem is defined %}<span>{{ visitData.operatingSystem }}</span>{% endif %}
</div>
</li>
{% if visitData.resolution is defined %}<li><span>{{ 'UserSettings_ColumnResolution'|translate }}</span><strong>{{ visitData.resolution }}</strong></li>{% endif %}
diff --git a/plugins/UserSettings/API.php b/plugins/UserSettings/API.php
index 1be5ecc6fc..0754ccd45c 100644
--- a/plugins/UserSettings/API.php
+++ b/plugins/UserSettings/API.php
@@ -20,8 +20,8 @@ use Piwik\Plugins\DevicesDetection\Archiver AS DDArchiver;
require_once PIWIK_INCLUDE_PATH . '/plugins/UserSettings/functions.php';
/**
- * The UserSettings API lets you access reports about your Visitors technical settings: browsers, browser types (rendering engine),
- * operating systems, plugins supported in their browser, Screen resolution and Screen types (normal, widescreen, dual screen or mobile).
+ * The UserSettings API lets you access reports about some of your Visitors technical settings:
+ * plugins supported in their browser, Screen resolution and Screen types (normal, widescreen, dual screen or mobile).
*
* @method static \Piwik\Plugins\UserSettings\API getInstance()
*/
@@ -56,112 +56,65 @@ class API extends \Piwik\Plugin\API
return \Piwik\Plugins\DevicesDetection\API::getInstance();
}
+ /**
+ * @deprecated since 2.10.0 See {@link Piwik\Plugins\DevicesDetector\API} for new implementation.
+ */
public function getOS($idSite, $period, $date, $segment = false, $addShortLabel = true)
{
- $dataTable = $this->getDataTable(Archiver::OS_RECORD_NAME, $idSite, $period, $date, $segment);
- // these filters are applied directly so other API methods can use GroupBy on the result of this method
- $dataTable->filter('ColumnCallbackAddMetadata', array('label', 'logo', __NAMESPACE__ . '\getOSLogo'));
- if ($addShortLabel) {
- $dataTable->filter(
- 'ColumnCallbackAddMetadata', array('label', 'shortLabel', __NAMESPACE__ . '\getOSShortLabel'));
- }
- $dataTable->filter('ColumnCallbackReplace', array('label', __NAMESPACE__ . '\getOSLabel'));
- return $dataTable;
+ return $this->getDevicesDetectorApi()->getOsVersions($idSite, $period, $date, $segment);
}
/**
- * Gets a DataTable displaying number of visits by operating system family. The operating
- * system families are listed in vendor piwik/device-detector.
+ * @deprecated since 2.10.0 See {@link Piwik\Plugins\DevicesDetector\API} for new implementation.
*/
public function getOSFamily($idSite, $period, $date, $segment = false)
{
- $dataTable = $this->getOS($idSite, $period, $date, $segment, $addShortLabel = false);
- $dataTable->filter('GroupBy', array('label', __NAMESPACE__ . '\getOSFamily'));
- $dataTable->queueFilter('ColumnCallbackReplace', array('label', array('\\Piwik\\Piwik','translate')));
- return $dataTable;
+ return $this->getDevicesDetectorApi()->getOsFamilies($idSite, $period, $date, $segment);
}
/**
- * Gets a DataTable displaying number of visits by device type (mobile vs. desktop).
+ * Gets a DataTable displaying number of visits by device type.
+ * @deprecated since 2.10.0 See {@link Piwik\Plugins\DevicesDetector\API} for new implementation.
*/
public function getMobileVsDesktop($idSite, $period, $date, $segment = false)
{
- $dataTable = $this->getOS($idSite, $period, $date, $segment, $addShortLabel = false);
- $dataTable->filter('GroupBy', array('label', __NAMESPACE__ . '\getDeviceTypeFromOS'));
- $this->ensureDefaultRowsInTable($dataTable);
-
- // set the logo metadata
- $dataTable->queueFilter('MetadataCallbackReplace',
- array('logo', __NAMESPACE__ . '\getDeviceTypeImg', null, array('label')));
-
- // translate the labels
- $dataTable->queueFilter('ColumnCallbackReplace', array('label', array('\\Piwik\\Piwik','translate')));
-
- return $dataTable;
- }
-
- protected function ensureDefaultRowsInTable($dataTable)
- {
- $requiredRows = array(
- 'General_Desktop' => Metrics::INDEX_NB_VISITS,
- 'General_Mobile' => Metrics::INDEX_NB_VISITS
- );
-
- $dataTables = array($dataTable);
-
- if (!($dataTable instanceof DataTable\Map)) {
- foreach ($dataTables as $table) {
- if ($table->getRowsCount() == 0) {
- continue;
- }
- foreach ($requiredRows as $requiredRow => $key) {
- $row = $table->getRowFromLabel($requiredRow);
- if (empty($row)) {
- $table->addRowsFromSimpleArray(array(
- array('label' => $requiredRow, $key => 0)
- ));
- }
- }
- }
- }
+ return $this->getDevicesDetectorApi()->getType($idSite, $period, $date, $segment);
}
+ /**
+ * @deprecated since 2.10.0 See {@link Piwik\Plugins\DevicesDetector\API} for new implementation.
+ */
public function getBrowserVersion($idSite, $period, $date, $segment = false)
{
- $dataTable = $this->getBrowserTable($idSite, $period, $date, $segment);
- $dataTable->filter('ColumnCallbackAddMetadata', array('label', 'shortLabel', __NAMESPACE__ . '\getBrowserShortLabel'));
- return $dataTable;
- }
-
- protected function getBrowserTable($idSite, $period, $date, $segment)
- {
- $dataTable = $this->getDataTable(Archiver::BROWSER_RECORD_NAME, $idSite, $period, $date, $segment);
- $dataTable->filter('ColumnCallbackAddMetadata', array('label', 'logo', __NAMESPACE__ . '\getBrowsersLogo'));
- $dataTable->filter('ColumnCallbackReplace', array('label', __NAMESPACE__ . '\getBrowserLabel'));
- return $dataTable;
+ return $this->getDevicesDetectorApi()->getBrowserVersions($idSite, $period, $date, $segment);
}
/**
- * Gets a DataTable displaying number of visits by browser (ie, Firefox, Chrome, etc.).
- * The browser version is not included in this report.
+ * @deprecated since 2.10.0 See {@link Piwik\Plugins\DevicesDetector\API} for new implementation.
*/
public function getBrowser($idSite, $period, $date, $segment = false)
{
- $dataTable = $this->getBrowserTable($idSite, $period, $date, $segment);
- $dataTable->filter('GroupBy', array('label', __NAMESPACE__ . '\getBrowserFromBrowserVersion'));
- return $dataTable;
+ return $this->getDevicesDetectorApi()->getBrowsers($idSite, $period, $date, $segment);
}
/**
- * @deprecated since 2.7.1-b1 See {@link Piwik\Plugins\DevicesDetector\API} for new implementation.
+ * @deprecated since 2.9.0 See {@link Piwik\Plugins\DevicesDetector\API} for new implementation.
*/
public function getBrowserType($idSite, $period, $date, $segment = false)
{
return $this->getDevicesDetectorApi()->getBrowserEngines($idSite, $period, $date, $segment);
}
+ /**
+ * @deprecated since 2.10.0 Use {@link getScreenType} instead.
+ */
public function getWideScreen($idSite, $period, $date, $segment = false)
{
+ return $this->getScreenType($idSite, $period, $date, $segment);
+ }
+
+ public function getScreenType($idSite, $period, $date, $segment = false)
+ {
$dataTable = $this->getDataTable(Archiver::SCREEN_TYPE_RECORD_NAME, $idSite, $period, $date, $segment);
$dataTable->queueFilter('ColumnCallbackAddMetadata', array('label', 'logo', __NAMESPACE__ . '\getScreensLogo'));
$dataTable->queueFilter('ColumnCallbackReplace', array('label', 'ucfirst'));
diff --git a/plugins/UserSettings/Archiver.php b/plugins/UserSettings/Archiver.php
index ea4496b16a..fed904de7d 100644
--- a/plugins/UserSettings/Archiver.php
+++ b/plugins/UserSettings/Archiver.php
@@ -28,26 +28,19 @@ class Archiver extends \Piwik\Plugin\Archiver
const PLUGIN_RECORD_NAME = 'UserSettings_plugin';
const SCREEN_TYPE_RECORD_NAME = 'UserSettings_wideScreen';
const RESOLUTION_RECORD_NAME = 'UserSettings_resolution';
- const BROWSER_RECORD_NAME = 'UserSettings_browser';
- const OS_RECORD_NAME = 'UserSettings_os';
const CONFIGURATION_RECORD_NAME = 'UserSettings_configuration';
const LANGUAGE_DIMENSION = "log_visit.location_browser_lang";
const RESOLUTION_DIMENSION = "log_visit.config_resolution";
- const BROWSER_VERSION_DIMENSION = "CONCAT(log_visit.config_browser_name, ';', log_visit.config_browser_version)";
- const OS_DIMENSION = "log_visit.config_os";
const CONFIGURATION_DIMENSION = "CONCAT(log_visit.config_os, ';', log_visit.config_browser_name, ';', log_visit.config_resolution)";
/**
* Daily archive of User Settings report. Processes reports for Visits by Resolution,
- * by Browser, Browser family, etc. Some reports are built from the logs, some reports
- * are superset of an existing report (eg. Browser family is built from the Browser report)
+ * browser plugins, etc. Some reports are built from the logs, some reports are superset of an existing report
*/
public function aggregateDayReport()
{
$this->aggregateByConfiguration();
- $this->aggregateByOs();
- $this->aggregateByBrowser();
$this->aggregateByResolutionAndScreenType();
$this->aggregateByPlugin();
$this->aggregateByLanguage();
@@ -60,8 +53,6 @@ class Archiver extends \Piwik\Plugin\Archiver
{
$dataTableRecords = array(
self::CONFIGURATION_RECORD_NAME,
- self::OS_RECORD_NAME,
- self::BROWSER_RECORD_NAME,
self::RESOLUTION_RECORD_NAME,
self::SCREEN_TYPE_RECORD_NAME,
self::PLUGIN_RECORD_NAME,
@@ -76,23 +67,6 @@ class Archiver extends \Piwik\Plugin\Archiver
$this->insertTable(self::CONFIGURATION_RECORD_NAME, $metrics);
}
- protected function aggregateByOs()
- {
- $metrics = $this->getLogAggregator()->getMetricsFromVisitByDimension(self::OS_DIMENSION)->asDataTable();
- $this->insertTable(self::OS_RECORD_NAME, $metrics);
- }
-
- protected function aggregateByBrowser()
- {
- $tableBrowser = $this->aggregateByBrowserVersion();
- }
-
- protected function aggregateByBrowserVersion()
- {
- $tableBrowser = $this->getLogAggregator()->getMetricsFromVisitByDimension(self::BROWSER_VERSION_DIMENSION)->asDataTable();
- $this->insertTable(self::BROWSER_RECORD_NAME, $tableBrowser);
- return $tableBrowser;
- }
protected function aggregateByResolutionAndScreenType()
{
$resolutions = $this->aggregateByResolution();
diff --git a/plugins/UserSettings/Columns/Browser.php b/plugins/UserSettings/Columns/Browser.php
deleted file mode 100644
index edb9b6f150..0000000000
--- a/plugins/UserSettings/Columns/Browser.php
+++ /dev/null
@@ -1,33 +0,0 @@
-<?php
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- *
- */
-namespace Piwik\Plugins\UserSettings\Columns;
-
-use Piwik\Piwik;
-use Piwik\Plugins\DevicesDetection\Columns\BrowserName;
-use Piwik\Plugins\UserSettings\Segment;
-
-class Browser extends BrowserName
-{
- protected $columnName = 'config_browser_name';
- protected $columnType = 'VARCHAR(10) NOT NULL';
-
- protected function configureSegments()
- {
- $segment = new Segment();
- $segment->setSegment('browserCode');
- $segment->setName('UserSettings_ColumnBrowser');
- $segment->setAcceptedValues('FF, IE, CH, SF, OP, etc.');
- $this->addSegment($segment);
- }
-
- public function getName()
- {
- return Piwik::translate('UserSettings_ColumnBrowser');
- }
-} \ No newline at end of file
diff --git a/plugins/UserSettings/Columns/BrowserVersion.php b/plugins/UserSettings/Columns/BrowserVersion.php
deleted file mode 100644
index ea30ea0781..0000000000
--- a/plugins/UserSettings/Columns/BrowserVersion.php
+++ /dev/null
@@ -1,32 +0,0 @@
-<?php
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- *
- */
-namespace Piwik\Plugins\UserSettings\Columns;
-
-use Piwik\Piwik;
-use Piwik\Plugins\UserSettings\Segment;
-
-class BrowserVersion extends \Piwik\Plugins\DevicesDetection\Columns\BrowserVersion
-{
- protected $columnName = 'config_browser_version';
- protected $columnType = 'VARCHAR(20) NOT NULL';
-
- protected function configureSegments()
- {
- $segment = new Segment();
- $segment->setSegment('browserVersion');
- $segment->setName('UserSettings_ColumnBrowserVersion');
- $segment->setAcceptedValues('1.0, 8.0, etc.');
- $this->addSegment($segment);
- }
-
- public function getName()
- {
- return Piwik::translate('UserSettings_ColumnBrowserVersion');
- }
-} \ No newline at end of file
diff --git a/plugins/UserSettings/Columns/MobilevsDesktop.php b/plugins/UserSettings/Columns/MobilevsDesktop.php
deleted file mode 100644
index 79721238b7..0000000000
--- a/plugins/UserSettings/Columns/MobilevsDesktop.php
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- *
- */
-namespace Piwik\Plugins\UserSettings\Columns;
-
-use Piwik\Columns\Dimension;
-use Piwik\Piwik;
-
-class MobilevsDesktop extends Dimension
-{
- public function getName()
- {
- return Piwik::translate('UserSettings_MobileVsDesktop');
- }
-} \ No newline at end of file
diff --git a/plugins/UserSettings/Columns/Operatingsystem.php b/plugins/UserSettings/Columns/Operatingsystem.php
deleted file mode 100644
index 82a00aa8c4..0000000000
--- a/plugins/UserSettings/Columns/Operatingsystem.php
+++ /dev/null
@@ -1,33 +0,0 @@
-<?php
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- *
- */
-namespace Piwik\Plugins\UserSettings\Columns;
-
-use Piwik\Piwik;
-use Piwik\Plugins\DevicesDetection\Columns\Os;
-use Piwik\Plugins\UserSettings\Segment;
-
-class Operatingsystem extends Os
-{
- protected $columnName = 'config_os';
- protected $columnType = 'CHAR(3) NOT NULL';
-
- protected function configureSegments()
- {
- $segment = new Segment();
- $segment->setSegment('operatingSystemCode');
- $segment->setName('UserSettings_ColumnOperatingSystem');
- $segment->setAcceptedValues('WXP, WI7, MAC, LIN, AND, IPD, etc.');
- $this->addSegment($segment);
- }
-
- public function getName()
- {
- return Piwik::translate('UserSettings_ColumnOperatingSystem');
- }
-} \ No newline at end of file
diff --git a/plugins/UserSettings/Columns/OperatingsystemFamily.php b/plugins/UserSettings/Columns/OperatingsystemFamily.php
deleted file mode 100644
index 7f8ed89a96..0000000000
--- a/plugins/UserSettings/Columns/OperatingsystemFamily.php
+++ /dev/null
@@ -1,20 +0,0 @@
-<?php
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- *
- */
-namespace Piwik\Plugins\UserSettings\Columns;
-
-use Piwik\Columns\Dimension;
-use Piwik\Piwik;
-
-class OperatingsystemFamily extends Dimension
-{
- public function getName()
- {
- return Piwik::translate('UserSettings_OperatingSystemFamily');
- }
-} \ No newline at end of file
diff --git a/plugins/UserSettings/Controller.php b/plugins/UserSettings/Controller.php
index 21ebadd617..5334ee20b2 100644
--- a/plugins/UserSettings/Controller.php
+++ b/plugins/UserSettings/Controller.php
@@ -8,13 +8,11 @@
*/
namespace Piwik\Plugins\UserSettings;
-use Piwik\Plugins\UserSettings\Reports\GetBrowser;
use Piwik\Plugins\UserSettings\Reports\GetConfiguration;
use Piwik\Plugins\UserSettings\Reports\GetLanguage;
-use Piwik\Plugins\UserSettings\Reports\GetMobileVsDesktop;
-use Piwik\Plugins\UserSettings\Reports\GetOS;
use Piwik\Plugins\UserSettings\Reports\GetPlugin;
use Piwik\Plugins\UserSettings\Reports\GetResolution;
+use Piwik\Plugins\UserSettings\Reports\GetScreenType;
use Piwik\View;
/**
@@ -29,9 +27,7 @@ class Controller extends \Piwik\Plugin\Controller
$view->dataTablePlugin = $this->renderReport(new GetPlugin());
$view->dataTableResolution = $this->renderReport(new GetResolution());
$view->dataTableConfiguration = $this->renderReport(new GetConfiguration());
- $view->dataTableOS = $this->renderReport(new GetOS());
- $view->dataTableBrowser = $this->renderReport(new GetBrowser());
- $view->dataTableMobileVsDesktop = $this->renderReport(new GetMobileVsDesktop());
+ $view->dataTableScreenType = $this->renderReport(new GetScreenType());
$view->dataTableBrowserLanguage = $this->renderReport(new GetLanguage());
return $view->render();
diff --git a/plugins/UserSettings/Reports/GetBrowser.php b/plugins/UserSettings/Reports/GetBrowser.php
deleted file mode 100644
index 47f262d2ef..0000000000
--- a/plugins/UserSettings/Reports/GetBrowser.php
+++ /dev/null
@@ -1,46 +0,0 @@
-<?php
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- *
- */
-namespace Piwik\Plugins\UserSettings\Reports;
-
-use Piwik\Piwik;
-use Piwik\Plugin\ViewDataTable;
-use Piwik\Plugins\CoreVisualizations\Visualizations\Graph;
-use Piwik\Plugins\UserSettings\Columns\Browser;
-
-class GetBrowser extends Base
-{
- protected function init()
- {
- parent::init();
- $this->dimension = new Browser();
- $this->name = Piwik::translate('UserSettings_WidgetBrowsers');
- $this->documentation = Piwik::translate('UserSettings_WidgetBrowsersDocumentation', '<br />');
- $this->order = 1;
- $this->widgetTitle = 'UserSettings_WidgetBrowsers';
- }
-
- public function configureView(ViewDataTable $view)
- {
- $this->getBasicUserSettingsDisplayProperties($view);
-
- $view->config->title = Piwik::translate('UserSettings_Browsers');
- $view->config->addTranslation('label', $this->dimension->getName());
-
- if ($view->isViewDataTableId(Graph::ID)) {
- $view->config->max_graph_elements = 7;
- }
- }
-
- public function getRelatedReports()
- {
- return array(
- new GetBrowserVersion()
- );
- }
-}
diff --git a/plugins/UserSettings/Reports/GetBrowserVersion.php b/plugins/UserSettings/Reports/GetBrowserVersion.php
deleted file mode 100644
index aa1c39f042..0000000000
--- a/plugins/UserSettings/Reports/GetBrowserVersion.php
+++ /dev/null
@@ -1,47 +0,0 @@
-<?php
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- *
- */
-namespace Piwik\Plugins\UserSettings\Reports;
-
-use Piwik\Piwik;
-use Piwik\Plugin\ViewDataTable;
-use Piwik\Plugins\CoreVisualizations\Visualizations\Graph;
-use Piwik\Plugins\UserSettings\Columns\BrowserVersion;
-
-class GetBrowserVersion extends Base
-{
- protected function init()
- {
- parent::init();
- $this->dimension = new BrowserVersion();
- $this->name = Piwik::translate('UserSettings_WidgetBrowserVersion');
- $this->documentation = ''; // TODO
- $this->order = 2;
- $this->widgetTitle = 'UserSettings_WidgetBrowserVersion';
- }
-
- public function configureView(ViewDataTable $view)
- {
- $this->getBasicUserSettingsDisplayProperties($view);
-
- $view->config->title = Piwik::translate('UserSettings_ColumnBrowserVersion');
- $view->config->addTranslation('label', $this->dimension->getName());
-
- if ($view->isViewDataTableId(Graph::ID)) {
- $view->config->max_graph_elements = 7;
- }
- }
-
- public function getRelatedReports()
- {
- return array(
- new GetBrowser()
- );
- }
-
-}
diff --git a/plugins/UserSettings/Reports/GetMobileVsDesktop.php b/plugins/UserSettings/Reports/GetMobileVsDesktop.php
deleted file mode 100644
index bbdfe90095..0000000000
--- a/plugins/UserSettings/Reports/GetMobileVsDesktop.php
+++ /dev/null
@@ -1,43 +0,0 @@
-<?php
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- *
- */
-namespace Piwik\Plugins\UserSettings\Reports;
-
-use Piwik\Piwik;
-use Piwik\Plugin\ViewDataTable;
-use Piwik\Plugins\UserSettings\Columns\MobilevsDesktop;
-
-class GetMobileVsDesktop extends Base
-{
- protected function init()
- {
- parent::init();
- $this->dimension = new MobilevsDesktop();
- $this->name = Piwik::translate('UserSettings_MobileVsDesktop');
- $this->documentation = ''; // TODO
- $this->constantRowsCount = true;
- $this->order = 9;
- $this->widgetTitle = 'UserSettings_MobileVsDesktop';
- }
-
- public function configureView(ViewDataTable $view)
- {
- $this->getBasicUserSettingsDisplayProperties($view);
-
- $view->config->title = Piwik::translate('UserSettings_MobileVsDesktop');
- $view->config->addTranslation('label', $this->dimension->getName());
- }
-
- public function getRelatedReports()
- {
- return array(
- new GetWideScreen()
- );
- }
-
-}
diff --git a/plugins/UserSettings/Reports/GetOS.php b/plugins/UserSettings/Reports/GetOS.php
deleted file mode 100644
index f3b6c028a2..0000000000
--- a/plugins/UserSettings/Reports/GetOS.php
+++ /dev/null
@@ -1,41 +0,0 @@
-<?php
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- *
- */
-namespace Piwik\Plugins\UserSettings\Reports;
-
-use Piwik\Piwik;
-use Piwik\Plugin\ViewDataTable;
-use Piwik\Plugins\UserSettings\Columns\Operatingsystem;
-
-class GetOS extends Base
-{
- protected function init()
- {
- parent::init();
- $this->dimension = new Operatingsystem();
- $this->name = Piwik::translate('UserSettings_WidgetOperatingSystems');
- $this->documentation = ''; // TODO
- $this->order = 6;
- $this->widgetTitle = 'UserSettings_WidgetOperatingSystems';
- }
-
- public function configureView(ViewDataTable $view)
- {
- $this->getBasicUserSettingsDisplayProperties($view);
-
- $view->config->title = Piwik::translate('UserSettings_OperatingSystems');
- $view->config->addTranslation('label', $this->dimension->getName());
- }
-
- public function getRelatedReports()
- {
- return array(
- new GetOSFamily()
- );
- }
-}
diff --git a/plugins/UserSettings/Reports/GetOSFamily.php b/plugins/UserSettings/Reports/GetOSFamily.php
deleted file mode 100644
index 5e12861b80..0000000000
--- a/plugins/UserSettings/Reports/GetOSFamily.php
+++ /dev/null
@@ -1,42 +0,0 @@
-<?php
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- *
- */
-namespace Piwik\Plugins\UserSettings\Reports;
-
-use Piwik\Piwik;
-use Piwik\Plugin\ViewDataTable;
-use Piwik\Plugins\UserSettings\Columns\OperatingsystemFamily;
-
-class GetOSFamily extends Base
-{
- protected function init()
- {
- parent::init();
- $this->dimension = new OperatingsystemFamily();
- $this->name = Piwik::translate('UserSettings_OperatingSystemFamily');
- $this->documentation = ''; // TODO
- $this->order = 8;
- $this->widgetTitle = 'UserSettings_OperatingSystemFamily';
- }
-
- public function configureView(ViewDataTable $view)
- {
- $this->getBasicUserSettingsDisplayProperties($view);
-
- $view->config->title = $this->name;
- $view->config->addTranslation('label', $this->dimension->getName());
- }
-
- public function getRelatedReports()
- {
- return array(
- new GetOS()
- );
- }
-
-}
diff --git a/plugins/UserSettings/Reports/GetWideScreen.php b/plugins/UserSettings/Reports/GetScreenType.php
index 92006d590c..1b33d0dc4c 100644
--- a/plugins/UserSettings/Reports/GetWideScreen.php
+++ b/plugins/UserSettings/Reports/GetScreenType.php
@@ -12,7 +12,7 @@ use Piwik\Piwik;
use Piwik\Plugin\ViewDataTable;
use Piwik\Plugins\UserSettings\Columns\TypeOfScreen;
-class GetWideScreen extends Base
+class GetScreenType extends Base
{
protected function init()
{
@@ -34,11 +34,4 @@ class GetWideScreen extends Base
$view->config->show_limit_control = false;
$view->config->addTranslation('label', $this->dimension->getName());
}
-
- public function getRelatedReports()
- {
- return array(
- new GetMobileVsDesktop()
- );
- }
}
diff --git a/plugins/UserSettings/UserSettings.php b/plugins/UserSettings/UserSettings.php
index 728df69f7e..450a2f275c 100644
--- a/plugins/UserSettings/UserSettings.php
+++ b/plugins/UserSettings/UserSettings.php
@@ -24,22 +24,40 @@ class UserSettings extends \Piwik\Plugin
{
return array(
'Metrics.getDefaultMetricTranslations' => 'addMetricTranslations',
- 'Live.getAllVisitorDetails' => 'extendVisitorDetails'
+ 'Live.getAllVisitorDetails' => 'extendVisitorDetails',
+ 'Request.dispatch' => 'mapDeprecatedActions'
);
}
+ /**
+ * Maps the deprecated actions that were 'moved' to DevicesDetection plugin
+ *
+ * @deprecated since 2.10.0 and will be removed from May 1st 2015
+ * @param $module
+ * @param $action
+ * @param $parameters
+ */
+ public function mapDeprecatedActions(&$module, &$action, &$parameters)
+ {
+ $movedMethods = array(
+ 'getBrowser' => 'getBrowsers',
+ 'getBrowserVersion' => 'getBrowserVersions',
+ 'getMobileVsDesktop' => 'getType',
+ 'getOS' => 'getOsVersions',
+ 'getOSFamily' => 'getOsFamilies',
+ 'getBrowserType' => 'getBrowserEngines'
+ );
+
+ if ($module == 'UserSettings' && array_key_exists($action, $movedMethods)) {
+ $module = 'DevicesDetection';
+ $action = $movedMethods[$action];
+ }
+ }
+
public function extendVisitorDetails(&$visitor, $details)
{
$instance = new Visitor($details);
- $visitor['operatingSystem'] = $instance->getOperatingSystem();
- $visitor['operatingSystemCode'] = $instance->getOperatingSystemCode();
- $visitor['operatingSystemShortName'] = $instance->getOperatingSystemShortName();
- $visitor['operatingSystemIcon'] = $instance->getOperatingSystemIcon();
- $visitor['browserName'] = $instance->getBrowser();
- $visitor['browserIcon'] = $instance->getBrowserIcon();
- $visitor['browserCode'] = $instance->getBrowserCode();
- $visitor['browserVersion'] = $instance->getBrowserVersion();
$visitor['screenType'] = $instance->getScreenType();
$visitor['resolution'] = $instance->getResolution();
$visitor['screenTypeIcon'] = $instance->getScreenTypeIcon();
diff --git a/plugins/UserSettings/Visitor.php b/plugins/UserSettings/Visitor.php
index 6d114b1124..03e2bd958a 100644
--- a/plugins/UserSettings/Visitor.php
+++ b/plugins/UserSettings/Visitor.php
@@ -63,46 +63,6 @@ class Visitor
return null;
}
- function getOperatingSystemCode()
- {
- return $this->details['config_os'];
- }
-
- function getOperatingSystem()
- {
- return getOSLabel($this->details['config_os']);
- }
-
- function getOperatingSystemShortName()
- {
- return getOSShortLabel($this->details['config_os']);
- }
-
- function getOperatingSystemIcon()
- {
- return getOSLogo($this->details['config_os']);
- }
-
- function getBrowserCode()
- {
- return $this->details['config_browser_name'];
- }
-
- function getBrowserVersion()
- {
- return $this->details['config_browser_version'];
- }
-
- function getBrowser()
- {
- return getBrowserLabel($this->details['config_browser_name'] . ";" . $this->details['config_browser_version']);
- }
-
- function getBrowserIcon()
- {
- return getBrowsersLogo($this->details['config_browser_name'] . ";" . $this->details['config_browser_version']);
- }
-
function getScreenType()
{
if (!array_key_exists('config_resolution', $this->details)) {
diff --git a/plugins/UserSettings/functions.php b/plugins/UserSettings/functions.php
index d7ca0fafd4..e367ff8bc9 100644
--- a/plugins/UserSettings/functions.php
+++ b/plugins/UserSettings/functions.php
@@ -11,12 +11,6 @@ namespace Piwik\Plugins\UserSettings;
use Piwik\Piwik;
use Piwik\Tracker\Request;
-use UserAgentParser;
-
-/**
- * @see libs/UserAgentParser/UserAgentParser.php
- */
-require_once PIWIK_INCLUDE_PATH . '/libs/UserAgentParser/UserAgentParser.php';
function getPluginsLogo($oldLabel)
{
@@ -26,69 +20,6 @@ function getPluginsLogo($oldLabel)
return 'plugins/UserSettings/images/plugins/' . $oldLabel . '.gif';
}
-function getOSLabel($osId)
-{
- $osName = UserAgentParser::getOperatingSystemNameFromId($osId);
- if ($osName !== false) {
- return $osName;
- }
- if ($osId == 'UNK') {
- return Piwik::translate('General_Unknown');
- }
- return $osId;
-}
-
-function getOSShortLabel($osId)
-{
- $osShortName = UserAgentParser::getOperatingSystemShortNameFromId($osId);
- if ($osShortName !== false) {
- return $osShortName;
- }
- if ($osId == 'UNK') {
- return Piwik::translate('General_Unknown');
- }
- return $osId;
-}
-
-function getOSFamily($osLabel)
-{
- $osId = UserAgentParser::getOperatingSystemIdFromName($osLabel);
- $osFamily = UserAgentParser::getOperatingSystemFamilyFromId($osId);
-
- if ($osFamily == 'unknown') {
- $osFamily = Piwik::translate('General_Unknown');
- } else if ($osFamily == 'Gaming Console') {
- $osFamily = Piwik::translate('UserSettings_GamingConsole');
- }
-
- return $osFamily;
-}
-
-function getDeviceTypeFromOS($osLabel)
-{
- $osId = UserAgentParser::getOperatingSystemIdFromName($osLabel);
- $osFamily = UserAgentParser::getOperatingSystemFamilyFromId($osId);
-
- // NOTE: translations done in another filter
- switch ($osFamily) {
- case 'Windows':
- case 'Linux':
- case 'Mac':
- case 'Unix':
- case 'Other':
- case 'Gaming Console':
- return 'General_Desktop';
- case 'iOS':
- case 'Android':
- case 'Windows Mobile':
- case 'Other Mobile':
- case 'Mobile Gaming Console':
- return 'General_Mobile';
- default:
- return 'General_Unknown';
- }
-}
-
function getConfigurationLabel($str)
{
if (strpos($str, ';') === false) {
@@ -96,9 +27,9 @@ function getConfigurationLabel($str)
}
$values = explode(";", $str);
- $os = getOSLabel($values[0]);
+ $os = \Piwik\Plugins\DevicesDetection\getOsFullName($values[0]);
$name = $values[1];
- $browser = UserAgentParser::getBrowserNameFromId($name);
+ $browser = \Piwik\Plugins\DevicesDetection\getBrowserName($name);
if ($browser === false) {
$browser = Piwik::translate('General_Unknown');
}
@@ -106,44 +37,6 @@ function getConfigurationLabel($str)
return $os . " / " . $browser . " / " . $resolution;
}
-function getBrowserLabel($oldLabel)
-{
- $browserId = getBrowserId($oldLabel);
- $version = getBrowserVersion($oldLabel);
- $browserName = UserAgentParser::getBrowserNameFromId($browserId);
- if ($browserName !== false) {
- return $browserName . " " . $version;
- }
- if ($browserId == 'UNK') {
- return Piwik::translate('General_Unknown');
- }
- return $oldLabel;
-}
-
-function getBrowserShortLabel($oldLabel)
-{
- $browserId = getBrowserId($oldLabel);
- $version = getBrowserVersion($oldLabel);
- $browserName = UserAgentParser::getBrowserShortNameFromId($browserId);
- if ($browserName !== false) {
- return $browserName . " " . $version;
- }
- if ($browserId == 'UNK') {
- return Piwik::translate('General_Unknown');
- }
- return $oldLabel;
-}
-
-function getBrowserId($str)
-{
- return substr($str, 0, strpos($str, ';'));
-}
-
-function getBrowserVersion($str)
-{
- return substr($str, strpos($str, ';') + 1);
-}
-
function getLogoImageFromId($dir, $id)
{
$path = $dir . '/' . $id . '.gif';
@@ -154,43 +47,11 @@ function getLogoImageFromId($dir, $id)
}
}
-function getBrowsersLogo($label)
-{
- $id = getBrowserId($label);
- // For aggregated row 'Others'
- if (empty($id)) {
- $id = 'UNK';
- }
- return getLogoImageFromId('plugins/UserSettings/images/browsers', $id);
-}
-
-function getOSLogo($label)
-{
- // For aggregated row 'Others'
- if (empty($label)) {
- $label = 'UNK';
- }
- return getLogoImageFromId('plugins/UserSettings/images/os', $label);
-}
-
function getScreensLogo($label)
{
return 'plugins/UserSettings/images/screens/' . $label . '.gif';
}
-function getDeviceTypeImg($oldOSImage, $osFamilyLabel)
-{
- switch ($osFamilyLabel) {
- case 'General_Desktop':
- return 'plugins/UserSettings/images/screens/normal.gif';
- case 'General_Mobile':
- return 'plugins/UserSettings/images/screens/mobile.gif';
- case 'General_Unknown':
- default:
- return 'plugins/UserSettings/images/os/UNK.gif';
- }
-}
-
function getScreenTypeFromResolution($resolution)
{
if ($resolution === Request::UNKNOWN_RESOLUTION) {
@@ -213,24 +74,6 @@ function getScreenTypeFromResolution($resolution)
return $name;
}
-function getBrowserFamily($browserLabel)
-{
- $familyNameToUse = UserAgentParser::getBrowserFamilyFromId(substr($browserLabel, 0, 2));
- return $familyNameToUse;
-}
-
-/**
- * Extracts the browser name from a string with the browser name and version.
- */
-function getBrowserFromBrowserVersion($browserWithVersion)
-{
- if (preg_match("/(.+) [0-9]+(?:\.[0-9]+)?$/", $browserWithVersion, $matches) === 0) {
- return $browserWithVersion;
- }
-
- return $matches[1];
-}
-
/**
* Returns the given language code to translated language name
*
diff --git a/plugins/UserSettings/images/os/IOS.gif b/plugins/UserSettings/images/os/IOS.gif
index a3b970ae1b..17ef80cd53 100644
--- a/plugins/UserSettings/images/os/IOS.gif
+++ b/plugins/UserSettings/images/os/IOS.gif
Binary files differ
diff --git a/plugins/UserSettings/lang/en.json b/plugins/UserSettings/lang/en.json
index f4ab9b4460..0c1ed777c1 100644
--- a/plugins/UserSettings/lang/en.json
+++ b/plugins/UserSettings/lang/en.json
@@ -12,6 +12,7 @@
"ColumnOperatingSystem": "Operating system",
"ColumnResolution": "Resolution",
"ColumnTypeOfScreen": "Type of screen",
+ "ScreenTypes": "Screen types",
"Configurations": "Configurations",
"GamingConsole": "Gaming Console",
"Language_aa": "Afar",
diff --git a/plugins/UserSettings/templates/index.twig b/plugins/UserSettings/templates/index.twig
index 79f6d6072e..7b6d236d47 100644
--- a/plugins/UserSettings/templates/index.twig
+++ b/plugins/UserSettings/templates/index.twig
@@ -1,25 +1,19 @@
<div id='leftcolumn'>
-
- <h2 piwik-enriched-headline>{{ 'UserSettings_Browsers'|translate }}</h2>
- {{ dataTableBrowser|raw }}
-
<h2 piwik-enriched-headline>{{ 'General_Plugins'|translate }}</h2>
{{ dataTablePlugin|raw }}
+
+ <h2 piwik-enriched-headline>{{ 'UserSettings_BrowserLanguage'|translate }}</h2>
+ {{ dataTableBrowserLanguage|raw }}
</div>
<div id='rightcolumn'>
- <h2 piwik-enriched-headline>{{ 'UserSettings_Configurations'|translate }}</h2>
- {{ dataTableConfiguration|raw }}
-
- <h2 piwik-enriched-headline>{{ 'UserSettings_OperatingSystems'|translate }}</h2>
- {{ dataTableOS|raw }}
<h2 piwik-enriched-headline>{{ 'UserSettings_Resolutions'|translate }}</h2>
{{ dataTableResolution|raw }}
- <h2 piwik-enriched-headline>{{ 'UserSettings_MobileVsDesktop'|translate }}</h2>
- {{ dataTableMobileVsDesktop|raw }}
+ <h2 piwik-enriched-headline>{{ 'UserSettings_ScreenTypes'|translate }}</h2>
+ {{ dataTableScreenType|raw }}
- <h2 piwik-enriched-headline>{{ 'UserSettings_BrowserLanguage'|translate }}</h2>
- {{ dataTableBrowserLanguage|raw }}
+ <h2 piwik-enriched-headline>{{ 'UserSettings_Configurations'|translate }}</h2>
+ {{ dataTableConfiguration|raw }}
</div>
diff --git a/plugins/UserSettings/tests/Unit/UserSettingsTest.php b/plugins/UserSettings/tests/Unit/UserSettingsTest.php
deleted file mode 100644
index 408420ed6f..0000000000
--- a/plugins/UserSettings/tests/Unit/UserSettingsTest.php
+++ /dev/null
@@ -1,1036 +0,0 @@
-<?php
-/**
- * Piwik - free/libre analytics platform
- *
- * @link http://piwik.org
- * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later
- */
-namespace Piwik\Plugins\UserSettings\tests\Unit;
-
-use UserAgentParser;
-
-require_once PIWIK_INCLUDE_PATH . '/plugins/UserSettings/UserSettings.php';
-require_once PIWIK_INCLUDE_PATH . '/plugins/UserSettings/functions.php';
-
-class UserSettingsTest extends \PHPUnit_Framework_TestCase
-{
- // User agent strings and expected parser results
- public function getUserAgents()
- {
- return array(
- // array('User Agent String', array(
- // array( browser_id, name, short_name, version, major_number, minor_number, family ),
- // array( os_id, name, short_name ))),
-
- // Special: URL encoded IE8
- array('Mozilla/4.0+(compatible;+MSIE+8.0;+Windows+NT+6.1;+WOW64;+Trident/4.0;+GTB7.4;+SLCC2;+.NET+CLR+2.0.50727;+.NET+CLR+3.5.30729;+.NET+CLR+3.0.30729;+Media+Center+PC+6.0;+.NET4.0C;+.NET4.0E;+MS-RTC+LM+8;+InfoPath.2)', array(
- array('IE', 'Internet Explorer', 'IE', '8.0', '8', '0', 'ie'),
- array('WI7', 'Windows 7', 'Win 7'))),
-
- // ABrowse
- array('Mozilla/5.0 (compatible; U; ABrowse 0.6; Syllable) AppleWebKit/420+ (KHTML, like Gecko)', array(
- array('AB', 'ABrowse', 'ABrowse', '0.6', '0', '6', 'webkit'),
- array('SYL', 'Syllable', 'Syllable'))),
- array('Mozilla/5.0 (compatible; ABrowse 0.4; Syllable)', array(
- array('AB', 'ABrowse', 'ABrowse', '0.4', '0', '4', 'webkit'),
- array('SYL', 'Syllable', 'Syllable'))),
-
- // Acoo Browser (treat as IE)
- array('Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB6; Acoo Browser; .NET CLR 1.1.4322; .NET CLR 2.0.50727)', array(
- array('IE', 'Internet Explorer', 'IE', '8.0', '8', '0', 'ie'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Acoo Browser; .NET CLR 2.0.50727; .NET CLR 1.1.4322)', array(
- array('IE', 'Internet Explorer', 'IE', '7.0', '7', '0', 'ie'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; Acoo Browser; .NET CLR 1.1.4322; .NET CLR 2.0.50727)', array(
- array('IE', 'Internet Explorer', 'IE', '6.0', '6', '0', 'ie'),
- array('WXP', 'Windows XP', 'Win XP'))),
-
- // Amaya
- array('amaya/9.52 libwww/5.4.0', array(
- array('AM', 'Amaya', 'Amaya', '9.52', '9', '52', 'unknown'),
- false)),
-
- // AmigaVoyager
- array('AmigaVoyager/3.2 (AmigaOS/MC680x0)', array(
- array('AV', 'AmigaVoyager', 'AmigaVoyager', '3.2', '3', '2', 'unknown'),
- array('AMI', 'AmigaOS', 'AmigaOS'))),
- array('AmigaVoyager/2.95 (compatible; MC680x0; AmigaOS; SV1)', array(
- array('AV', 'AmigaVoyager', 'AmigaVoyager', '2.95', '2', '95', 'unknown'),
- array('AMI', 'AmigaOS', 'AmigaOS'))),
- array('AmigaVoyager/2.95 (compatible; MC680x0; AmigaOS)', array(
- array('AV', 'AmigaVoyager', 'AmigaVoyager', '2.95', '2', '95', 'unknown'),
- array('AMI', 'AmigaOS', 'AmigaOS'))),
-
- // Android
- array('Mozilla/5.0 (Linux; U; Android 1.1; en-us; dream) AppleWebKit/525.10+ (KHTML, like Gecko) Version/3.0.4 Mobile Safari/523.12.2', array(
- array('SF', 'Safari', 'Safari', '3.0', '3', '0', 'webkit'),
- array('AND', 'Android', 'Android'))),
- array('Mozilla/5.0 (Linux; U; Android 2.2.1; en-us; Nexus One Build/FRG83) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1', array(
- array('SF', 'Safari', 'Safari', '4.0', '4', '0', 'webkit'),
- array('AND', 'Android', 'Android'))),
- array('Mozilla/5.0 (Linux; U; Android 2.2.1; en-us; device Build/FRG83) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Safari/533.1', array(
- array('SF', 'Safari', 'Safari', '4.0', '4', '0', 'webkit'),
- array('AND', 'Android', 'Android'))),
- array('Mozilla/5.0 (Linux; U; Android 4.0.1; en-us; Galaxy Nexus Build/ITL41D) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30', array(
- array('SF', 'Safari', 'Safari', '4.0', '4', '0', 'webkit'),
- array('AND', 'Android', 'Android'))),
-
- // Android - Mobile Chrome
- /*
- array('rray('Mozilla/5.0 (Linux; U; Android 4.1; en-us) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.16 Safari/534.24', array(
- array('CH', 'Chrome', 'Chrome', '11.0', '11', '0', 'webkit'),
- array('AND', 'Android', 'Android'))),
- */
- array('Mozilla/5.0 (Linux; U; Android 4.0.1; en-us; Galaxy Nexus Build/ITL41F) AppleWebKit/535.7 (KHTML, like Gecko) CrMo/16.0.912.75 Mobile Safari/535.7', array(
- array('CH', 'Chrome', 'Chrome', '16.0', '16', '0', 'webkit'),
- array('AND', 'Android', 'Android'))),
-
- // AOL / America Online Browser (treat as IE)
- array('Mozilla/4.0 (compatible; MSIE 7.0; AOL 9.5; AOLBuild 4337.43; Windows NT 5.1; .NET CLR 1.1.4322)', array(
- array('IE', 'Internet Explorer', 'IE', '7.0', '7', '0', 'ie'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/4.0 (compatible; MSIE 7.0; AOL 9.1; AOLBuild 4334.5009; Windows NT 5.1; GTB5; .NET CLR 1.1.4322)', array(
- array('IE', 'Internet Explorer', 'IE', '7.0', '7', '0', 'ie'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/4.0 (compatible; MSIE 7.0; AOL 9.0; Windows NT 5.1; InfoPath.1)', array(
- array('IE', 'Internet Explorer', 'IE', '7.0', '7', '0', 'ie'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/4.0 (compatible; MSIE 6.0; AOL 8.0; Windows NT 5.1; SV1)', array(
- array('IE', 'Internet Explorer', 'IE', '6.0', '6', '0', 'ie'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/4.0 (compatible; MSIE 7.0; AOL 7.0; Windows NT 5.1)', array(
- array('IE', 'Internet Explorer', 'IE', '7.0', '7', '0', 'ie'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/4.0 (compatible; MSIE 5.5; AOL 6.0; Windows 98; Win 9x 4.90)', array(
- array('IE', 'Internet Explorer', 'IE', '5.5', '5', '5', 'ie'),
- array('WME', 'Windows Me', 'Win Me'))),
- array('Mozilla/4.0 (compatible; MSIE 5.5; AOL 5.0; Windows NT 5.0)', array(
- array('IE', 'Internet Explorer', 'IE', '5.5', '5', '5', 'ie'),
- array('W2K', 'Windows 2000', 'Win 2000'))),
- array('Mozilla/4.0 (compatible; MSIE 4.01; AOL 4.0; Windows 95)', array(
- array('IE', 'Internet Explorer', 'IE', '4.01', '4', '01', 'ie'),
- array('W95', 'Windows 95', 'Win 95'))),
- array('Mozilla/4.0 (compatible; MSIE 7.0; America Online Browser 1.1; Windows NT 5.1; (R1 1.5); .NET CLR 2.0.50727; InfoPath.1)', array(
- array('IE', 'Internet Explorer', 'IE', '7.0', '7', '0', 'ie'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/4.0 (compatible; MSIE 6.0; America Online Browser 1.1; Windows 98)', array(
- array('IE', 'Internet Explorer', 'IE', '6.0', '6', '0', 'ie'),
- array('W98', 'Windows 98', 'Win 98'))),
-
- // Arora
- array('Mozilla/5.0 (X11; U; Linux; de-DE) AppleWebKit/527+ (KHTML, like Gecko, Safari/419.3) Arora/0.8.0', array(
- array('AR', 'Arora', 'Arora', '0.8', '0', '8', 'webkit'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (X11; U; Linux; en-US) AppleWebKit/527+ (KHTML, like Gecko, Safari/419.3) Arora/0.6', array(
- array('AR', 'Arora', 'Arora', '0.6', '0', '6', 'webkit'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (Windows; U; Windows NT 5.2; pt-BR) AppleWebKit/527+ (KHTML, like Gecko, Safari/419.3) Arora/0.4 (Change: )', array(
- array('AR', 'Arora', 'Arora', '0.4', '0', '4', 'webkit'),
- array('WS3', 'Windows Server 2003 / XP x64', 'Win S2003'))),
- array('Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN) AppleWebKit/523.15 (KHTML, like Gecko, Safari/419.3) Arora/0.3 (Change: 287 c9dfb30)', array(
- array('AR', 'Arora', 'Arora', '0.3', '0', '3', 'webkit'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/5.0 (X11; U; Linux; en-US) AppleWebKit/523.15 (KHTML, like Gecko, Safari/419.3) Arora/0.2 (Change: 189 35c14e0)', array(
- array('AR', 'Arora', 'Arora', '0.2', '0', '2', 'webkit'),
- array('LIN', 'Linux', 'Linux'))),
-
- // Avant (treat as IE)
- array('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Avant Browser; .NET CLR 2.0.50727; MAXTHON 2.0)', array(
- array('IE', 'Internet Explorer', 'IE', '7.0', '7', '0', 'ie'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; Avant Browser; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)', array(
- array('IE', 'Internet Explorer', 'IE', '8.0', '8', '0', 'ie'),
- array('WI7', 'Windows 7', 'Win 7'))),
-
- // AWeb
- array('Amiga-AWeb/3.5.07 beta', array(
- array('AW', 'Amiga AWeb', 'AWeb', '3.5', '3', '5', 'unknown'),
- array('AMI', 'AmigaOS', 'AmigaOS'))),
- array('Mozilla/6.0; (Spoofed by Amiga-AWeb/3.5.07 beta)', array(
- array('AW', 'Amiga AWeb', 'AWeb', '3.5', '3', '5', 'unknown'),
- array('AMI', 'AmigaOS', 'AmigaOS'))),
- array('MSIE/6.0; (Spoofed by Amiga-AWeb/3.4APL)', array(
- array('AW', 'Amiga AWeb', 'AWeb', '3.4', '3', '4', 'unknown'),
- array('AMI', 'AmigaOS', 'AmigaOS'))),
-
- // Beonex
- array('Mozilla/5.0 (Windows; U; WinNT; en; rv:1.0.2) Gecko/20030311 Beonex/0.8.2-stable', array(
- array('BE', 'Beonex', 'Beonex', '0.8', '0', '8', 'unknown'),
- array('WNT', 'Windows NT', 'Win NT'))),
- array('Mozilla/5.0 (Windows; U; WinNT; en; Preview) Gecko/20020603 Beonex/0.8-stable', array(
- array('BE', 'Beonex', 'Beonex', '0.8', '0', '8', 'unknown'),
- array('WNT', 'Windows NT', 'Win NT'))),
-
- // BlackBerry
- array('BlackBerry8700/4.1.0 Profile/MIDP-2.0 Configuration/CLDC-1.1', array(
- array('BB', 'BlackBerry', 'BlackBerry', '4.1', '4', '1', 'webkit'),
- array('BLB', 'BlackBerry', 'BlackBerry'))),
-
- array('Mozilla/5.0 (BlackBerry; U; BlackBerry 9800; en) AppleWebKit/534.1+ (KHTML, Like Gecko) Version/6.0.0.141 Mobile Safari/534.1+', array(
- array('BB', 'BlackBerry', 'BlackBerry', '6.0', '6', '0', 'webkit'),
- array('BLB', 'BlackBerry', 'BlackBerry'))),
-
- array('Mozilla/5.0 (PlayBook; U; RIM Tablet OS 1.0.0; en-US) AppleWebKit/534.11+ (KHTML, like Gecko) Version/0.0.1 Safari/534.11+', array(
- array('BP', 'PlayBook', 'PlayBook', '0.0', '0', '0', 'webkit'),
- array('QNX', 'QNX', 'QNX'))),
-
- // BrowseX
- array('Mozilla/4.61 [en] (X11; U; ) - BrowseX (2.0.0 Windows)', array(
- array('BX', 'BrowseX', 'BrowseX', '2.0', '2', '0', 'unknown'),
- false)),
-
- // Camino (formerly known as Chimera; not to be confused with another browser also named Chimera)
- array('Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en; rv:1.9.0.8pre) Gecko/2009022800 Camino/2.0b3pre', array(
- array('CA', 'Camino', 'Camino', '2.0', '2', '0', 'gecko'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en; rv:1.9.0.10pre) Gecko/2009041800 Camino/2.0b3pre (like Firefox/3.0.10pre)', array(
- array('CA', 'Camino', 'Camino', '2.0', '2', '0', 'gecko'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en; rv:1.8.1.4pre) Gecko/20070511 Camino/1.6pre', array(
- array('CA', 'Camino', 'Camino', '1.6', '1', '6', 'gecko'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en; rv:1.8.1.6) Gecko/20070809 Firefox/2.0.0.6 Camino/1.5.1', array(
- array('CA', 'Camino', 'Camino', '1.5', '1', '5', 'gecko'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.0.1) Gecko/20030306 Camino/0.7', array(
- array('CA', 'Camino', 'Camino', '0.7', '0', '7', 'gecko'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X; pl-PL; rv:1.0.1) Gecko/20021111 Chimera/0.6', array(
- array('CA', 'Camino', 'Camino', '0.6', '0', '6', 'gecko'),
- array('MAC', 'Mac OS', 'Mac OS'))),
-
- // Cheshire
- array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/418.8 (KHTML, like Gecko, Safari) Cheshire/1.0.UNOFFICIAL', array(
- array('CS', 'Cheshire', 'Cheshire', '1.0', '1', '0', 'webkit'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/419 (KHTML, like Gecko, Safari/419.3) Cheshire/1.0.ALPHA', array(
- array('CS', 'Cheshire', 'Cheshire', '1.0', '1', '0', 'webkit'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/418.9 (KHTML, like Safari) Cheshire/1.0.ALPHA', array(
- array('CS', 'Cheshire', 'Cheshire', '1.0', '1', '0', 'webkit'),
- array('MAC', 'Mac OS', 'Mac OS'))),
-
- // Chrome / Chromium
- array('Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US) AppleWebKit/532.9 (KHTML, like Gecko) Chrome/5.0.310.0 Safari/532.9', array(
- array('CH', 'Chrome', 'Chrome', '5.0', '5', '0', 'webkit'),
- array('WS3', 'Windows Server 2003 / XP x64', 'Win S2003'))),
- array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Chrome/1.0.154.48 Safari/525.19', array(
- array('CH', 'Chrome', 'Chrome', '1.0', '1', '0', 'webkit'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/5.0 (Linux; U; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.27 Safari/525.13', array(
- array('CH', 'Chrome', 'Chrome', '0.2', '0', '2', 'webkit'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (Windows NT 6.0; WOW64) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.16 Safari/534.24', array(
- array('CH', 'Chrome', 'Chrome', '11.0', '11', '0', 'webkit'),
- array('WVI', 'Windows Vista', 'Win Vista'))),
- array('Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.16 Safari/534.24', array(
- array('CH', 'Chrome', 'Chrome', '11.0', '11', '0', 'webkit'),
- array('LIN', 'Linux', 'Linux'))),
-
- // Chrome Frame
- array('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; chromeframe/11.0.660.0)', array(
- array('CF', 'Chrome Frame', 'Chrome Frame', '11.0', '11', '0', 'webkit'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) chromeframe/11.0.660.0', array(
- array('CF', 'Chrome Frame', 'Chrome Frame', '11.0', '11', '0', 'webkit'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; chromeframe/11.0.660.0) AppleWebKit/534.18 (KHTML, like Gecko) Chrome/11.0.660.0 Safari/534.18', array(
- array('CF', 'Chrome Frame', 'Chrome Frame', '11.0', '11', '0', 'webkit'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/534.18 (KHTML, like Gecko) Chrome/11.0.660.0 Safari/534.18', array(
- array('CH', 'Chrome', 'Chrome', '11.0', '11', '0', 'webkit'),
- array('WXP', 'Windows XP', 'Win XP'))),
-
- // ChromePlus (treat as Chrome)
- array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/532.2 (KHTML, like Gecko) ChromePlus/4.0.222.3 Chrome/4.0.222.3 Safari/532.2', array(
- array('CH', 'Chrome', 'Chrome', '4.0', '4', '0', 'webkit'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.28.3 (KHTML, like Gecko) Version/3.2.3 ChromePlus/4.0.222.3 Chrome/4.0.222.3 Safari/525.28.3', array(
- array('CH', 'Chrome', 'Chrome', '3.2', '3', '2', 'webkit'),
- array('WXP', 'Windows XP', 'Win XP'))),
-
- // CometBird
- array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.0.5) Gecko/2009011615 Firefox/3.0.5 CometBird/3.0.5', array(
- array('CO', 'CometBird', 'CometBird', '3.0', '3', '0', 'gecko'),
- array('WXP', 'Windows XP', 'Win XP'))),
-
- // Crazy Browser (treat as IE)
- array('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; InfoPath.2; .NET CLR 2.0.50727; .NET CLR 1.1.4322; Crazy Browser 3.0.0 Beta2)', array(
- array('IE', 'Internet Explorer', 'IE', '7.0', '7', '0', 'ie'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Avant Browser; .NET CLR 2.0.50727; .NET CLR 3.0.04506.590; .NET CLR 3.5.20706; Crazy Browser 2.0.1)', array(
- array('IE', 'Internet Explorer', 'IE', '7.0', '7', '0', 'ie'),
- array('WXP', 'Windows XP', 'Win XP'))),
-
- // Dillo
- array('Dillo/2.0', array(
- array('DI', 'Dillo', 'Dillo', '2.0', '2', '0', 'unknown'),
- false)),
- array('Dillo/0.6.4', array(
- array('DI', 'Dillo', 'Dillo', '0.6', '0', '6', 'unknown'),
- false)),
-
- // Dolfin (or Dolphin, depending on which Samsung documentation you read); and yes, it's "bada" (lower-case)
- array('Mozilla/5.0 (SAMSUNG; SAMSUNG-GT-S5250/S5250AIJI3; U; Bada/1.0; it-it) AppleWebKit/533.1 (KHTML, like Gecko) Dolfin/2.0 Mobile WQVGA SMM-MMS/1.2.0 NexPlayer/3.0 profile/MIDP-2.1 configuration/CLDC-1.1 OPN-B', array(
- array('DF', 'Dolfin', 'Dolfin', '2.0', '2', '0', 'webkit'),
- array('SBA', 'bada', 'bada'))),
- array('Mozilla/5.0 (SAMSUNG; SAMSUNG-GT-S8530/S8530XXJKA; U; Bada/1.2; en-us) AppleWebKit/533.1 (KHTML, like Gecko) Dolfin/2.2 Mobile WVGA SMM-MMS/1.2.0 OPN-B', array(
- array('DF', 'Dolfin', 'Dolfin', '2.2', '2', '2', 'webkit'),
- array('SBA', 'bada', 'bada'))),
-
- // ELinks
- array('ELinks/0.12~pre2.dfsg0-1ubuntu1-lite (textmode; Debian; Linux 2.6.32-4-jolicloud i686; 143x37-2)', array(
- array('EL', 'ELinks', 'ELinks', '0.12', '0', '12', 'unknown'),
- array('LIN', 'Linux', 'Linux'))),
- array('ELinks/0.12pre5.GIT (textmode; CYGWIN_NT-6.1 1.7.1(0.218/5/3) i686; 80x24-2)', array(
- array('EL', 'ELinks', 'ELinks', '0.12', '0', '12', 'unknown'),
- array('WI7', 'Windows 7', 'Win 7'))),
- array('ELinks (0.4.3; NetBSD 3.0.2_PATCH sparc64; 141x19)', array(
- array('EL', 'ELinks', 'ELinks', '0.4', '0', '4', 'unknown'),
- array('NBS', 'NetBSD', 'NetBSD'))),
-
- // Epiphany
- array('Mozilla/5.0 (X11; U; Linux i686; en-us) AppleWebKit/531.2+ (KHTML, like Gecko) Safari/531.2+ Epiphany/2.29.5', array(
- array('EP', 'Epiphany', 'Epiphany', '2.29', '2', '29', 'webkit'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (X11; U; Linux i686; en; rv:1.9.0.11) Gecko/20080528 Epiphany/2.22 Firefox/3.0', array(
- // technically, this should be 'gecko' but UserAgentParser only supports one browserType (family) per browser
- array('EP', 'Epiphany', 'Epiphany', '2.22', '2', '22', 'webkit'),
- array('LIN', 'Linux', 'Linux'))),
-
- // Fennec
- array('Mozilla/5.0 (Android; Linux armv7l; rv:2.0.1) Gecko/20100101 Firefox/4.0.1 Fennec/2.0.1', array(
- array('FE', 'Fennec', 'Fennec', '2.0', '2', '0', 'gecko'),
- array('AND', 'Android', 'Android'))),
- array('Mozilla/5.0 (Maemo; Linux armv7l; rv2.0.1) Gecko/20100101 Firefox/4.0.1 Fennec/2.0.1', array(
- array('FE', 'Fennec', 'Fennec', '2.0', '2', '0', 'gecko'),
- array('MAE', 'Maemo', 'Maemo'))),
- array('Mozilla/5.0 (X11; Linux i686; rv2.0.1) Gecko/20100101 Firefox/4.0.1 Fennec/2.0.1', array(
- array('FE', 'Fennec', 'Fennec', '2.0', '2', '0', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2a1pre) Gecko/20090626 Fennec/1.0b2', array(
- array('FE', 'Fennec', 'Fennec', '1.0', '1', '0', 'gecko'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (X11; U; Linux armv6l; en-US; rv:1.9.1b1pre) Gecko/20081005220218 Gecko/2008052201 Fennec/0.9pre', array(
- array('FE', 'Fennec', 'Fennec', '0.9', '0', '9', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (X11; U; Linux armv6l; en-US; rv:1.9.1a1pre) Gecko/2008071707 Fennec/0.5', array(
- array('FE', 'Fennec', 'Fennec', '0.5', '0', '5', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
-
- // Firefox (formerly Firebird, formerly Phoenix; and rebranded versions)
- array('Mozilla/5.0 (X11; Linux i686; rv:5.0a2) Gecko/20110413 Firefox/5.0a2', array(
- array('FF', 'Firefox', 'Firefox', '5.0', '5', '0', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (Windows NT 6.1; rv:2.0.1) Gecko/20100101 Firefox/4.0.1', array(
- array('FF', 'Firefox', 'Firefox', '4.0', '4', '0', 'gecko'),
- array('WI7', 'Windows 7', 'Win 7'))),
- array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:2.0a1pre) Gecko/2008060602 Minefield/4.0a1pre', array(
- array('FF', 'Firefox', 'Firefox', '4.0', '4', '0', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:2.0a1pre) Gecko/2008060602 Minefield/4.0a1p', array(
- array('FF', 'Firefox', 'Firefox', '4.0', '4', '0', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2a2pre) Gecko/20090826 Namoroka/3.6a2pre', array(
- array('FF', 'Firefox', 'Firefox', '3.6', '3', '6', 'gecko'),
- array('WVI', 'Windows Vista', 'Win Vista'))),
- array('Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2) Gecko/20100119 Namoroka/3.6', array(
- array('FF', 'Firefox', 'Firefox', '3.6', '3', '6', 'gecko'),
- array('WI7', 'Windows 7', 'Win 7'))),
- array('Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1b4pre) Gecko/20090420 Shiretoko/3.5b4pre (.NET CLR 3.5.30729)', array(
- array('FF', 'Firefox', 'Firefox', '3.5', '3', '5', 'gecko'),
- array('WI7', 'Windows 7', 'Win 7'))),
- array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.2) Gecko/20090803 Ubuntu/9.04 (jaunty) Shiretoko/3.5.2', array(
- array('FF', 'Firefox', 'Firefox', '3.5', '3', '5', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.9.0.6) Gecko/2009011913 Firefox/3.0.6', array(
- array('FF', 'Firefox', 'Firefox', '3.0', '3', '0', 'gecko'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9a7) Gecko/2007080210 GranParadiso/3.0a7', array(
- array('FF', 'Firefox', 'Firefox', '3.0', '3', '0', 'gecko'),
- array('WVI', 'Windows Vista', 'Win Vista'))),
- array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.1) Gecko/2008072716 IceCat/3.0.1-g1', array(
- array('FF', 'Firefox', 'Firefox', '3.0', '3', '0', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.0.1) Gecko/2008071420 Iceweasel/3.0.1 (Debian-3.0.1-1)', array(
- array('FF', 'Firefox', 'Firefox', '3.0', '3', '0', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1b2) Gecko/20060821 BonEcho/2.0b2', array(
- array('FF', 'Firefox', 'Firefox', '2.0', '2', '0', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (X11; U; Darwin Power Macintosh; en-US; rv:1.8.0.12) Gecko/20070803 Firefox/1.5.0.12 Fink Community Edition', array(
- array('FF', 'Firefox', 'Firefox', '1.5', '1', '5', 'gecko'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6b) Gecko/20031212 Firebird/0.7+', array(
- array('FB', 'Firebird', 'Firebird', '0.7', '0', '7', 'gecko'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/5.0 (Windows; U; Win98; de-DE; rv:1.4b) Gecko/20030516 Mozilla Firebird/0.6', array(
- array('FB', 'Firebird', 'Firebird', '0.6', '0', '6', 'gecko'),
- array('W98', 'Windows 98', 'Win 98'))),
- array('Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.3a) Gecko/20021207 Phoenix/0.5', array(
- array('PX', 'Phoenix', 'Phoenix', '0.5', '0', '5', 'gecko'),
- array('WNT', 'Windows NT', 'Win NT'))),
- array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.2b) Gecko/20020923 Phoenix/0.1', array(
- array('PX', 'Phoenix', 'Phoenix', '0.1', '0', '1', 'gecko'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/5.0 (Nintendo DS v4; U; M3 Adapter CF + PassMe2; en-US; rv:1.8.0.6 ) Gecko/20060728 Firefox/1.5.0.6 (firefox.gba.ds)', array(
- array('FF', 'Firefox', 'Firefox', '1.5', '1', '5', 'gecko'),
- array('NDS', 'Nintendo DS', 'DS'))),
- array('Mozilla/5.0 (Android; Mobile; rv:15.0) Gecko/15.0 Firefox/15.0a1', array(
- array('FF', 'Firefox', 'Firefox', '15.0', '15', '0', 'gecko'),
- array('AND', 'Android', 'Android'))),
-
- // Flock
- array('Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Flock/3.0.0.3737 Chrome/4.1.249.1071 Safari/532.5', array(
- array('FL', 'Flock', 'Flock', '3.0', '3', '0', 'webkit'),
- array('WI7', 'Windows 7', 'Win 7'))),
- // pre-3.0 is actually gecko
- array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.7) Gecko/20091221 Firefox/3.5.7 Flock/2.5.6 (.NET CLR 3.5.30729)', array(
- array('FL', 'Flock', 'Flock', '2.5', '2', '5', 'webkit'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.7) Gecko/20091221 AppleWebKit/531.21.8 KHTML/4.3.5 (like Gecko) Firefox/3.5.7 Flock/2.5.6 (.NET CLR 3.5.30729)', array(
- array('FL', 'Flock', 'Flock', '2.5', '2', '5', 'webkit'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.1.7) Gecko/20091221 AppleWebKit/531.21.8 (KHTML, like Gecko) Firefox/3.5.7 Flock/2.5.6 (.NET CLR 3.5.30729)', array(
- array('FL', 'Flock', 'Flock', '2.5', '2', '5', 'webkit'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.9) Gecko/20071106 Firefox/2.0.0.9 Flock/1.0.1', array(
- array('FL', 'Flock', 'Flock', '1.0', '1', '0', 'webkit'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8.1.8) Gecko/20071101 Firefox/2.0.0.8 Flock/1.0', array(
- array('FL', 'Flock', 'Flock', '1.0', '1', '0', 'webkit'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.8b5) Gecko/20051021 Flock/0.4 Firefox/1.0+', array(
- array('FL', 'Flock', 'Flock', '0.4', '0', '4', 'webkit'),
- array('MAC', 'Mac OS', 'Mac OS'))),
-
- // Fluid
- array('Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_1; nl-nl) AppleWebKit/532.3+ (KHTML, like Gecko) Fluid/0.9.6 Safari/532.3+', array(
- array('FD', 'Fluid', 'Fluid', '0.9', '0', '9', 'webkit'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Fluid/0.9.4 Safari/525.13', array(
- array('FD', 'Fluid', 'Fluid', '0.9', '0', '9', 'webkit'),
- array('WXP', 'Windows XP', 'Win XP'))),
-
- // Galeon
- array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.8) Gecko/20090327 Galeon/2.0.7', array(
- array('GA', 'Galeon', 'Galeon', '2.0', '2', '0', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (X11; U; OpenBSD i386; en-US; rv:1.8.1.19) Gecko/20090701 Galeon/2.0.7', array(
- array('GA', 'Galeon', 'Galeon', '2.0', '2', '0', 'gecko'),
- array('OBS', 'OpenBSD', 'OpenBSD'))),
- array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.19) Gecko/20081216 Galeon/2.0.4 Firefox/2.0.0.19', array(
- array('GA', 'Galeon', 'Galeon', '2.0', '2', '0', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.13pre) Gecko/20080207 Galeon/2.0.1 (Ubuntu package 2.0.1-1ubuntu2) Firefox/1.5.0.13pre', array(
- array('GA', 'Galeon', 'Galeon', '2.0', '2', '0', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.6) Gecko/20040406 Galeon/1.3.15', array(
- array('GA', 'Galeon', 'Galeon', '1.3', '1', '3', 'gecko'),
- array('BSD', 'FreeBSD', 'FreeBSD'))),
- array('Mozilla/5.0 Galeon/1.2.9 (X11; Linux i686; U;) Gecko/20021213 Debian/1.2.9-0.bunk', array(
- array('GA', 'Galeon', 'Galeon', '1.2', '1', '2', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 Galeon/1.0.3 (X11; Linux i686; U;) Gecko/0', array(
- array('GA', 'Galeon', 'Galeon', '1.0', '1', '0', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
-
- // Google Earth embedded browser
- array('Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/532.4 (KHTML, like Gecko) Google Earth/5.2.1.1329 Safari/532.4', array(
- array('GE', 'Google Earth', 'Google Earth', '5.2', '5', '2', 'webkit'),
- array('WI7', 'Windows 7', 'Win 7'))),
-
- // GreenBrowser (treat as IE)
- array('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.0.04506; Media Center PC 5.0; .NET CLR 3.5.21022; GreenBrowser)', array(
- array('IE', 'Internet Explorer', 'IE', '6.0', '6', '0', 'ie'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/4.0; SLCC1; .NET CLR 2.0.50727; .NET CLR 3.5.30729; InfoPath.2; .NET CLR 3.0.30729; GreenBrowser)', array(
- array('IE', 'Internet Explorer', 'IE', '8.0', '8', '0', 'ie'),
- array('WVI', 'Windows Vista', 'Win Vista'))),
-
- // Hana
- array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/418.9 (KHTML, like Gecko) Hana/1.1', array(
- array('HA', 'Hana', 'Hana', '1.1', '1', '1', 'webkit'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/417.9 (KHTML, like Gecko) Hana/1.0', array(
- array('HA', 'Hana', 'Hana', '1.0', '1', '0', 'webkit'),
- array('MAC', 'Mac OS', 'Mac OS'))),
-
- // HotJava
- array('HotJava/1.1.2 FCS', array(
- array('HJ', 'HotJava', 'HotJava', '1.1', '1', '1', 'unknown'),
- false)),
- array('HotJava/1.0.1/JRE1.1.x', array(
- array('HJ', 'HotJava', 'HotJava', '1.0', '1', '0', 'unknown'),
- false)),
-
- // iBrowse
- array('Mozilla/5.0 (compatible; IBrowse 3.0; AmigaOS4.0)', array(
- array('IB', 'IBrowse', 'IBrowse', '3.0', '3', '0', 'unknown'),
- array('AMI', 'AmigaOS', 'AmigaOS'))),
- array('Mozilla/4.0 (compatible; IBrowse 2.3; AmigaOS4.0)', array(
- array('IB', 'IBrowse', 'IBrowse', '2.3', '2', '3', 'unknown'),
- array('AMI', 'AmigaOS', 'AmigaOS'))),
- array('IBrowse/2.4 (AmigaOS 3.9; 68K)', array(
- array('IB', 'IBrowse', 'IBrowse', '2.4', '2', '4', 'unknown'),
- array('AMI', 'AmigaOS', 'AmigaOS'))),
- array('IBrowse/2.3 (AmigaOS V51)', array(
- array('IB', 'IBrowse', 'IBrowse', '2.3', '2', '3', 'unknown'),
- array('AMI', 'AmigaOS', 'AmigaOS'))),
- array('IBrowse/2.3 (AmigaOS 4.0)', array(
- array('IB', 'IBrowse', 'IBrowse', '2.3', '2', '3', 'unknown'),
- array('AMI', 'AmigaOS', 'AmigaOS'))),
-
- // iCab
- array('iCab/4.5 (Macintosh; U; PPC Mac OS X)', array(
- array('IC', 'iCab', 'iCab', '4.5', '4', '5', 'unknown'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('iCab/4.5 (Macintosh; U; Mac OS X Leopard 10.5.7)', array(
- array('IC', 'iCab', 'iCab', '4.5', '4', '5', 'unknown'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (compatible; iCab 3.0.5; Macintosh; U; PPC Mac OS)', array(
- array('IC', 'iCab', 'iCab', '3.0', '3', '0', 'unknown'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (compatible; iCab 3.0.5; Macintosh; U; PPC Mac OS X)', array(
- array('IC', 'iCab', 'iCab', '3.0', '3', '0', 'unknown'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (Macintosh; U; PPC Mac OS; en) iCab 3', array(
- array('IC', 'iCab', 'iCab', '3.0', '3', '0', 'unknown'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/4.5 (compatible; iCab 2.7.1; Macintosh; I; PPC)', array(
- array('IC', 'iCab', 'iCab', '2.7', '2', '7', 'unknown'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('iCab/2.9.8 (Macintosh; U; 68K)', array(
- array('IC', 'iCab', 'iCab', '2.9', '2', '9', 'unknown'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Lynx/2.8 (compatible; iCab 2.9.8; Macintosh; U; 68K)', array(
- array('IC', 'iCab', 'iCab', '2.9', '2', '9', 'unknown'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/4/5 (compatible; iCab 2.9.8; Macintosh; U; 68K)', array(
- array('IC', 'iCab', 'iCab', '2.9', '2', '9', 'unknown'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/4.0 (compatible; MSIE 5.0; Mac_PowerPC)', array(
- array('IE', 'Internet Explorer', 'IE', '5.0', '5', '0', 'ie'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/4.76 (Macintosh; I; PPC)', array(
- array('NS', 'Netscape', 'Netscape', '4.76', '4', '76', 'gecko'),
- array('MAC', 'Mac OS', 'Mac OS'))),
-
- // Internet Explorer
- array('Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0; Xbox)', array(
- array('IE', 'Internet Explorer', 'IE', '9.0', '9', '0', 'ie'),
- array('XBX', 'Xbox', 'Xbox'))),
- array('Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0; Xbox)', array(
- array('IE', 'Internet Explorer', 'IE', '9.0', '9', '0', 'ie'),
- array('XBX', 'Xbox', 'Xbox'))),
- array('Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Win64; x64; Trident/6.0)', array(
- array('IE', 'Internet Explorer', 'IE', '10.0', '10', '0', 'ie'),
- array('WI8', 'Windows 8', 'Win 8'))),
- array('Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.1; Trident/6.0)', array(
- array('IE', 'Internet Explorer', 'IE', '10.0', '10', '0', 'ie'),
- array('WI7', 'Windows 7', 'Win 7'))),
- array('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; Trident/6.0)', array(
- array('IE', 'Internet Explorer', 'IE', '10.0', '10', '0', 'ie'),
- array('WI7', 'Windows 7', 'Win 7'))),
- array('Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)', array(
- array('IE', 'Internet Explorer', 'IE', '9.0', '9', '0', 'ie'),
- array('WI7', 'Windows 7', 'Win 7'))),
- array('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/5.0)', array(
- array('IE', 'Internet Explorer', 'IE', '9.0', '9', '0', 'ie'),
- array('WVI', 'Windows Vista', 'Win Vista'))),
- array('Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; .NET CLR 3.0.04506; .NET CLR 3.5.21022; InfoPath.2; SLCC1; Zune 3.0)', array(
- array('IE', 'Internet Explorer', 'IE', '8.0', '8', '0', 'ie'),
- array('WI7', 'Windows 7', 'Win 7'))),
- array('Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0)', array(
- array('IE', 'Internet Explorer', 'IE', '8.0', '8', '0', 'ie'),
- array('WVI', 'Windows Vista', 'Win Vista'))),
- array('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0; Trident/4.0)', array(
- array('IE', 'Internet Explorer', 'IE', '8.0', '8', '0', 'ie'),
- array('WVI', 'Windows Vista', 'Win Vista'))),
- array('Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)', array(
- array('IE', 'Internet Explorer', 'IE', '8.0', '8', '0', 'ie'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648)', array(
- array('IE', 'Internet Explorer', 'IE', '6.0', '6', '0', 'ie'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)', array(
- array('IE', 'Internet Explorer', 'IE', '6.0', '6', '0', 'ie'),
- array('WS3', 'Windows Server 2003 / XP x64', 'Win S2003'))),
- array('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; WOW64; SV1; .NET CLR 2.0.50727)', array(
- array('IE', 'Internet Explorer', 'IE', '6.0', '6', '0', 'ie'),
- array('WS3', 'Windows Server 2003 / XP x64', 'Win S2003'))),
- array('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.2; Win64; x64; SV1; .NET CLR 2.0.50727)', array(
- array('IE', 'Internet Explorer', 'IE', '6.0', '6', '0', 'ie'),
- array('WS3', 'Windows Server 2003 / XP x64', 'Win S2003'))),
-
- // IE Mobile
- array('Mozilla/5.0 (compatible; MSIE 9.0; Windows Phone OS 7.5; Trident/5.0; IEMobile/9.0; SAMSUNG; SGH-i917)', array(
- array('IE', 'Internet Explorer', 'IE', '9.0', '9', '0', 'ie'),
- array('WPH', 'Windows Phone OS', 'WinPhone'))),
- array('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.1; XBLWP7; ZuneWP7)', array(
- array('IE', 'Internet Explorer', 'IE', '7.0', '7', '0', 'ie'),
- array('WPH', 'Windows Phone OS', 'WinPhone'))),
- array('Mozilla/4.0 (compatible; MSIE 7.0; Windows Phone OS 7.0; Trident/3.1; IEMobile/7.0; DeviceManufacturer; DeviceModel)', array(
- array('IE', 'Internet Explorer', 'IE', '7.0', '7', '0', 'ie'),
- array('WPH', 'Windows Phone OS', 'WinPhone'))),
- array('Mozilla/4.0 (compatible; MSIE 6.0; Windows CE; IEMobile 7.11)', array(
- array('IE', 'Internet Explorer', 'IE', '6.0', '6', '0', 'ie'),
- array('WMO', 'Windows Mobile', 'WinMo'))),
- array('Mozilla/4.0 (compatible; MSIE 4.01; Windows CE; PPC; 240x320)', array(
- array('IE', 'Internet Explorer', 'IE', '4.01', '4', '01', 'ie'),
- array('WCE', 'Windows CE', 'Win CE'))),
-
- // Internet Explorer with misbehaving Google Tool Bar
- array('Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB6.5; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)', array(
- array('IE', 'Internet Explorer', 'IE', '8.0', '8', '0', 'ie'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; GTB0.0; Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)', array(
- array('IE', 'Internet Explorer', 'IE', '8.0', '8', '0', 'ie'),
- array('WXP', 'Windows XP', 'Win XP'))),
-
- // Iron
- array('Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US) AppleWebKit/531.0 (KHTML, like Gecko) Iron/3.0.189.0 Safari/531.0', array(
- array('IR', 'Iron', 'Iron', '3.0', '3', '0', 'webkit'),
- array('WI7', 'Windows 7', 'Win 7'))),
-
- // K-Meleon
- array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.21) Gecko/20090331 K-Meleon/1.5.3', array(
- array('KM', 'K-Meleon', 'K-Meleon', '1.5', '1', '5', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (Darwin; FreeBSD 5.6; en-GB; rv:1.8.1.17pre) Gecko/20080716 K-Meleon/1.5.0', array(
- array('KM', 'K-Meleon', 'K-Meleon', '1.5', '1', '5', 'gecko'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.2b) Gecko/20021016 K-Meleon 0.7', array(
- array('KM', 'K-Meleon', 'K-Meleon', '0.7', '0', '7', 'gecko'),
- array('WNT', 'Windows NT', 'Win NT'))),
-
- // Kapiko
- array('Mozilla/5.0 (Windows; U; Windows NT 5.1; zh-CN; rv:1.9.0.1) Gecko/20080722 Firefox/3.0.1 Kapiko/3.0', array(
- array('KP', 'Kapiko', 'Kapiko', '3.0', '3', '0', 'gecko'),
- array('WXP', 'Windows XP', 'Win XP'))),
-
- // Kazehakase
- array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.11) Gecko Kazehakase/0.5.4 Debian/0.5.4-2.1ubuntu3', array(
- array('KZ', 'Kazehakase', 'Kazehakase', '0.5', '0', '5', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.13) Gecko/20080311 (Debian-1.8.1.13+nobinonly-0ubuntu1) Kazehakase/0.5.2', array(
- array('KZ', 'Kazehakase', 'Kazehakase', '0.5', '0', '5', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (X11; Linux x86_64; U;) Gecko/20060207 Kazehakase/0.3.5 Debian/0.3.5-1', array(
- array('KZ', 'Kazehakase', 'Kazehakase', '0.3', '0', '3', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
-
- // KKMAN (treat as IE)
- array('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; KKMAN3.2)', array(
- array('IE', 'Internet Explorer', 'IE', '7.0', '7', '0', 'ie'),
- array('WXP', 'Windows XP', 'Win XP'))),
-
- // Konqueror
- array('Mozilla/5.0 (compatible; Konqueror/4.0; Linux) KHTML/4.0.5 (like Gecko)', array(
- array('KO', 'Konqueror', 'Konqueror', '4.0', '4', '0', 'khtml'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (compatible; Konqueror/4.0; Microsoft Windows) KHTML/4.0.80 (like Gecko)', array(
- array('KO', 'Konqueror', 'Konqueror', '4.0', '4', '0', 'khtml'),
- false)),
- array('Mozilla/5.0 (compatible; Konqueror/3.5; GNU/kFreeBSD) KHTML/3.5.9 (like Gecko) (Debian)', array(
- array('KO', 'Konqueror', 'Konqueror', '3.5', '3', '5', 'khtml'),
- array('BSD', 'FreeBSD', 'FreeBSD'))),
- array('Mozilla/5.0 (compatible; Konqueror/2.1.1; X11)', array(
- array('KO', 'Konqueror', 'Konqueror', '2.1', '2', '1', 'khtml'),
- false)),
-
- // Links
- array('Links', array(
- false,
- false)),
- array('Links (2.1pre31; Linux 2.6.21-omap1 armv6l; x)', array(
- array('LI', 'Links', 'Links', '2.1', '2', '1', 'unknown'),
- array('LIN', 'Linux', 'Linux'))),
- array('Links (0.99; OS/2 1 i386; 80x33)', array(
- array('LI', 'Links', 'Links', '0.99', '0', '99', 'unknown'),
- array('OS2', 'OS/2', 'OS/2'))),
-
- // Lunascape (identity crisis)
- array('Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.1) Gecko/20090701 Firefox/3.5 Lunascape/5.1.2.3', array(
- array('FF', 'Firefox', 'Firefox', '3.5', '3', '5', 'gecko'),
- array('WVI', 'Windows Vista', 'Win Vista'))),
- array('Mozilla/5.0 (Windows; U; ; cs-CZ) AppleWebKit/532+ (KHTML, like Gecko, Safari/532.0) Lunascape/5.1.2.3', array(
- array('SF', 'Safari', 'Safari', '4.0', '4', '0', 'webkit'),
- false)),
- array('Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1) ; InfoPath.1; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Lunascape 5.1.2.3)', array(
- array('IE', 'Internet Explorer', 'IE', '6.0', '6', '0', 'ie'),
- array('WXP', 'Windows XP', 'Win XP'))),
-
- // Lynx
- array('Lynx (textmode)', array(
- false,
- false)),
- array('Lynx/2.8.7dev.9 libwww-FM/2.14', array(
- array('LX', 'Lynx', 'Lynx', '2.8', '2', '8', 'unknown'),
- false)),
-
- // Maxathon (treat as IE)
- array('Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; SV1; Maxthon; .NET CLR 1.1.4322)', array(
- array('IE', 'Internet Explorer', 'IE', '7.0', '7', '0', 'ie'),
- array('WXP', 'Windows XP', 'Win XP'))),
-
- // Midori
- array('Midori/0.1.9 (X11; Linux i686; U; fr-fr) WebKit/532+', array(
- array('MI', 'Midori', 'Midori', '0.1', '0', '1', 'webkit'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (X11; U; Linux; pt-br) AppleWebKit/531+ (KHTML, like Gecko) Safari/531.2+ Midori/0.3', array(
- array('MI', 'Midori', 'Midori', '0.3', '0', '3', 'webkit'),
- array('LIN', 'Linux', 'Linux'))),
-
- // Mozilla Suite
- array('Mozilla/5.0 (X11; U; SunOS sun4u; en-US; rv:1.7) Gecko/20070606', array(
- array('MO', 'Mozilla', 'Mozilla', '1.7', '1', '7', 'gecko'),
- array('SOS', 'SunOS', 'SunOS'))),
- array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.8) Gecko/20050927 Debian/1.7.8-1sarge3', array(
- array('MO', 'Mozilla', 'Mozilla', '1.7', '1', '7', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
-
- // NCSA Mosaic
- array('PATHWORKS Mosaic/1.0 libwww/2.15_Spyglass', array(
- array('MC', 'NCSA Mosaic', 'Mosaic', '1.0', '1', '0', 'unknown'),
- false)),
- array('WinMosaic/Version 2.0 (ALPHA 2)', array(
- array('MC', 'NCSA Mosaic', 'Mosaic', '2.0', '2', '0', 'unknown'),
- false)),
- array('VMS_Mosaic/3.8-1 (Motif;OpenVMS V7.3-2 DEC 3000 - M700) libwww/2.12_Mosaic', array(
- array('MC', 'NCSA Mosaic', 'Mosaic', '3.8', '3', '8', 'unknown'),
- array('VMS', 'OpenVMS', 'OpenVMS'))),
- array('Mosaic from Digital/1.02_Win32', array(
- array('MC', 'NCSA Mosaic', 'Mosaic', '1.02', '1', '02', 'unknown'),
- array('W95', 'Windows 95', 'Win 95'))),
- array('NCSA Mosaic/2.0.0b4 (Windows AXP)', array(
- array('MC', 'NCSA Mosaic', 'Mosaic', '2.0', '2', '0', 'unknown'),
- false)),
- array('NCSA_Mosaic/2.7b5 (X11;Linux 2.6.7 i686) libwww/2.12 modified', array(
- array('MC', 'NCSA Mosaic', 'Mosaic', '2.7', '2', '7', 'unknown'),
- array('LIN', 'Linux', 'Linux'))),
- array('mMosaic/3.6.6 (X11;SunOS 5.8 sun4m)', array(
- array('MC', 'NCSA Mosaic', 'Mosaic', '3.6', '3', '6', 'unknown'),
- array('SOS', 'SunOS', 'SunOS'))),
-
- // Netscape Navigator (9.x)
- array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.8pre) Gecko/20071015 Firefox/2.0.0.7 Navigator/9.0', array(
- array('NS', 'Netscape', 'Netscape', '9.0', '9', '0', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20070321 Netscape/9.0', array(
- array('NS', 'Netscape', 'Netscape', '9.0', '9', '0', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
-
- // Netscape (6.x - 8.x)
- array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20070321 Netscape/8.1.3', array(
- array('NS', 'Netscape', 'Netscape', '8.1', '8', '1', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.2) Gecko/20040804 Netscape/7.2 (ax)', array(
- array('NS', 'Netscape', 'Netscape', '7.2', '7', '2', 'gecko'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/5.0 (X11; U; OSF1 alpha; en-US; rv:0.9.4.1) Gecko/20020517 Netscape6/6.2.3', array(
- array('NS', 'Netscape', 'Netscape', '6.2', '6', '2', 'gecko'),
- array('T64', 'Tru64', 'Tru64'))),
- array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.2) Gecko/20010726 Netscape6/6.1', array(
- array('NS', 'Netscape', 'Netscape', '6.1', '6', '1', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
-
- // Netscape Communicator (4.x)
- array('Mozilla/4.76C-SGI [en] (X11; I; IRIX64 6.5 IP30)', array(
- array('NS', 'Netscape', 'Netscape', '4.76', '4', '76', 'gecko'),
- array('IRI', 'IRIX', 'IRIX'))),
- array('Mozilla/4.72 [en] (X11; I; HP-UX B.11.00 9000/800)', array(
- array('NS', 'Netscape', 'Netscape', '4.72', '4', '72', 'gecko'),
- array('HPX', 'HP-UX', 'HP-UX'))),
- array('Mozilla/4.41 (BEOS; U ;Nav)', array(
- array('NS', 'Netscape', 'Netscape', '4.41', '4', '41', 'gecko'),
- array('BEO', 'BeOS', 'BeOS'))),
- array('Mozilla/4.0 (compatible; Windows NT 5.1; U; en)', array(
- array('NS', 'Netscape', 'Netscape', '4.0', '4', '0', 'gecko'),
- array('WXP', 'Windows XP', 'Win XP'))),
-
- // Netscape Navigator (up to 3.x)
- array('Mozilla/3.0 (X11; I; AIX 2)', array(
- array('NS', 'Netscape', 'Netscape', '3.0', '3', '0', 'gecko'),
- array('AIX', 'AIX', 'AIX'))),
- array('Mozilla/2.02 [fr] (WinNT; I)', array(
- array('NS', 'Netscape', 'Netscape', '2.02', '2', '02', 'gecko'),
- array('WNT', 'Windows NT', 'Win NT'))),
-
- // NetFront NX
- array('Mozilla/5.0 (Nintendo WiiU) AppleWebKit/534.52 (KHTML, like Gecko) NX/2.1.0.8.21 NintendoBrowser/1.0.0.7494.US', array(
- array('NF', 'NetFront', 'NetFront', '2.1', '2', '1', 'webkit'),
- array('WIU', 'Nintendo Wii U', 'Wii U'))),
- array('Mozilla/5.0 (Nintendo 3DS; U; ; en) Version/1.7498.US', array(
- array('NF', 'NetFront', 'NetFront', '1.7498', '1', '7498', 'webkit'),
- array('3DS', 'Nintendo 3DS', '3DS'))),
- array('Mozilla/5.0 (Playstation Vita 1.61) AppleWebKit/531.22.8 (KHTML, like Gecko) Silk/3.2', array(
- array('NF', 'NetFront', 'NetFront', '3.2', '3', '2', 'webkit'),
- array('PSV', 'PlayStation Vita', 'PS Vita'))),
-
- // Kindle
- array('Mozilla/4.0 (compatible; Linux 2.6.10) NetFront/3.3 Kindle/1.0 (screen 600x800)', array(
- array('NF', 'NetFront', 'NetFront', '3.3', '3', '3', 'webkit'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (Linux; U; Android 2.3.4; en-us; Kindle Fire Build/GINGERBREAD) AppleWebKit/533.1 (KHTML, like Gecko) Version/4.0 Mobile Safari/533.1', array(
- array('SF', 'Safari', 'Safari', '4.0', '4', '0', 'webkit'),
- array('AND', 'Android', 'Android'))),
- array('Mozilla/5.0 (Linux; U; en-US) AppleWebKit/528.5+ (KHTML, like Gecko, Safari/528.5+) Version/4.0 Kindle/3.0 (screen 600×800; rotate)', array(
- array('SF', 'Safari', 'Safari', '4.0', '4', '0', 'webkit'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-us; Silk/1.1.0-80) AppleWebKit/533.16 (KHTML, like Gecko) Version/5.0 Safari/533.16 Silk-Accelerated=true', array(
- array('SF', 'Safari', 'Safari', '5.0', '5', '0', 'webkit'),
- array('MAC', 'Mac OS', 'Mac OS'))),
-
- // Omniweb
- array('Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US) AppleWebKit/525.18 (KHTML, like Gecko, Safari/525.20) OmniWeb/v622.3.0.105198', array(
- array('OW', 'OmniWeb', 'OmniWeb', '5.8', '5', '8', 'webkit'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/522+ (KHTML, like Gecko, Safari/522) OmniWeb/v613', array(
- array('OW', 'OmniWeb', 'OmniWeb', '5.6', '5', '6', 'webkit'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/420+ (KHTML, like Gecko, Safari/420) OmniWeb/v607', array(
- array('OW', 'OmniWeb', 'OmniWeb', '5.5', '5', '5', 'webkit'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/125.4 (KHTML, like Gecko, Safari) OmniWeb/v563.34', array(
- array('OW', 'OmniWeb', 'OmniWeb', '5.1', '5', '1', 'webkit'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/85 (KHTML, like Gecko) OmniWeb/v558.36', array(
- array('OW', 'OmniWeb', 'OmniWeb', '5.0', '5', '0', 'webkit'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en-US) AppleWebKit/85 (KHTML, like Gecko) OmniWeb/v496', array(
- array('OW', 'OmniWeb', 'OmniWeb', '4.5', '4', '5', 'webkit'),
- array('MAC', 'Mac OS', 'Mac OS'))),
-
- // Opera
- array('Opera/9.63 (Windows NT 5.1; U; en) Presto/2.1.1', array(
- array('OP', 'Opera', 'Opera', '9.63', '9', '63', 'opera'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Opera/9.30 (Nintendo Wii; U; ; 2047-7; en)', array(
- array('OP', 'Opera', 'Opera', '9.30', '9', '30', 'opera'),
- array('WII', 'Nintendo Wii', 'Wii'))),
- array('Opera/9.64 (Windows ME; U; en) Presto/2.1.1', array(
- array('OP', 'Opera', 'Opera', '9.64', '9', '64', 'opera'),
- array('WME', 'Windows Me', 'Win Me'))),
- array('Opera/9.80 (Windows NT 5.1; U; en) Presto/2.2.15 Version/10.00', array(
- array('OP', 'Opera', 'Opera', '10.00', '10', '0', 'opera'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/4.0 (compatible; MSIE 6.0; Nitro) Opera 8.50 [en Mozilla/4.0 (compatible; MSIE 6.0; Nitro) Opera 8.50 [ja]', array(
- array('OP', 'Opera', 'Opera', '8.50', '8', '50', 'opera'),
- array('NDS', 'Nintendo DS', 'DS'))),
- array('Opera/9.00 (Nintendo DS U; ; 1309-9; de)', array(
- array('OP', 'Opera', 'Opera', '9.00', '9', '00', 'opera'),
- array('NDS', 'Nintendo DS', 'DS'))),
- array('Opera/9.50 (Nintendo DSi; Opera/507; U; en-US) ', array(
- array('OP', 'Opera', 'Opera', '9.50', '9', '50', 'opera'),
- array('DSI', 'Nintendo DSi', 'DSi'))),
-
- // PlayStation
- array('Mozilla/5.0 (PLAYSTATION 3; 1.00)', array(
- false,
- array('PS3', 'PlayStation 3', 'PS3'))),
-
- // PSP
- array('PSP (PlayStation Portable); 2.00', array(
- false,
- array('PSP', 'PlayStation Portable', 'PSP'))),
- array('Mozilla/4.0 (PSP (PlayStation Portable); 2.00)', array(
- false,
- array('PSP', 'PlayStation Portable', 'PSP'))),
-
- // Rekonq 1.0+
- array('Mozilla/5.0 (X11; Linux i686) AppleWebKit/534.34 (KHTML, like Gecko) rekonq/1.0 Safari/534.34', array(
- array('RK', 'Rekonq', 'Rekonq', '1.0', '1', '0', 'webkit'),
- array('LIN', 'Linux', 'Linux'))),
-
- // Safari
- array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.19 (KHTML, like Gecko) Version/3.1.2 Safari/525.21', array(
- array('SF', 'Safari', 'Safari', '3.1', '3', '1', 'webkit'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/5.0 (iPhone; U; CPU iPhone OS 2_2 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5G77 Safari/525.20', array(
- array('SF', 'Safari', 'Safari', '3.1', '3', '1', 'webkit'),
- array('IPH', 'iPhone', 'iPhone'))),
- array('Mozilla/5.0 (iPod; U; CPU like Mac OS X; en) AppleWebKit/420.1 (KHTML, like Gecko) Version/3.0 Mobile/3A100a Safari/419.3', array(
- array('SF', 'Safari', 'Safari', '3.0', '3', '0', 'webkit'),
- array('IPD', 'iPod', 'iPod'))),
- array('Mozilla/5.0 (iPod; U; CPU iPhone OS 2_2_1 like Mac OS X; en-us) AppleWebKit/525.18.1 (KHTML, like Gecko) Version/3.1.1 Mobile/5H11a Safari/525.20', array(
- array('SF', 'Safari', 'Safari', '3.1', '3', '1', 'webkit'),
- array('IPD', 'iPod', 'iPod'))),
- array('Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_5; en-us) AppleWebKit/527.3+ (KHTML, like Gecko) Version/3.1.2 Safari/525.20.1', array(
- array('SF', 'Safari', 'Safari', '3.1', '3', '1', 'webkit'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (iPad; U; CPU iPhone OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B314 Safari/531.21.10', array(
- array('SF', 'Safari', 'Safari', '4.0', '4', '0', 'webkit'),
- array('IPA', 'iPad', 'iPad'))),
- array('Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B367 Safari/531.21.10', array(
- array('SF', 'Safari', 'Safari', '4.0', '4', '0', 'webkit'),
- array('IPA', 'iPad', 'iPad'))),
- array('Mozilla/5.0 (iPod; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7', array(
- array('SF', 'Safari', 'Safari', '4.0', '4', '0', 'webkit'),
- array('IPD', 'iPod', 'iPod'))),
- array('Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_0 like Mac OS X; en-us) AppleWebKit/532.9 (KHTML, like Gecko) Version/4.0.5 Mobile/8A293 Safari/6531.22.7', array(
- array('SF', 'Safari', 'Safari', '4.0', '4', '0', 'webkit'),
- array('IPH', 'iPhone', 'iPhone'))),
- array('Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/533.19.4 (KHTML, like Gecko) ', array(
- array('SF', 'Safari', 'Safari', '5.0', '5', '0', 'webkit'),
- array('WVI', 'Windows Vista', 'Win Vista'))),
- array('Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/534.50 (KHTML, like Gecko) Version/5.1 Safari/534.50', array(
- array('SF', 'Safari', 'Safari', '5.1', '5', '1', 'webkit'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (iPhone; CPU iPhone OS 6_1 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Mobile/10B141', array(
- array('SF', 'Safari', 'Safari', '6.0', '6', '0', 'webkit'),
- array('IPH', 'iPhone', 'iPhone'))),
- array('Mozilla/5.0 (iPhone; CPU iPhone OS 6_1 like Mac OS X) AppleWebKit/536.26 (KHTML, like Gecko) Version/6.0 Mobile/10B141 Safari/8536.25', array(
- array('SF', 'Safari', 'Safari', '6.0', '6', '0', 'webkit'),
- array('IPH', 'iPhone', 'iPhone'))),
-
- // SeaMonkey (formerly Mozilla Suite and rebranded versions)
- array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.8) Gecko/20071008 Iceape/1.1.5 (Ubuntu-1.1.5-1ubuntu0.7.10)', array(
- array('SM', 'SeaMonkey', 'SeaMonkey', '1.1', '1', '1', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1b4pre) Gecko/20090405 SeaMonkey/2.0b1pre', array(
- array('SM', 'SeaMonkey', 'SeaMonkey', '2.0', '2', '0', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
- array('Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9) Gecko', array(
- // this pre-2.0 UA is missing the SeaMonkey/X.Y
- array('SM', 'SeaMonkey', 'SeaMonkey', '1.9', '1', '9', 'gecko'),
- array('WXP', 'Windows XP', 'Win XP'))),
- array('Mozilla/5.0 (Windows; U; Windows NT 5.1; cs; rv:1.9) Gecko/2008052906', array(
- // this pre-2.0 UA is missing the SeaMonkey/X.Y
- array('SM', 'SeaMonkey', 'SeaMonkey', '1.9', '1', '9', 'gecko'),
- array('WXP', 'Windows XP', 'Win XP'))),
-
- // Palm webOS
- array('Mozilla/5.0 (webOS/1.0; U; en-us) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/1.0 Safari/525.27.1 Pre/1.0', array(
- array('WO', 'Palm webOS', 'webOS', '1.0', '1', '0', 'webkit'),
- array('WOS', 'Palm webOS', 'webOS'))),
- array('Mozilla/5.0 (webOS/Palm webOS 1.2.9; U; en-US) AppleWebKit/525.27.1 (KHTML, like Gecko) Version/1.0 Safari/525.27.1 Pixi/1.0', array(
- array('WO', 'Palm webOS', 'webOS', '1.0', '1', '0', 'webkit'),
- array('WOS', 'Palm webOS', 'webOS'))),
- array('Mozilla/5.0 [en] (PalmOS; U; WebPro/3.5; Palm-Zi72)', array(
- array('WP', 'WebPro', 'WebPro', '3.5', '3', '5', 'unknown'),
- array('POS', 'Palm OS', 'Palm OS'))),
-
- // Palm WebPro
- array('Mozilla/4.76 [en] (PalmOS; U; WebPro/3.0.1a; Palm-Cct1)', array(
- array('WP', 'WebPro', 'WebPro', '3.0', '3', '0', 'unknown'),
- array('POS', 'Palm OS', 'Palm OS'))),
- array('Mozilla/4.76 [en] (PalmOS; U; WebPro/3.0; Palm-Arz1)', array(
- array('WP', 'WebPro', 'WebPro', '3.0', '3', '0', 'unknown'),
- array('POS', 'Palm OS', 'Palm OS'))),
-
- // Shiira 1.x - treat as Safari since it uses the installed version of Safari's WebKit
- array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/417.9 (KHTML, like Gecko, Safari) Shiira/1.1', array(
- array('SF', 'Safari', 'Safari', '2.0', '2', '0', 'webkit'),
- array('MAC', 'Mac OS', 'Mac OS'))),
- array('Mozilla/5.0 (Macintosh; U; PPC Mac OS X; pl-pl) AppleWebKit/312.8 (KHTML, like Gecko) Shiira/1.2.1 Safari/125', array(
- array('SF', 'Safari', 'Safari', '1.3', '1', '3', 'webkit'),
- array('MAC', 'Mac OS', 'Mac OS'))),
-
- // Shiira 2.x - ditto
- array('Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_5_7; en-us) AppleWebKit/525.28.3 (KHTML, like Gecko) Shiira Safari/125', array(
- array('SF', 'Safari', 'Safari', '3.2', '3', '2', 'webkit'),
- array('MAC', 'Mac OS', 'Mac OS'))),
-
- // SymbianOS
- array('Nokia3650/1.0 SymbianOS/6.1 Series60/1.2 Profile/MIDP-1.0 Configuration/CLDC-1.0', array(
- false,
- array('SYM', 'SymbianOS', 'SymbianOS'))),
- array('Mozilla/5.0 (SymbianOS/9.4; U; Series60/5.0 Nokia5800d-1b/20.2.014; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413', array(
- array('SF', 'Safari', 'Safari', '2.0', '2', '0', 'webkit'),
- array('SYM', 'SymbianOS', 'SymbianOS'))),
- array('Opera/9.80 (S60; SymbOS; Opera Mobi/499; U; en-GB) Presto/2.4.18 Version/10.00', array(
- array('OP', 'Opera', 'Opera', '10.00', '10', '00', 'opera'),
- array('SYM', 'SymbianOS', 'SymbianOS'))),
- array('SonyEricssonG700/R100 Mozilla/4.0 (compatible; MSIE 6.0; Symbian OS; 958) Opera 8.65 [ru]', array(
- array('OP', 'Opera', 'Opera', '8.65', '8', '65', 'opera'),
- array('SYM', 'SymbianOS', 'SymbianOS'))),
-
- // Appcelerator Titanium
- array('Appcelerator Titanium/1.8.0 (iPhone Simulator/4.3; iPhone OS; en_US;)', array(
- array('TI', 'Titanium', 'Titanium', '1.8', '1', '8', 'webkit'),
- array('IPH', 'iPhone', 'iPhone'))),
-
- array('Appcelerator Titanium/1.8.0 (iPod touch/4.3.1; iPhone OS; de_DE;)', array(
- array('TI', 'Titanium', 'Titanium', '1.8', '1', '8', 'webkit'),
- array('IPD', 'iPod', 'iPod'))),
-
- array('Appcelerator Titanium/1.8.0 (iPad/4.3.3; iPhone OS; de_DE;)', array(
- array('TI', 'Titanium', 'Titanium', '1.8', '1', '8', 'webkit'),
- array('IPA', 'iPad', 'iPad'))),
-
- array('Dalvik/1.1.0 (Linux; U; Android 2.1; google_sdk Build/ERD79) Titanium/1.8.0', array(
- array('TI', 'Titanium', 'Titanium', '1.8', '1', '8', 'webkit'),
- array('AND', 'Android', 'Android'))),
-
- array('Dalvik/1.4.0 (Linux; U; Android 2.3.3; GT-I9100 Build/GINGERBREAD) Titanium/1.8.0', array(
- array('TI', 'Titanium', 'Titanium', '1.8', '1', '8', 'webkit'),
- array('AND', 'Android', 'Android'))),
-
- array('Mozilla/5.0 (X11; U; CrOS i686 9.10.0; en-US) AppleWebKit/532.5 (KHTML, like Gecko) Chrome/4.0.253.0 Safari/532.5', array(
- array('CH', 'Chrome', 'Chrome', '4.0', '4', '0', 'webkit'),
- array('LIN', 'Linux', 'Linux'))),
-
- // Email Clients
-
- // Thunderbird
- array('Mozilla/5.0 (Windows NT 5.1; rv:14.0) Gecko/20120713 Thunderbird/14.0 Lightning/1.6', array(
- array('TB', 'Thunderbird', 'Thunderbird', '14.0', '14', '0', 'gecko'),
- array('WXP', 'Windows XP', 'Win XP'))),
-
- array('Mozilla/5.0 (X11; Linux i686; rv:16.0) Gecko/20121011 Thunderbird/16.0.1', array(
- array('TB', 'Thunderbird', 'Thunderbird', '16.0', '16', '0', 'gecko'),
- array('LIN', 'Linux', 'Linux'))),
-
- array('Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20130107 Thunderbird/17.0.2 Lightning/1.9', array(
- array('TB', 'Thunderbird', 'Thunderbird', '17.0', '17', '0', 'gecko'),
- array('WI7', 'Windows 7', 'Win 7'))),
-
- array('Mozilla/5.0 (X11; Linux i686 on x86_64; rv:15.0) Gecko/20120907 Thunderbird/15.0.1', array(
- array('TB', 'Thunderbird', 'Thunderbird', '15.0', '15', '0', 'gecko'),
- array('LIN', 'Linux', 'Linux')))
-
- );
- }
-
- /**
- * Test getBrowser()
- *
- * @dataProvider getUserAgents
- * @group Plugins
- */
- public function testGetBrowser($userAgent, $expected)
- {
- $res = UserAgentParser::getBrowser($userAgent);
- $family = false;
-
- if ($res === false)
- $this->assertFalse($expected[0]);
- else {
- $family = \Piwik\Plugins\UserSettings\getBrowserFamily($res['id']);
- $this->assertEquals($expected[0][0], $res['id']);
- $this->assertEquals($expected[0][1], $res['name']);
- $this->assertEquals($expected[0][2], $res['short_name']);
- $this->assertEquals($expected[0][3], $res['version']);
- $this->assertEquals($expected[0][4], $res['major_number']);
- $this->assertEquals($expected[0][5], $res['minor_number']);
- $this->assertEquals($expected[0][6], $family);
- }
- }
-
- /**
- * Test getOperatingSystem()
- *
- * @dataProvider getUserAgents
- * @group Plugins
- */
- public function testGetOperatingSystem($userAgent, $expected)
- {
- $res = UserAgentParser::getOperatingSystem($userAgent);
-
- $this->assertEquals($expected[1][0], $res['id']);
- $this->assertEquals($expected[1][1], $res['name']);
- $this->assertEquals($expected[1][2], $res['short_name']);
- }
-}