pe = 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; } } }