>browser->version = new Version([ 'value' => $match[1], 'details' => 3 ]); } } /* Nokia Xpress for S30+, S40 and Windows Phone */ if (preg_match('/OSRE/u', $ua)) { $this->data->browser->name = 'Nokia Xpress'; $this->data->browser->mode = 'proxy'; $this->data->browser->type = Constants\BrowserType::BROWSER; $this->data->device->type = Constants\DeviceType::MOBILE; $this->data->os->name = null; $this->data->os->version = null; } if (preg_match('/S40OviBrowser/u', $ua)) { $this->data->browser->name = 'Nokia Xpress'; $this->data->browser->mode = 'proxy'; $this->data->browser->type = Constants\BrowserType::BROWSER; if (preg_match('/S40OviBrowser\/([0-9.]*)/u', $ua, $match)) { $this->data->browser->version = new Version([ 'value' => $match[1], 'details' => 3 ]); } if (preg_match('/Nokia([^\/]+)\//u', $ua, $match)) { $this->data->device->manufacturer = 'Nokia'; $this->data->device->model = $match[1]; $this->data->device->identified |= Constants\Id::PATTERN; if (isset($this->data->device->model)) { $device = Data\DeviceModels::identify('s40', $this->data->device->model); if ($device->identified) { $device->identified |= $this->data->device->identified; $this->data->device = $device; } } if (isset($this->data->device->model)) { $device = Data\DeviceModels::identify('asha', $this->data->device->model); if ($device->identified) { $device->identified |= $this->data->device->identified; $this->data->os->name = 'Nokia Asha Platform'; $this->data->os->version = new Version([ 'value' => '1.0' ]); $this->data->device = $device; if (preg_match('/java_runtime_version=Nokia_Asha_([0-9_]+);/u', $ua, $match)) { $this->data->os->version = new Version([ 'value' => str_replace('_', '.', $match[1]) ]); } } } } if (preg_match('/NOKIALumia([0-9]+)/u', $ua, $match)) { $this->data->device->manufacturer = 'Nokia'; $this->data->device->model = $match[1]; $this->data->device->identified |= Constants\Id::PATTERN; $device = Data\DeviceModels::identify('wp', $this->data->device->model); if ($device->identified) { $device->identified |= $this->data->device->identified; $this->data->device = $device; $this->data->os->name = 'Windows Phone'; } } } /* MicroB - the default browser for maemo */ if (preg_match('/Maemo[ |_]Browser/u', $ua)) { $this->data->browser->name = 'MicroB'; $this->data->browser->type = Constants\BrowserType::BROWSER; if (preg_match('/Maemo[ |_]Browser[ |_]([0-9.]*)/u', $ua, $match)) { $this->data->browser->version = new Version([ 'value' => $match[1], 'details' => 3 ]); } } } /* Konqueror */ private function detectKonqueror($ua) { if (preg_match('/[k|K]onqueror\//u', $ua)) { $this->data->browser->name = 'Konqueror'; $this->data->browser->type = Constants\BrowserType::BROWSER; if (preg_match('/[k|K]onqueror\/([0-9.]*)/u', $ua, $match)) { $this->data->browser->version = new Version([ 'value' => $match[1] ]); } if ($this->data->device->type == '') { $this->data->device->type = Constants\DeviceType::DESKTOP; } } } /* OmniWeb */ private function detectOmniWeb($ua) { if (preg_match('/OmniWeb/u', $ua)) { $this->data->browser->name = 'OmniWeb'; $this->data->browser->type = Constants\BrowserType::BROWSER; $this->data->browser->version = null; if (preg_match('/OmniWeb\/v?([0-9])[0-9][0-9]/u', $ua, $match)) { $this->data->browser->version = new Version([ 'value' => $match[1], 'details' => 1 ]); } if (preg_match('/OmniWeb\/([0-9]\.[0-9\.]+)/u', $ua, $match)) { $this->data->browser->version = new Version([ 'value' => $match[1], 'details' => 3 ]); } $this->data->device->reset([ 'type' => Constants\DeviceType::DESKTOP ]); if (!empty($this->data->browser->version)) { if ($this->data->browser->version->is('<', 3)) { $this->data->os->name = 'NextStep'; $this->data->os->version = null; } if ($this->data->browser->version->is('>=', 4)) { if (empty($this->data->os->name) || $this->data->os->name != 'OS X') { $this->data->os->name = 'OS X'; $this->data->os->version = null; } } } } } /* Other browsers */ private function detectDesktopBrowsers($ua) { if (!preg_match('/(WebPositive|WebExplorer|WorldWideweb|Midori|Maxthon|Browse|Flow)/ui', $ua)) { return; } /* WebPositive */ if (preg_match('/WebPositive/u', $ua, $match)) { $this->data->browser->name = 'WebPositive'; $this->data->browser->channel = ''; $this->data->browser->version = null; $this->data->browser->type = Constants\BrowserType::BROWSER; if (preg_match('/WebPositive\/([0-9]\.[0-9.]+)/u', $ua, $match)) { $this->data->browser->version = new Version([ 'value' => $match[1], 'details' => 3 ]); } } /* IBM WebExplorer */ if (preg_match('/IBM[- ]WebExplorer[ -]?(DLL ?|Window API ?)?/u', $ua)) { $this->data->browser->name = 'IBM WebExplorer'; $this->data->browser->channel = ''; $this->data->browser->type = Constants\BrowserType::BROWSER; if (preg_match('/IBM[- ]WebExplorer[ -]?(?:DLL ?|Window API ?)?\/v([0-9]\.[0-9\.]+)/u', $ua, $match)) { $this->data->browser->version = new Version([ 'value' => $match[1] ]); } $this->data->os->name = 'OS/2'; $this->data->device->type = 'desktop'; } /* WorldWideweb */ if (preg_match('/WorldWideweb \(NEXT\)/u', $ua, $match)) { $this->data->browser->name = 'WorldWideWeb'; $this->data->browser->channel = ''; $this->data->browser->version = null; $this->data->browser->type = Constants\BrowserType::BROWSER; $this->data->os->name = 'NextStep'; $this->data->device->type = 'desktop'; } /* Midori */ if (preg_match('/Midori\/([0-9.]*)/u', $ua, $match)) { $this->data->browser->name = 'Midori'; $this->data->browser->version = new Version([ 'value' => $match[1] ]); $this->data->browser->type = Constants\BrowserType::BROWSER; $this->data->device->manufacturer = null; $this->data->device->model = null; $this->data->device->type = Constants\DeviceType::DESKTOP; if (isset($this->data->os->name) && $this->data->os->name == 'OS X') { $this->data->os->name = null; $this->data->os->version = null; } } if (preg_match('/midori(?:\/[0-9.]*)?$/u', $ua)) { $this->data->browser->name = 'Midori'; $this->data->browser->type = Constants\BrowserType::BROWSER; $this->data->device->type = Constants\DeviceType::DESKTOP; if (preg_match('/midori\/([0-9.]*)$/u', $ua, $match)) { $this->data->browser->version = new Version([ 'value' => $match[1] ]); } } /* Maxthon */ if (preg_match('/Maxthon/iu', $ua, $match)) { $this->data->browser->name = 'Maxthon'; $this->data->browser->channel = ''; $this->data->browser->version = null; $this->data->browser->type = Constants\BrowserType::BROWSER; if (preg_match('/Maxthon[\/\' ]\(?([0-9.]*)\)?/iu', $ua, $match)) { $this->data->browser->version = new Version([ 'value' => $match[1], 'details' => 3 ]); } if (isset($this->data->os->name) && $this->data->browser->version && $this->data->os->name == 'Windows' && $this->data->browser->version->toFloat() < 4) { $this->data->browser->version->details = 1; } } /* Browse for Remix OS */ if (preg_match('/^Browse\/([0-9.]+)/u', $ua, $match)) { $this->data->browser->name = 'Browse'; $this->data->browser->channel = ''; $this->data->browser->version = new Version([ 'value' => $match[1] ]); $this->data->browser->type = Constants\BrowserType::BROWSER; } /* Browse for Flow */ if (preg_match('/ Flow\/([0-9.]+)/u', $ua, $match)) { $this->data->browser->name = 'Flow'; $this->data->browser->channel = ''; $this->data->browser->version = new Version([ 'value' => $match[1] ]); $this->data->browser->type = Constants\BrowserType::BROWSER; unset($this->data->browser->family); if (preg_match('/EkiohFlow\/[0-9\.]+M/u', $ua)) { $this->data->browser->name = 'Flow Nightly Build'; $this->data->browser->version = null; } } } private function detectMobileBrowsers($ua) { if (!preg_match('/(Huawei|Ninesky|Skyfire|Dolphin|QQ|360|QHBrowser|Mercury|iBrowser|Puffin|MiniB|MxNitro|Sogou|Xiino|Palmscape|WebPro|Vision|MiuiBrowser)/ui', $ua)) { return; } /* Huawei Browser */ if (preg_match('/HuaweiBrowser\/([0-9.]*)/u', $ua, $match)) { $this->data->browser->name = 'Huawei Browser'; $this->data->browser->version = new Version([ 'value' => $match[1], 'details' => 2 ]); $this->data->browser->type = Constants\BrowserType::BROWSER; } /* Xiaomi MIUI Browser */ if (preg_match('/MiuiBrowser\/([0-9.]*)/u', $ua, $match)) { $this->data->browser->name = 'MIUI Browser'; $this->data->browser->version = new Version([ 'value' => $match[1] ]); $this->data->browser->type = Constants\BrowserType::BROWSER; if (!$this->data->os->isFamily('Android')) { $this->data->os->reset(); $this->data->os->name = 'Android'; $this->data->device->manufacturer = 'Xiaomi'; $this->data->device->model = null; $this->data->device->type = Constants\DeviceType::MOBILE; } } /* NineSky */ if (preg_match('/Ninesky(?:-android-mobile(?:-cn)?)?\/([0-9.]*)/u', $ua, $match)) { $this->data->browser->reset(); $this->data->browser->name = 'NineSky'; $this->data->browser->version = new Version([ 'value' => $match[1] ]); $this->data->browser->type = Constants\BrowserType::BROWSER; if (isset($this->data->device->manufacturer) && $this->data->device->manufacturer == 'Apple') { $this->data->device->reset(); } if (!$this->data->os->isFamily('Android')) { $this->data->os->reset(); $this->data->os->name = 'Android'; } $this->data->device->type = Constants\DeviceType::MOBILE; } /* Skyfire */ if (preg_match('/Skyfire\/([0-9.]*)/u', $ua, $match)) { $this->data->browser->name = 'Skyfire'; $this->data->browser->version = new Version([ 'value' => $match[1] ]); $this->data->browser->type = Constants\BrowserType::BROWSER; $this->data->device->type = Constants\DeviceType::MOBILE; $this->data->os->name = 'Android'; $this->data->os->version = null; } /* Dolphin HD */ if (preg_match('/Dolphin(?:HD|Browser)?(?:INT|CN)?\/(?:INT|CN)?-?([0-9.]*)/u', $ua, $match)) { $this->data->browser->name = 'Dolphin'; $this->data->browser->version = new Version([ 'value' => $match[1] ]); $this->data->browser->type = Constants\BrowserType::BROWSER; $this->data->device->type = Constants\DeviceType::MOBILE; } /* QQ Browser */ if (preg_match('/(M?QQBrowser)\/([0-9.]*)/u', $ua, $match)) { $this->data->browser->name = 'QQ Browser'; $version = $match[2]; if (preg_match('/^[0-9][0-9]$/u', $version)) { $version = $version[0] . '.' . $version[1]; } $this->data->browser->version = new Version([ 'value' => $version, 'details' => 2 ]); $this->data->browser->type = Constants\BrowserType::BROWSER; $this->data->browser->channel = ''; if (!isset($this->data->os->name) && $match[1] == 'QQBrowser') { $this->data->os->name = 'Windows'; } if (preg_match('/MQQBrowser\/[0-9\.]+\/Adr \(Linux; U; ([0-9\.]+); [^;]+; (.+) Build/u', $ua, $match)) { $this->data->os->reset([ 'name' => 'Android', 'version' => new Version([ 'value' => $match[1] ]) ]); $this->data->device->type = Constants\DeviceType::MOBILE; $this->data->device->model = $match[2]; $this->data->device->identified |= Constants\Id::PATTERN; $device = Data\DeviceModels::identify('android', $match[2]); if ($device->identified) { $device->identified |= $this->data->device->identified; $this->data->device = $device; } } if (preg_match('/MQQBrowser\/[0-9\.]+\/WP7 \([^;]+;WPOS:([0-9]\.[0-9])[0-9\.]*;([^;]+); ([^\)]+)\)/u', $ua, $match)) { $this->data->os->reset([ 'name' => 'Windows Phone', 'version' => new Version([ 'value' => $match[1] ]) ]); $this->data->device->type = Constants\DeviceType::MOBILE; $this->data->device->manufacturer = $match[2]; $this->data->device->model = $match[3]; $this->data->device->identified |= Constants\Id::PATTERN; $device = Data\DeviceModels::identify('wp', $match[3]); if ($device->identified) { $device->identified |= $this->data->device->identified; $this->data->device = $device; } } } if (preg_match('/MQQBrowser\/Mini([0-9.]*)/u', $ua, $match)) { $this->data->browser->name = 'QQ Browser Mini'; $this->data->browser->version = new Version([ 'value' => $match[1], 'details' => 2 ]); $this->data->browser->type = Constants\BrowserType::BROWSER; $this->data->browser->channel = ''; } if (preg_match('/QQ\/([0-9.]*)/u', $ua, $match)) { $this->data->browser->name = 'QQ Browser'; $this->data->browser->version = new Version([ 'value' => $match[1], 'details' => 2 ]); $this->data->browser->type = Constants\BrowserType::BROWSER; $this->data->browser->channel = ''; } /* 360 Phone Browser */ if (preg_match('/360 (?:Aphone|Android Phone) Browser/u', $ua, $match)) { $this->data->browser->name = 'Qihoo 360 Browser'; $this->data->browser->family = null; $this->data->browser->channel = ''; $this->data->browser->type = Constants\BrowserType::BROWSER; } if (preg_match('/360 (?:Aphone|Android Phone) Browser \((?:Version |V)?([0-9.]*)(?:beta)?\)/u', $ua, $match)) { $this->data->browser->name = 'Qihoo 360 Browser'; $this->data->browser->family = null; $this->data->browser->channel = ''; $this->data->browser->version = new Version([ 'value' => $match[1] ]); $this->data->browser->type = Constants\BrowserType::BROWSER; if (!$this->data->os->isFamily('Android')) { $this->data->device->type = Constants\DeviceType::MOBILE; $this->data->os->reset([ 'name' => 'Android' ]); } } if (preg_match('/360%20(?:Browser|Lite)\/([0-9\.]+)/u', $ua, $match)) { $this->data->browser->name = 'Qihoo 360 Browser'; $this->data->browser->family = null; $this->data->browser->channel = ''; $this->data->browser->version = new Version([ 'value' => $match[1] ]); $this->data->browser->type = Constants\BrowserType::BROWSER; } if (preg_match('/QHBrowser\/([0-9\.]+)/u', $ua, $match)) { $version = $match[1]; if (preg_match('/^[0-9][0-9][0-9]$/u', $version)) { $version = $version[0] . '.' . $version[1] . '.' . $version[2]; } $this->data->browser->name = 'Qihoo 360 Browser'; $this->data->browser->channel = ''; $this->data->browser->version = new Version([ 'value' => $version ]); $this->data->browser->type = Constants\BrowserType::BROWSER; if (!$this->data->isOs('iOS')) { $this->data->device->type = Constants\DeviceType::MOBILE; $this->data->os->reset([ 'name' => 'iOS' ]); } } /* Mercury */ if (preg_match('/(?:^| )Mercury\/([0-9\.]+)/u', $ua, $match)) { $version = $match[1]; if (preg_match('/^[0-9][0-9][0-9]$/u', $version)) { $version = $version[0] . '.' . $version[1] . '.' . $version[2]; } $this->data->browser->name = 'Mercury Browser'; $this->data->browser->channel = ''; $this->data->browser->version = new Version([ 'value' => $version ]); $this->data->browser->type = Constants\BrowserType::BROWSER; } /* iBrowser */ if (preg_match('/(?:^| )iBrowser\/([0-9.]*)/u', $ua, $match)) { $this->data->browser->name = 'iBrowser'; $version = $match[1]; if (preg_match('/^[0-9][0-9]$/u', $version)) { $version = $version[0] . '.' . $version[1]; } $this->data->browser->version = new Version([ 'value' => $version, 'details' => 2 ]); $this->data->browser->channel = ''; $this->data->browser->type = Constants\BrowserType::BROWSER; } if (preg_match('/iBrowser\/Mini([0-9.]*)/u', $ua, $match)) { $this->data->browser->name = 'iBrowser Mini'; $this->data->browser->version = new Version([ 'value' => $match[1], 'details' => 2 ]); $this->data->browser->channel = ''; $this->data->browser->type = Constants\BrowserType::BROWSER; } /* Puffin */ if (preg_match('/Puffin\/([0-9.]+)([IA])?([PT])?/u', $ua, $match)) { $this->data->browser->name = 'Puffin'; $this->data->browser->version = new Version([ 'value' => $match[1], 'details' => (intval(substr(strrchr($match[1], '.'), 1)) > 99 ? -1 : null) ]); $this->data->browser->mode = 'proxy'; $this->data->browser->channel = ''; $this->data->browser->type = Constants\BrowserType::BROWSER; if (isset($match[2])) { switch ($match[2]) { case 'A': if (!$this->data->isOs('Android')) { $this->data->os->reset([ 'name' => 'Android' ]); } break; case 'I': if (!$this->data->isOs('iOS')) { $this->data->os->reset([ 'name' => 'iOS' ]); } break; } } if (isset($match[3])) { switch ($match[3]) { case 'P': $this->data->device->type = Constants\DeviceType::MOBILE; if ($this->data->os->name == 'iOS' && empty($this->data->device->model)) { $this->data->device->manufacturer = 'Apple'; $this->data->device->model = 'iPhone'; $this->data->device->identified = Constants\Id::MATCH_UA; } break; case 'T': $this->data->device->type = Constants\DeviceType::TABLET; if ($this->data->os->name == 'iOS' && empty($this->data->device->model)) { $this->data->device->manufacturer = 'Apple'; $this->data->device->model = 'iPad'; $this->data->device->identified = Constants\Id::MATCH_UA; } break; } } } /* MiniBrowser Mobile */ if (preg_match('/MiniBr?owserM(?:obile)?\/([0-9.]*)/u', $ua, $match)) { $this->data->browser->name = 'MiniBrowser'; $this->data->browser->version = new Version([ 'value' => $match[1] ]); $this->data->browser->type = Constants\BrowserType::BROWSER; $this->data->device->type = Constants\DeviceType::MOBILE; if (!$this->data->isOs('Series60')) { $this->data->os->name = 'Series60'; $this->data->os->version = null; } } /* Maxthon */ if (preg_match('/MxNitro/iu', $ua, $match)) { $this->data->browser->name = 'Maxthon Nitro'; $this->data->browser->channel = ''; $this->data->browser->version = null; $this->data->browser->type = Constants\BrowserType::BROWSER; if (preg_match('/MxNitro\/([0-9.]*)/iu', $ua, $match)) { $this->data->browser->version = new Version([ 'value' => $match[1], 'details' => 3 ]); } } /* Sogou Mobile */ if (preg_match('/SogouAndroidBrowser\/([0-9.]*)/u', $ua, $match)) { $this->data->browser->name = 'Sogou Mobile'; $this->data->browser->version = new Version([ 'value' => $match[1] ]); $this->data->browser->type = Constants\BrowserType::BROWSER; if (isset($this->data->device->manufacturer) && $this->data->device->manufacturer == 'Apple') { unset($this->data->device->manufacturer); unset($this->data->device->model); unset($this->data->device->identifier); $this->data->device->identified = Constants\Id::NONE; } } /* Xiino */ if (preg_match('/Xiino\/([0-9.]+)/u', $ua, $match)) { $this->data->browser->name = 'Xiino'; $this->data->browser->version = new Version([ 'value' => $match[1] ]); $this->data->browser->type = Constants\BrowserType::BROWSER; $this->data->device->type = Constants\DeviceType::PDA; $this->data->os->name = 'Palm OS'; if (preg_match('/\(v. ([0-9.]+)/u', $ua, $match)) { $this->data->os->version = new Version([ 'value' => $match[1] ]); } } /* Palmscape */ if (preg_match('/Palmscape\/(?:PR)?([0-9.]+)/u', $ua, $match)) { $this->data->browser->name = 'Palmscape'; $this->data->browser->version = new Version([ 'value' => $match[1] ]); $this->data->browser->type = Constants\BrowserType::BROWSER; $this->data->device->type = Constants\DeviceType::PDA; $this->data->os->name = 'Palm OS'; if (preg_match('/\(v. ([0-9.]+)/u', $ua, $match)) { $this->data->os->version = new Version([ 'value' => $match[1] ]); } } /* Novarra WebPro */ if (preg_match('/WebPro/u', $ua) && preg_match('/PalmOS/u', $ua)) { $this->data->browser->name = 'WebPro'; $this->data->browser->version = null; $this->data->browser->type = Constants\BrowserType::BROWSER; if (preg_match('/WebPro\/?([0-9.]*)/u', $ua, $match)) { $this->data->browser->version = new Version([ 'value' => $match[1] ]); } } /* Novarra Vision */ if (preg_match('/(?:Vision-Browser|Novarra-Vision)\/?([0-9.]*)/u', $ua, $match)) { $this->data->browser->name = 'Novarra Vision'; $this->data->browser->version = new Version([ 'value' => $match[1] ]); $this->data->browser->family = null; $this->data->browser->mode = 'proxy'; $this->data->browser->type = Constants\BrowserType::BROWSER; if ($this->data->device->type != Constants\DeviceType::MOBILE) { $this->data->os->reset(); $this->data->device->type = Constants\DeviceType::MOBILE; } } } private function detectTelevisionBrowsers($ua) { if (!preg_match('/(Roku|LG Browser|NetCast|SonyBrowserCore|Dream|Planetweb)/ui', $ua)) { return; } /* Web on Roku */ if (preg_match('/Roku/u', $ua) && preg_match('/Web\/([0-9.]+)/u', $ua, $match)) { $this->data->browser->name = 'Web'; $this->data->browser->version = new Version([ 'value' => $match[1], 'details' => 2 ]); $this->data->browser->type = Constants\BrowserType::BROWSER; } /* LG Browser */ if (preg_match('/LG Browser\/([0-9.]*)/u', $ua, $match)) { $this->data->browser->name = 'LG Browser'; $this->data->browser->version = new Version([ 'value' => $match[1], 'details' => 2 ]); $this->data->browser->type = Constants\BrowserType::BROWSER; $this->data->device->type = Constants\DeviceType::TELEVISION; } if (preg_match('/NetCast/u', $ua) && preg_match('/SmartTV\//u', $ua)) { unset($this->data->browser->name); unset($this->data->browser->version); } /* Sony Browser */ if (preg_match('/SonyBrowserCore\/([0-9.]*)/u', $ua, $match)) { unset($this->data->browser->name); unset($this->data->browser->version); $this->data->device->type = Constants\DeviceType::TELEVISION; } /* Dreamkey */ if (preg_match('/DreamKey\/([0-9.]*)/u', $ua, $match)) { $this->data->browser->name = 'Dreamkey'; $this->data->browser->version = new Version([ 'value' => $match[1] ]); $this->data->browser->type = Constants\BrowserType::BROWSER; $this->data->device->setIdentification([ 'manufacturer' => 'Sega', 'model' => 'Dreamcast', 'type' => Constants\DeviceType::GAMING, 'subtype' => Constants\DeviceSubType::CONSOLE ]); } /* Dream Passport */ if (preg_match('/DreamPassport\/([0-9.]*)/u', $ua, $match)) { $this->data->browser->name = 'Dream Passport'; $this->data->browser->version = new Version([ 'value' => $match[1] ]); $this->data->browser->type = Constants\BrowserType::BROWSER; $this->data->device->setIdentification([ 'manufacturer' => 'Sega', 'model' => 'Dreamcast', 'type' => Constants\DeviceType::GAMING, 'subtype' => Constants\DeviceSubType::CONSOLE ]); } /* Planetweb */ if (preg_match('/Planetweb\/v?([0-9.]*)/u', $ua, $match)) { $this->data->browser->name = 'Planetweb'; $this->data->browser->version = new Version([ 'value' => $match[1] ]); $this->data->browser->type = Constants\BrowserType::BROWSER; if (preg_match('/Dreamcast/u', $ua, $match)) { $this->data->device->setIdentification([ 'manufacturer' => 'Sega', 'model' => 'Dreamcast', 'type' => Constants\DeviceType::GAMING, 'subtype' => Constants\DeviceSubType::CONSOLE ]); } if (preg_match('/SPS/u', $ua, $match)) { $this->data->device->setIdentification([ 'manufacturer' => 'Sony', 'model' => 'PlayStation 2', 'type' => Constants\DeviceType::GAMING, 'subtype' => Constants\DeviceSubType::CONSOLE ]); } } } private function detectRemainingBrowsers($ua) { if ($data = Data\Applications::identifyBrowser($ua)) { $this->data->browser->set($data['browser']); if (!empty($data['device'])) { $this->data->device->set($data['device']); } } } private function detectWapBrowsers($ua) { if (!preg_match('/(Dorado|MAUI)/ui', $ua, $match)) { return; } if (preg_match('/Browser\/Dorado([0-9.]*)/ui', $ua, $match)) { $this->data->browser->name = 'Dorado WAP'; $this->data->browser->type = Constants\BrowserType::BROWSER; $this->data->browser->version = new Version([ 'value' => $match[1], 'details' => 2 ]); } if (preg_match('/Dorado WAP-Browser\/([0-9.]*)/ui', $ua, $match)) { $this->data->browser->name = 'Dorado WAP'; $this->data->browser->type = Constants\BrowserType::BROWSER; $this->data->browser->version = new Version([ 'value' => $match[1], 'details' => 2 ]); } if (preg_match('/MAUI[ _]WAP[ _]Browser(?:\/([0-9.]*))?/ui', $ua, $match)) { $this->data->browser->name = 'MAUI WAP'; $this->data->browser->type = Constants\BrowserType::BROWSER; if (isset($match[1])) { $this->data->browser->version = new Version([ 'value' => $match[1] ]); } } if (preg_match('/WAP Browser\/MAUI/ui', $ua, $match)) { $this->data->browser->name = 'MAUI WAP'; $this->data->browser->type = Constants\BrowserType::BROWSER; } } }