Download plugins/DeviceDetectorCache/DeviceDetector/CachedOperatingSystemParser.php from Leon4gr45/matomo: direct link, hf CLI and curl.
- Browser
- Download file 677 Bytes
-
https://huggingface.co/spaces/Leon4gr45/matomo/resolve/main/plugins/DeviceDetectorCache/DeviceDetector/CachedOperatingSystemParser.php
- Command line
-
hf download hf://spaces/Leon4gr45/matomo/plugins/DeviceDetectorCache/DeviceDetector/CachedOperatingSystemParser.php
-
curl -L -o CachedOperatingSystemParser.php https://huggingface.co/spaces/Leon4gr45/matomo/resolve/main/plugins/DeviceDetectorCache/DeviceDetector/CachedOperatingSystemParser.php
677 Bytes
| /** | |
| * Matomo - free/libre analytics platform | |
| * | |
| * @link https://matomo.org | |
| * @license http://www.gnu.org/licenses/gpl-3.0.html GPL v3 or later | |
| * | |
| */ | |
| namespace Piwik\Plugins\DeviceDetectorCache\DeviceDetector; | |
| use DeviceDetector\Parser\OperatingSystem; | |
| class CachedOperatingSystemParser extends OperatingSystem | |
| { | |
| protected $cachedUaResult = []; | |
| public function setCachedResult($result) | |
| { | |
| $this->cachedUaResult = $result; | |
| } | |
| protected function parseOsFromUserAgent(): array | |
| { | |
| if (!empty($this->cachedUaResult)) { | |
| return $this->cachedUaResult; | |
| } | |
| return parent::parseOsFromUserAgent(); | |
| } | |
| } | |