Skip to content

Commit

Permalink
UserAgentParserEnhanced is now required and used from it's own compos…
Browse files Browse the repository at this point in the history
…er package (piwik/device-detector); additionally Spyc library is required as composer package and removed from piwik source
  • Loading branch information
sgiehl committed Apr 3, 2014
1 parent 47cd0bb commit cde0263
Show file tree
Hide file tree
Showing 19 changed files with 56 additions and 27,004 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ tests/javascript/enable_sqlite
tests/javascript/unittest.dbf
tests/lib/geoip-files/*.dat*
tests/lib/xhprof*
tests/PHPUnit/Fixtures/userAgentParserEnhancedFixtures.yml.new
tests/PHPUnit/Integration/processed/
tests/PHPUnit/phpunit.xml
tests/results/
Expand Down
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
"twig/twig": "1.*",
"leafo/lessphp": "~0.3",
"symfony/console": ">=v2.3.5",
"tedivm/jshrink": "v0.5.1"
"tedivm/jshrink": "v0.5.1",
"mustangostang/spyc": "*",
"piwik/device-detector": "dev-master"
}
}
10 changes: 5 additions & 5 deletions libs/UserAgentParser/UserAgentParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -655,9 +655,9 @@ static public function getBrowserNameFromId($browserId)
if (isset(self::$browserIdToName[$browserId])) {
return self::$browserIdToName[$browserId];
}
if(class_exists('UserAgentParserEnhanced')) {
if( !empty(UserAgentParserEnhanced::$browsers[$browserId])) {
return UserAgentParserEnhanced::$browsers[$browserId];
if(class_exists('DeviceDetector')) {
if( !empty(DeviceDetector::$browsers[$browserId])) {
return DeviceDetector::$browsers[$browserId];
}
}
return false;
Expand Down Expand Up @@ -692,8 +692,8 @@ static public function getOperatingSystemNameFromId($osId)
return self::$operatingSystemsIdToName[$osId];
}

if(class_exists('UserAgentParserEnhanced')) {
return UserAgentParserEnhanced::getOsNameFromId($osId);
if(class_exists('DeviceDetector')) {
return DeviceDetector::getOsNameFromId($osId);
}
return false;
}
Expand Down
Loading

0 comments on commit cde0263

Please sign in to comment.