Пример #1
0
 private function &detectBot($ua)
 {
     /* Detect bots based on url in the UA string */
     if (preg_match('/\\+https?:\\/\\//iu', $ua)) {
         $this->data->browser->reset();
         $this->data->os->reset();
         $this->data->engine->reset();
         $this->data->device->reset();
         $this->data->device->type = Constants\DeviceType::BOT;
     }
     /* Detect bots based on common markers */
     if (preg_match('/(?:Bot|Robot|Spider|Crawler)([\\/\\);]|$)/iu', $ua) && !preg_match('/CUBOT/iu', $ua)) {
         $this->data->browser->reset();
         $this->data->os->reset();
         $this->data->engine->reset();
         $this->data->device->reset();
         $this->data->device->type = Constants\DeviceType::BOT;
     }
     /* Detect based on a predefined list or markers */
     if ($bot = Data\Applications::identifyBot($ua)) {
         $this->data->browser = $bot;
         $this->data->os->reset();
         $this->data->engine->reset();
         $this->data->device->reset();
         $this->data->device->type = Constants\DeviceType::BOT;
     }
     return $this;
 }
Пример #2
0
<?php

namespace WhichBrowser\Data;

use WhichBrowser\Constants;
Applications::$BROWSERS = [Constants\BrowserType::BROWSER => [['name' => '115 Browser', 'id' => '115', 'regexp' => '/115Browser\\/([0-9.]*)/u'], ['name' => '115 Chrome', 'id' => '115', 'regexp' => '/115Chrome\\/([0-9.]*)/u'], ['name' => '126 Browser', 'id' => '126', 'regexp' => '/126BROWSER/u'], ['name' => '2345 Explorer', 'id' => '2345', 'regexp' => '/2345Explorer\\/([0-9.]*)/u', 'details' => 3], ['name' => '2345 Explorer', 'id' => '2345', 'regexp' => '/2345Explorer v([0-9.]*)/u', 'details' => 3], ['name' => '2345 Chrome', 'id' => '2345', 'regexp' => '/2345chrome v([0-9.]*)/u', 'details' => 3], ['name' => '360 Extreme Explorer', 'id' => 'qihu', 'regexp' => '/QIHU 360EE/u', 'type' => Constants\DeviceType::DESKTOP], ['name' => '360 Safe Explorer', 'id' => 'qihu', 'regexp' => '/QIHU 360SE/u', 'type' => Constants\DeviceType::DESKTOP], ['name' => '7Star', 'id' => '7star', 'regexp' => '/7Star\\/([0-9.]*)/u'], ['name' => 'ABrowse', 'id' => 'abrowse', 'regexp' => '/A[Bb]rowse ([0-9.]*)/u'], ['name' => 'Abrowser', 'id' => 'abrowse', 'regexp' => '/Abrowser\\/([0-9.]*)/u'], ['name' => 'Acorn Browse', 'id' => 'acorn', 'regexp' => '/Acorn Browse ([0-9.]+)/u'], ['name' => 'Acorn Browse', 'id' => 'acorn', 'regexp' => '/Acorn Phoenix ([0-9.]+)/u'], ['name' => 'AOL Desktop', 'id' => 'aol', 'regexp' => '/AOL ([0-9.]*); AOLBuild/i'], ['name' => 'AOL Browser', 'id' => 'america', 'regexp' => '/America Online Browser (?:[0-9.]*); rev([0-9.]*);/i'], ['name' => 'Arachne', 'id' => 'arachne', 'regexp' => '/xChaos_Arachne\\/[0-9]\\.([0-9.]*)/u', 'type' => Constants\DeviceType::DESKTOP], ['name' => 'Arora', 'id' => 'arora', 'regexp' => '/[Aa]rora\\/([0-9.]*)/u'], ['name' => 'AWeb', 'id' => 'aweb', 'regexp' => '/Amiga-AWeb(?:\\/([0-9.]*))?/u'], ['name' => 'AvantGo', 'id' => 'avant', 'regexp' => '/AvantGo ([0-9.]+)/u'], ['name' => 'Avant Browser', 'id' => 'avant', 'regexp' => '/Avant Browser/u'], ['name' => 'Avant Browser', 'id' => 'avant', 'regexp' => '/Avant TriCore/u'], ['name' => 'Aviator', 'id' => 'aviator', 'regexp' => '/Aviator\\/([0-9.]*)/u', 'details' => 1], ['name' => 'Baidu Browser', 'id' => 'flyflow', 'regexp' => '/FlyFlow\\/([0-9.]*)/u', 'details' => 2], ['name' => 'Baidu Browser', 'id' => 'bdbrowser', 'regexp' => '/bdbrowser\\/([0-9.]*)/i'], ['name' => 'Baidu Browser', 'id' => 'bdbrowser', 'regexp' => '/bdbrowser_i18n\\/([0-9.]*)/i'], ['name' => 'Baidu Spark', 'id' => 'bdspark', 'regexp' => '/BDSpark\\/([0-9.]*)/u', 'details' => 2], ['name' => 'Beamrise', 'id' => 'beamrise', 'regexp' => '/Beamrise\\/([0-9.]*)/u'], ['name' => 'Black Wren', 'id' => 'blackwren', 'regexp' => '/BlackWren\\/([0-9.]*)/u', 'details' => 2], ['name' => 'Brave', 'id' => 'brave', 'regexp' => '/brave\\/([0-9.]*)/u'], ['name' => 'Byffox', 'id' => 'byffox', 'regexp' => '/Byffox\\/([0-9.]*)/u', 'type' => Constants\DeviceType::DESKTOP], ['name' => 'Camino', 'id' => 'camino', 'regexp' => '/Camino\\/([0-9.]*)/u', 'type' => Constants\DeviceType::DESKTOP], ['name' => 'Canure', 'id' => 'canure', 'regexp' => '/Canure\\/([0-9.]*)/u', 'details' => 3], ['name' => 'Charon', 'id' => 'charon', 'regexp' => '/Charon/'], ['name' => 'ChromePlus', 'id' => 'chromeplus', 'regexp' => '/ChromePlus(?:\\/([0-9.]*))?$/u', 'details' => 3, 'type' => Constants\DeviceType::DESKTOP], ['name' => 'CometBird', 'id' => 'cometbird', 'regexp' => '/CometBird\\/([0-9.]*)/u'], ['name' => 'Comodo Dragon', 'id' => 'comodo', 'regexp' => '/Comodo_Dragon\\/([0-9.]*)/u', 'details' => 2], ['name' => 'Comodo Dragon', 'id' => 'dragon', 'regexp' => '/Dragon\\/([0-9.]*)/u', 'details' => 2], ['name' => 'Comodo IceDragon', 'id' => 'dragon', 'regexp' => '/IceDragon\\/([0-9.]*)/u', 'details' => 2, 'type' => Constants\DeviceType::DESKTOP], ['name' => 'Conkeror', 'id' => 'conkeror', 'regexp' => '/[Cc]onkeror\\/([0-9.]*)/u'], ['name' => 'CoolNovo', 'id' => 'coolnovo', 'regexp' => '/(?:CoolNovo|CoolNovoChromePlus)\\/([0-9.]*)/u', 'details' => 3, 'type' => Constants\DeviceType::DESKTOP], ['name' => 'Cunaguaro', 'id' => 'cunaguaro', 'regexp' => '/Cunaguaro\\/([0-9.]*)/u', 'details' => 3, 'type' => Constants\DeviceType::DESKTOP], ['name' => 'Cyberfox', 'id' => 'cyberfox', 'regexp' => '/Cyberfox\\/([0-9.]*)/u', 'details' => 2], ['name' => 'Daedalus', 'id' => 'daedalus', 'regexp' => '/Daedalus ([0-9.]*)/u', 'details' => 2], ['name' => 'Dillo', 'id' => 'dillo', 'regexp' => '/Dillo\\/([0-9.]*)/u'], ['name' => 'Doga Rhodonit', 'id' => 'rhodonit', 'regexp' => '/DogaRhodonit/u'], ['name' => 'EudoraWeb', 'id' => 'eudoraweb', 'regexp' => '/EudoraWeb ([0-9.]*)/u'], ['name' => 'Flock', 'id' => 'flock', 'regexp' => '/Flock\\/([0-9.]*)/u', 'details' => 3, 'type' => Constants\DeviceType::DESKTOP], ['name' => 'Galeon', 'id' => 'galeon', 'regexp' => '/Galeon\\/([0-9.]*)/u', 'details' => 3], ['name' => 'GNOME Web', 'id' => 'epiphany', 'regexp' => '/Epiphany\\/([0-9.]*)/u', 'type' => Constants\DeviceType::DESKTOP], ['name' => 'IBrowse', 'id' => 'ibrowse', 'regexp' => '/IBrowse[\\/ ]([0-9.]*)/u', 'type' => Constants\DeviceType::DESKTOP], ['name' => 'iCab', 'id' => 'icab', 'regexp' => '/iCab(?: J)?\\/([0-9.]*)/u'], ['name' => 'Iceape', 'id' => 'iceape', 'regexp' => '/Iceape\\/([0-9.]*)/u'], ['name' => 'IceCat', 'id' => 'icecat', 'regexp' => '/IceCat[ \\/]([0-9.]*)/u', 'type' => Constants\DeviceType::DESKTOP], ['name' => 'Iceweasel', 'id' => 'iceweasel', 'regexp' => '/Iceweasel\\/([0-9.]*)/iu', 'type' => Constants\DeviceType::DESKTOP], ['name' => 'Iridium', 'id' => 'iridium', 'regexp' => '/Iridium\\/([0-9.]*)/u', 'details' => 2], ['name' => 'Iron', 'id' => 'iron', 'regexp' => '/Iron\\/([0-9.]*)/u', 'details' => 2], ['name' => 'Kazehakase', 'id' => 'kazehakase', 'regexp' => '/Kazehakase\\/([0-9.]*)/u'], ['name' => 'KChrome', 'id' => 'kchrome', 'regexp' => '/KChrome\\/([0-9.]*)/u', 'details' => 3], ['name' => 'K-Meleon', 'id' => 'meleon', 'regexp' => '/K-Meleon\\/([0-9.]*)/u', 'type' => Constants\DeviceType::DESKTOP], ['name' => 'LieBao', 'id' => 'lbbrowser', 'regexp' => '/LBBROWSER/u'], ['name' => 'Lobo', 'id' => 'lobo', 'regexp' => '/Lobo\\/([0-9.]*)/u', 'type' => Constants\DeviceType::DESKTOP], ['name' => 'Lunascape', 'id' => 'lunascape', 'regexp' => '/ Lunascape[\\/| ]([0-9.]*)/u', 'details' => 3], ['name' => 'Naenara', 'id' => 'naenara', 'regexp' => '/NaenaraBrowser\\/([0-9.]*)/u', 'details' => 2], ['name' => 'Maxthon', 'id' => 'mxbrowser', 'regexp' => '/MxBrowser\\/([0-9.]*)/u'], ['name' => 'Maxthon', 'id' => 'mxbrowser', 'regexp' => '/MxBrowser-iPhone\\/([0-9.]*)/u'], ['name' => 'MixShark', 'id' => 'mixshark', 'regexp' => '/MixShark\\/([0-9.]*)/u'], ['name' => 'mlbrowser', 'id' => 'mlbrowser', 'regexp' => '/mlbrowser/u'], ['name' => 'NetPositive', 'id' => 'netpositive', 'regexp' => '/NetPositive\\/([0-9.]*)/u'], ['name' => 'Origyn', 'id' => 'origyn', 'regexp' => '/Origyn Web Browser/u'], ['name' => 'Odyssey', 'id' => 'owb', 'regexp' => '/OWB\\/([0-9.]*)/u'], ['name' => 'OmniWeb', 'id' => 'omniweb', 'regexp' => '/OmniWeb/u', 'type' => Constants\DeviceType::DESKTOP], ['name' => 'Orca', 'id' => 'orca', 'regexp' => '/Orca\\/([0-9.]*)/u'], ['name' => 'Oregano', 'id' => 'oregano', 'regexp' => '/Oregano ([0-9.]*)/u'], ['name' => 'Otter', 'id' => 'otter', 'regexp' => '/Otter(?: Browser)?\\/([0-9.]*)/u'], ['name' => 'Pale Moon', 'id' => 'palemoon', 'regexp' => '/Pale[mM]oon\\/([0-9.]*)/u'], ['name' => 'Qihoo 360', 'id' => 'qihu', 'regexp' => '/QIHU THEWORLD/u'], ['name' => 'QtWeb', 'id' => 'qtweb', 'regexp' => '/QtWeb Internet Browser\\/([0-9.]*)/u'], ['name' => 'QupZilla', 'id' => 'qupzilla', 'regexp' => '/QupZilla\\/([0-9.]*)/u', 'type' => Constants\DeviceType::DESKTOP], ['name' => 'rekonq', 'id' => 'rekonq', 'regexp' => '/rekonq(?:\\/([0-9.]*))?/u', 'type' => Constants\DeviceType::DESKTOP], ['name' => 'Ryouko', 'id' => 'ryouko', 'regexp' => '/Ryouko\\/([0-9.]*)/u', 'type' => Constants\DeviceType::DESKTOP], ['name' => 'SaaYaa Explorer', 'id' => 'saayaa', 'regexp' => '/SaaYaa/u', 'type' => Constants\DeviceType::DESKTOP], ['name' => 'Sleipnir', 'id' => 'sleipnir', 'regexp' => '/Sleipnir\\/([0-9.]*)/u', 'details' => 3], ['name' => 'Sogou Explorer', 'id' => 'metasr', 'regexp' => '/SE 2.X MetaSr/u', 'type' => Constants\DeviceType::DESKTOP], ['name' => 'Stainless', 'id' => 'stainless', 'regexp' => '/Stainless\\/([0-9.]*)/u'], ['name' => 'SunChrome', 'id' => 'sunchrome', 'regexp' => '/SunChrome\\/([0-9.]*)/u'], ['name' => 'Superbird', 'id' => 'superbird', 'regexp' => '/Super[Bb]ird\\/([0-9.]*)/u', 'details' => 2], ['name' => 'Swing Browser', 'id' => 'swing', 'regexp' => '/Swing(?:\\(And\\))?\\/([0-9.]*)/u', 'details' => 3], ['name' => 'Tencent Traveler', 'id' => 'tencent', 'regexp' => '/TencentTraveler ([0-9.]*)/u', 'details' => 2], ['name' => 'TenFourFox', 'id' => 'tenfourfox', 'regexp' => '/TenFourFox\\//u'], ['name' => 'The World', 'id' => 'theworld', 'regexp' => '/TheWorld(?: ([0-9.]*))?/u'], ['name' => 'Tungsten Browser', 'id' => 'tungsten', 'regexp' => '/TungstenBrowser\\/([0-9.]*)/u'], ['name' => 'Vivaldi', 'id' => 'vivaldi', 'regexp' => '/Vivaldi\\/([0-9.]*)/u', 'details' => 2], ['name' => 'Voyager', 'id' => 'voyager', 'regexp' => '/AmigaVoyager\\/([0-9.]*)/u'], ['name' => 'Waterfox', 'id' => 'waterfox', 'regexp' => '/Waterfox\\/([0-9.]*)/u', 'details' => 2, 'type' => Constants\DeviceType::DESKTOP], ['name' => 'Yandex Browser', 'id' => 'yabrowser', 'regexp' => '/YaBrowser\\/([0-9.]*)/u', 'details' => 2], ['name' => '1Browser', 'id' => '1password', 'regexp' => '/1Password\\/([0-9.]*)/u'], ['name' => '2345 Browser', 'id' => '2345', 'regexp' => '/Mb2345Browser\\/([0-9.]*)/u'], ['name' => '3G Explorer', 'id' => '3g explorer', 'regexp' => '/3G Explorer\\/([0-9.]*)/u', 'details' => 3], ['name' => '4G Explorer', 'id' => '4g explorer', 'regexp' => '/4G Explorer\\/([0-9.]*)/u', 'details' => 3], ['name' => 'Atomic', 'id' => 'atomiclite', 'regexp' => '/AtomicLite\\/([0-9.]*)/u'], ['name' => 'AU', 'id' => 'au', 'regexp' => '/(?:^| )AU(?:.Browser)?\\/([0-9.]+)/u'], ['name' => 'Awakening', 'id' => 'awakening', 'regexp' => '/Awakening Browser\\/([0-9.]*)/u', 'details' => 2], ['name' => 'Baidu Browser', 'id' => 'baidu', 'regexp' => '/M?BaiduBrowser\\/([0-9.]*)/i'], ['name' => 'Baidu Browser', 'id' => 'bdmobile', 'regexp' => '/BdMobile\\/([0-9.]*)/i'], ['name' => 'Baidu Browser', 'id' => 'bidu', 'regexp' => '/BIDUBrowser[ \\/]([0-9.]*)/u'], ['name' => 'Baidu Browser', 'id' => 'baidu', 'regexp' => '/BaiduHD\\/([0-9.]*)/u', 'details' => 2, 'type' => Constants\DeviceType::MOBILE], ['name' => 'Blazer', 'id' => 'blazer', 'regexp' => '/Blazer\\/([0-9.]*)/u'], ['name' => 'Cornowser', 'id' => 'cornowser', 'regexp' => '/Cornowser\\/([0-9.]*)/u'], ['name' => 'CuteBrowser', 'id' => 'cute', 'regexp' => '/CuteBrowser\\/([0-9.]*)/u', 'details' => 2], ['name' => 'Digia @Web', 'id' => 'digia', 'regexp' => '/Digia @Web\\/([0-9.]*)/u'], ['name' => 'Dorado', 'id' => 'dorado', 'regexp' => '/Browser\\/Dorado([0-9.]*)/u'], ['name' => 'Dorado', 'id' => 'dorado', 'regexp' => '/Dorado WAP-Browser\\/([0-9.]*)/u'], ['name' => 'Doris', 'id' => 'doris', 'regexp' => '/Doris\\/([0-9.]*)/u'], ['name' => 'Dorothy', 'id' => 'doroty', 'regexp' => '/Dorothy$/u'], ['name' => 'EMOBILE Browser', 'id' => 'www browser', 'regexp' => '/WWW Browser\\/ver([0-9.]*)/u'], ['name' => 'Go.Web', 'id' => 'go\\.web', 'regexp' => '/Go\\.Web\\/([0-9.]*)/u'], ['name' => 'Helium', 'id' => 'helium', 'regexp' => '/HeliumMobileBrowser\\/([0-9.]*)/u'], ['name' => 'iCab', 'id' => 'icab', 'regexp' => '/iCabMobile\\/([0-9.]*)/u'], ['name' => 'iLunascape', 'id' => 'lunascape', 'regexp' => '/iLunascape\\/([0-9.]*)/u', 'details' => 3], ['name' => 'InternetSurfboard', 'id' => 'surfboard', 'regexp' => '/InternetSurfboard\\/([0-9.]*)/u'], ['name' => 'iSurf', 'id' => 'isurf', 'regexp' => '/iSurf version \\/v([0-9.]*)/u', 'details' => 2], ['name' => 'Jig Browser', 'id' => 'jig browser', 'regexp' => '/jig browser(?: web| core|9i?)?;? ?([0-9.]+)?/u', 'type' => Constants\DeviceType::MOBILE], ['name' => 'Jumanji', 'id' => 'jumanji', 'regexp' => '/jumanji/u'], ['name' => 'Kiosk', 'id' => 'kiosk', 'regexp' => '/Kiosk\\/([0-9.]*)/u'], ['name' => 'LieBaoFast', 'id' => 'liebao', 'regexp' => '/LieBaoFast\\/([0-9.]*)/u'], ['name' => 'MaCross Mobile', 'id' => 'macross', 'regexp' => '/MaCross\\/([0-9.]*)/u'], ['name' => 'Mammoth', 'id' => 'mammoth', 'regexp' => '/Mammoth\\/([0-9.]*)/u'], ['name' => 'Motorola Internet Browser', 'id' => 'mib', 'regexp' => '/MIB\\/([0-9.]*)/u'], ['name' => 'Motorola Internet Browser', 'id' => 'mib', 'regexp' => '/MIB([0-9.]+)\\//u'], ['name' => 'Motorola Internet Browser', 'id' => 'cmcs', 'regexp' => '/Browser\\/CMCS([0-9.]*)/u'], ['name' => 'Motorola WebKit', 'id' => 'motorola', 'regexp' => '/MotorolaWebKit(?:\\/([0-9.]*))?/u', 'details' => 3], ['name' => 'MIUI Browser', 'id' => 'miui', 'regexp' => '/MiuiBrowser\\/([0-9.]*)/u'], ['name' => 'NetFront Life Browser', 'id' => 'netfrontlife', 'regexp' => '/NetFrontLifeBrowser\\/([0-9.]*)/u'], ['name' => 'OneBrowser', 'id' => 'onebrowser', 'regexp' => '/OneBrowser\\/([0-9.]*)/u'], ['name' => 'Polaris', 'id' => 'polaris', 'regexp' => '/Polaris[\\/ ]v?([0-9.]*)/iu', 'details' => 2], ['name' => 'Polaris', 'id' => 'polaris', 'regexp' => '/POLARIS([0-9.]+)/u', 'details' => 2], ['name' => 'Openwave', 'id' => 'openwave', 'regexp' => '/Open[Ww]ave\\/([0-9.]*)/u', 'details' => 2, 'type' => Constants\DeviceType::MOBILE], ['name' => 'Openwave', 'id' => 'openwave', 'regexp' => '/Openwave Mobile Browser ([0-9.]*)/u', 'details' => 2, 'type' => Constants\DeviceType::MOBILE], ['name' => 'Openwave', 'id' => 'openwave', 'regexp' => '/Browser\\/OpenWave([0-9.]*)/u', 'details' => 2, 'type' => Constants\DeviceType::MOBILE], ['name' => 'Openwave', 'id' => 'up', 'regexp' => '/UP\\. ?Browser(?:\\/([a-z0-9.]*))?/iu', 'details' => 2, 'type' => Constants\DeviceType::MOBILE], ['name' => 'Openwave', 'id' => 'km', 'regexp' => '/KM\\.Browser\\/([0-9.]+)/iu', 'details' => 2, 'type' => Constants\DeviceType::MOBILE], ['name' => 'Openwave', 'id' => 'up', 'regexp' => '/UP\\/([0-9.]+)/u', 'details' => 2, 'type' => Constants\DeviceType::MOBILE], ['name' => 'SEMC Browser', 'id' => 'semc', 'regexp' => '/SEMC-Browser\\/([0-9.]*)/u'], ['name' => 'Sogou Mobile', 'id' => 'sogou', 'regexp' => '/SogouMobileBrowser\\/([0-9.]*)/u', 'details' => 2], ['name' => 'Swing Browser', 'id' => 'swing', 'regexp' => '/Swing\\(And\\)\\/([0-9.]*)/u', 'details' => 3], ['name' => 'Symphony', 'id' => 'symphony', 'regexp' => '/Symphony ([0-9.]+)$/u'], ['name' => 'WebLite', 'id' => 'weblite', 'regexp' => '/WebLite\\/([0-9.]*)/u', 'type' => Constants\DeviceType::MOBILE], ['name' => 'AltiBrowser', 'id' => 'alti', 'regexp' => '/AltiBrowser\\/([0-9.]*)/i'], ['name' => 'Aplix', 'id' => 'aplix', 'regexp' => '/Aplix_SANYO_browser\\/([0-9](?:.[0-9.]+)?)/u'], ['name' => 'AwoX', 'id' => 'awox', 'regexp' => '/AwoX(?:\\/([0-9.]*))? Browser/i'], ['name' => 'Isis', 'id' => 'browserserver', 'regexp' => '/BrowserServer/u'], ['name' => 'Isis', 'id' => 'isis', 'regexp' => '/ISIS\\/([0-9.]*)/u', 'details' => 2], ['name' => 'Spyglass', 'id' => 'spyglass', 'regexp' => '/Spyglass ([0-9.]+); OpenTV/u'], ['name' => 'Oregan Browser', 'id' => 'oregan', 'regexp' => '/OreganMediaBrowser(?:\\/([0-9.]*))?/u', 'details' => 2], ['name' => 'Viera Browser', 'id' => 'viera', 'regexp' => '/Viera\\/([0-9.]*)/u'], ['name' => 'Zetakey', 'id' => 'zetakey', 'regexp' => '/Zetakey Webkit\\/([0-9.]*)/u'], ['name' => 'Zetakey', 'id' => 'zetakey', 'regexp' => '/Zetakey\\/([0-9.]*)/u'], ['name' => 'Aplix', 'id' => 'aplix', 'regexp' => '/Aplix_SEGASATURN_browser\\/([0-9](?:.[0-9.]+)?)/u'], ['name' => 'Bunjalloo', 'id' => 'bunjalloo', 'regexp' => '/Bunjalloo\\/([0-9.]*)/u'], ['name' => 'Nintendo Web Framework', 'id' => 'nwf', 'regexp' => '/NWF\\/([0-9.]*)/u', 'details' => 2], ['name' => 'Nuanti Meta', 'id' => 'nuanti', 'regexp' => '/Nuanti(?:Meta)?\\/([0-9.]*)/u'], ['name' => 'Wear Internet Browser', 'id' => 'wib', 'regexp' => '/WIB\\/([0-9.]*)/u'], ['name' => 'Prince', 'id' => 'prince', 'regexp' => '/Prince\\/([0-9.]*)/u'], ['name' => 'Demobrowser', 'id' => 'demobrowser', 'regexp' => '/demobrowser\\/([0-9.]*)/u'], ['name' => 'Dooble', 'id' => 'dooble', 'regexp' => '/Dooble(?:\\/([0-9.]*))?/u'], ['name' => 'DWB', 'id' => 'dwb', 'regexp' => '/dwb(?:-hg)?(?:\\/([0-9.]*))?/u'], ['name' => 'EVM Browser', 'id' => 'evm', 'regexp' => '/EVMBrowser\\/([0-9.]*)/u'], ['name' => 'FireWeb', 'id' => 'fireweb', 'regexp' => '/FireWeb\\/([0-9.]*)/u'], ['name' => 'Hive Explorer', 'id' => 'hive', 'regexp' => '/HiveE/u'], ['name' => 'Intermec Browser', 'id' => 'intermec', 'regexp' => '/Intermec\\/([0-9.]*)/u', 'details' => 2], ['name' => 'Phantom', 'id' => 'phantom', 'regexp' => '/Phantom\\/V([0-9.]*)/u'], ['name' => 'QtCreator', 'id' => 'qt', 'regexp' => '/QtCreator\\/([0-9.]*)/u'], ['name' => 'QtQmlViewer', 'id' => 'qt', 'regexp' => '/QtQmlViewer/u'], ['name' => 'QtMiniBrowser', 'id' => 'qt', 'regexp' => '/QtMiniBrowser\\/([0-9.]*)/u'], ['name' => 'QtTestBrowser', 'id' => 'qt', 'regexp' => '/QtTestBrowser\\/([0-9.]*)/u'], ['name' => 'Roccat', 'id' => 'roccat', 'regexp' => '/Roccat\\/([0-9]\\.[0-9.]*)/u'], ['name' => 'Raven for Mac', 'id' => 'raven', 'regexp' => '/Raven for Mac\\/([0-9.]*)/u'], ['name' => 'RockMelt', 'id' => 'rockmelt', 'regexp' => '/RockMelt\\/([0-9.]*)/u', 'details' => 2], ['name' => 'Scope', 'id' => 'scope', 'regexp' => '/Scope\\/([0-9.]*)/u', 'details' => 2], ['name' => 'SlimBoat', 'id' => 'slim', 'regexp' => '/SlimBoat\\/([0-9.]*)/u'], ['name' => 'SlimBrowser', 'id' => 'slim', 'regexp' => '/SlimBrowser(?:\\/([0-9.]*))?/u'], ['name' => 'SMBrowser', 'id' => 'smbrowser', 'regexp' => '/SMBrowser/u'], ['name' => 'Snowshoe', 'id' => 'snowshoe', 'regexp' => '/Snowshoe\\/([0-9.]*)/u', 'details' => 2], ['name' => 'Sputnik', 'id' => 'sputnik', 'regexp' => '/Sputnik\\/([0-9.]*)/iu', 'details' => 3], ['name' => 'Surf', 'id' => 'surf', 'regexp' => '/Surf\\/([0-9.]*)/u'], ['name' => 'TaoBrowser', 'id' => 'tao', 'regexp' => '/TaoBrowser\\/([0-9.]*)/u', 'details' => 2], ['name' => 'TaomeeBrowser', 'id' => 'tao', 'regexp' => '/TaomeeBrowser\\/([0-9.]*)/u', 'details' => 2], ['name' => 'TazWeb', 'id' => 'taz', 'regexp' => '/TazWeb/u'], ['name' => 'Uzbl', 'id' => 'uzbl', 'regexp' => '/^Uzbl/u'], ['name' => 'Villanova', 'id' => 'villanova', 'regexp' => '/Villanova\\/([0-9.]*)/u', 'details' => 3], ['name' => 'Vimb', 'id' => 'vimb', 'regexp' => '/vimb\\/([0-9.]*)/u'], ['name' => 'WADA Browser', 'id' => 'wada', 'regexp' => '/WadaBrowser\\/([0-9.]*)/u'], ['name' => 'Wavelink Velocity', 'id' => 'wavelink', 'regexp' => '/Wavelink Velocity Browser\\/([0-9.]*)/u', 'details' => 2], ['name' => 'WebRender', 'id' => 'webrender', 'regexp' => '/WebRender/u'], ['name' => 'Webster', 'id' => 'webster', 'regexp' => '/Webster ([0-9.]*)/u'], ['name' => 'Wyzo', 'id' => 'wyzo', 'regexp' => '/Wyzo\\/([0-9.]*)/u', 'details' => 3], ['name' => 'Yelang', 'id' => 'yelang', 'regexp' => '/Yelang\\/([0-9.]*)/u', 'details' => 3], ['name' => 'YRC Weblink', 'id' => 'yrcweb', 'regexp' => '/YRCWeblink\\/([0-9.]*)/u'], ['name' => '冲浪浏览器', 'id' => 'surf', 'regexp' => '/CMSurfClient-Android/u']], Constants\BrowserType::BROWSER_TEXT => [['name' => 'CERN LineMode', 'id' => 'linemode', 'regexp' => '/CERN-LineMode\\/([0-9.]*)/u'], ['name' => 'Lynx', 'id' => 'lynx', 'regexp' => '/Lynx\\/([0-9.]*)/u'], ['name' => 'Lynx', 'id' => 'lynx', 'regexp' => '/Lynx \\(textmode\\)/u'], ['name' => 'ELinks', 'id' => 'links', 'regexp' => '/E[Ll]inks(?:\\/| \\()([0-9.]*[0-9])/u', 'type' => Constants\DeviceType::DESKTOP], ['name' => 'Links', 'id' => 'links', 'regexp' => '/Links \\(([0-9.]*)/u'], ['name' => 'w3m', 'id' => 'w3m', 'regexp' => '/w3m\\/([0-9.]*)/u']], Constants\BrowserType::UNKNOWN => [['name' => 'PhantomJS', 'id' => 'phantom', 'regexp' => '/PhantomJS\\/([0-9.]*)/u'], ['name' => 'Nimbus', 'id' => 'nimbus', 'regexp' => '/Nimbus\\/([0-9.]*)/u'], ['name' => 'McAfee Web Gateway', 'id' => 'Webwasher', 'regexp' => '/Webwasher\\/([0-9.]*)/u'], ['name' => 'Open Sankoré', 'id' => 'sankore', 'regexp' => '/Open-Sankore\\/([0-9.]*)/u', 'type' => Constants\DeviceType::WHITEBOARD], ['name' => 'Adapi', 'id' => 'adapi', 'regexp' => '/ ADAPI\\/([0-9.]*)/u', 'hidden' => true, 'type' => Constants\DeviceType::SIGNAGE], ['name' => 'BrightSign', 'id' => 'brightsign', 'regexp' => '/BrightSign\\/([0-9.]*)/u', 'type' => Constants\DeviceType::SIGNAGE], ['name' => 'Coship MMCP', 'id' => 'coship', 'regexp' => '/Coship_MMCP_([0-9.]*)/u', 'type' => Constants\DeviceType::SIGNAGE]]];
Пример #3
0
 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']);
         }
     }
 }
Пример #4
0
<?php

namespace WhichBrowser\Data;

use WhichBrowser\Constants;
Applications::$OTHERS = [Constants\BrowserType::APP_MEDIAPLAYER => [['name' => 'iTunes', 'id' => 'itunes', 'regexp' => '/iTunes\\/(?:xaa.)?([0-9.]*)/u'], ['name' => 'iTunes', 'id' => 'itunes', 'regexp' => '/iTunes-AppleTV\\//u'], ['name' => 'QuickTime', 'id' => 'qt', 'regexp' => '/\\(qtver=([0-9.]*);/u'], ['name' => 'Bluefish', 'id' => 'bluefish', 'regexp' => '/bluefish ([0-9.]*)/u'], ['name' => 'Nightingale', 'id' => 'nightingale', 'regexp' => '/Nightingale\\/([0-9.]*)/u'], ['name' => 'Songbird', 'id' => 'songbird', 'regexp' => '/Songbird\\/([0-9.]*)/u'], ['name' => 'Stagefright', 'id' => 'stagefright', 'regexp' => '/stagefright\\/([0-9.]*)/u'], ['name' => 'SubStream', 'id' => 'substream', 'regexp' => '/SubStream\\/([0-9.]*)/u', 'type' => Constants\DeviceType::MOBILE], ['name' => 'VLC', 'id' => 'vlc', 'regexp' => '/VLC media player - version ([0-9.]*)/u'], ['name' => 'VLC', 'id' => 'vlc', 'regexp' => '/VLC\\/([0-9.]*)/u'], ['name' => 'Windows Media Player', 'id' => 'windows-media', 'regexp' => '/Windows-Media-Player\\/([0-9.]*)/u', 'details' => 1], ['name' => 'CorePlayer', 'id' => 'coreplayer', 'regexp' => '/CorePlayer\\/([0-9.]*)/u'], ['name' => 'FlyCast', 'id' => 'flycast', 'regexp' => '/FlyCast\\/([0-9.]*)/u'], ['name' => 'Boxee', 'id' => 'boxee', 'regexp' => '/Boxee(?:\\/([0-9.]*))?/u', 'type' => Constants\DeviceType::TELEVISION], ['name' => 'Kodi', 'id' => 'kodi', 'regexp' => '/^Kodi\\/([0-9.]+)/u', 'details' => 2], ['name' => 'XBMC', 'id' => 'xbmc', 'regexp' => '/^XBMC\\/(?:PRE-)?([0-9.]+)/u', 'details' => 2]], Constants\BrowserType::APP_EMAIL => [['name' => 'Lightning', 'id' => 'lightning', 'regexp' => '/Lightning\\/([0-9.]*)/u'], ['name' => 'Thunderbird', 'id' => 'thunderbird', 'regexp' => '/Thunderbird[\\/ ]([0-9.]*)/u', 'type' => Constants\DeviceType::DESKTOP], ['name' => 'Microsoft Outlook', 'id' => 'outlook', 'regexp' => '/Microsoft Outlook IMO, Build ([0-9.]*)/u', 'details' => 2, 'type' => Constants\DeviceType::DESKTOP], ['name' => 'Microsoft Outlook', 'id' => 'outlook', 'regexp' => '/Microsoft Outlook ([0-9.]*)/u', 'details' => 2, 'type' => Constants\DeviceType::DESKTOP], ['name' => 'Microsoft Outlook Express', 'id' => 'outlook', 'regexp' => '/Outlook-Express\\/([0-9.]*)/u', 'details' => 2, 'type' => Constants\DeviceType::DESKTOP], ['name' => 'Lotus Notes', 'id' => 'lotus', 'regexp' => '/Lotus-Notes\\/([0-9.]*)/u', 'details' => 2, 'type' => Constants\DeviceType::DESKTOP], ['name' => 'Postbox', 'id' => 'postbox', 'regexp' => '/Postbox[\\/ ]([0-9.]*)/u', 'details' => 2], ['name' => 'The Bat!', 'id' => 'bat', 'regexp' => '/The Bat! ([0-9.]*)/u', 'details' => 3], ['name' => 'Yahoo Mail', 'id' => 'yahoo', 'regexp' => '/YahooMobile\\/1.0 \\(mail; ([0-9.]+)\\)/u', 'details' => 3]], Constants\BrowserType::APP_NEWS => [['name' => 'Daum', 'id' => 'daum', 'regexp' => '/DaumApps\\/([0-9.]*)/u'], ['name' => 'Daum', 'id' => 'daum', 'regexp' => '/daumcafe\\/([0-9.]*)/u']], Constants\BrowserType::APP_FEEDREADER => [['name' => 'Akregator', 'id' => 'akregator', 'regexp' => '/Akregator\\/([0-9.]*)/u'], ['name' => 'Blogos', 'id' => 'blogos', 'regexp' => '/Blogos\\/([0-9.]*)/u', 'type' => Constants\DeviceType::MOBILE], ['name' => 'Cococ', 'id' => 'cococ', 'regexp' => '/cococ\\/([0-9.]*)/u'], ['name' => 'FeedDemon', 'id' => 'feed', 'regexp' => '/FeedDemon\\/([0-9.]*)/u'], ['name' => 'Feeddler', 'id' => 'feed', 'regexp' => '/FeeddlerRSS[ \\/]([0-9.]*)/u'], ['name' => 'Feeddler Pro', 'id' => 'feed', 'regexp' => '/FeeddlerPro\\/([0-9.]*)/u'], ['name' => 'Liferea', 'id' => 'liferea', 'regexp' => '/Liferea\\/([0-9.]*)/u'], ['name' => 'NewsBlur', 'id' => 'news', 'regexp' => '/NewsBlur\\/([0-9.]*)/u', 'type' => Constants\DeviceType::MOBILE], ['name' => 'Newsbeuter', 'id' => 'news', 'regexp' => '/newsbeuter\\/([0-9.]*)/u'], ['name' => 'JetBrains Omea Reader', 'id' => 'jetbrains', 'regexp' => '/JetBrains Omea Reader ([0-9.]*)/u'], ['name' => 'RSS Bandit', 'id' => 'rss', 'regexp' => '/RssBandit\\/([0-9.]*)/u'], ['name' => 'RSS Junkie', 'id' => 'rss', 'regexp' => '/RSS Junkie Daemon/u'], ['name' => 'RSS Owl', 'id' => 'rss', 'regexp' => '/RSSOwl\\/([0-9.]*)/u'], ['name' => 'Reeder', 'id' => 'reeder', 'regexp' => '/Reeder\\/([0-9.]*)/u'], ['name' => 'ReedKit', 'id' => 'reedkit', 'regexp' => '/ReedKit\\/([0-9.]*)/u', 'type' => Constants\DeviceType::DESKTOP], ['name' => 'Rome', 'id' => 'rome', 'regexp' => '/Rome Client/u'], ['name' => 'jsRSS++', 'id' => 'rss', 'regexp' => '/jsRSS++\\/([0-9.]*)/u'], ['name' => 'Windows RSS Platorm', 'id' => 'rss', 'regexp' => '/Windows-RSS-Platform\\/([0-9.]*)/u']], Constants\BrowserType::APP_PODCAST => [['name' => 'Ziepod', 'id' => 'ziepod', 'regexp' => '/Ziepod\\+? ([0-9.]*)/u']], Constants\BrowserType::APP_CHAT => [['name' => 'Facebook Messenger', 'id' => 'messenger', 'regexp' => '/FBAN\\/MessengerForiOS/u'], ['name' => 'Kik', 'id' => 'kik', 'regexp' => '/Kik\\/([0-9.]*)/u'], ['name' => 'WeChat', 'id' => 'messenger', 'regexp' => '/MicroMessenger\\/([0-9.]*)/u'], ['name' => 'Yahoo Messenger', 'id' => 'yahoo', 'regexp' => '/YahooMobile\\/1.0 \\(im; ([0-9.]+)\\)/u', 'details' => 3], ['name' => 'Yammer', 'id' => 'yammer', 'regexp' => '/Yammer\\/([0-9.]*)/u', 'details' => 2]], Constants\BrowserType::APP_SOCIAL => [['name' => 'Facebook', 'id' => 'fbios', 'regexp' => '/FBAN\\/FBIOS/u'], ['name' => 'Facebook', 'id' => 'fb4a', 'regexp' => '/FBAN\\/FB4A/u'], ['name' => 'Facebook', 'id' => 'fb4a', 'regexp' => '/FB_IAB\\/FB4A/u'], ['name' => 'Google+', 'id' => 'googleplus', 'regexp' => '/com.google.GooglePlus/u'], ['name' => 'Instagram', 'id' => 'instagram', 'regexp' => '/Instagram ([0-9.]+)/u'], ['name' => 'Sina Weibo', 'id' => 'weibo', 'regexp' => '/weibo__([0-9.]*)/u'], ['name' => 'Tumblr', 'id' => 'tumblr', 'regexp' => '/Tumblr\\/([0-9.]*)/u'], ['name' => 'Twitter', 'id' => 'twitter', 'regexp' => '/TwitterAndroid/u'], ['name' => 'Twitter', 'id' => 'twitter', 'regexp' => '/Twitter for iPhone/u'], ['name' => 'WordPress', 'id' => 'wp-android', 'regexp' => '/wp-android\\/([0-9.]*)/u']], Constants\BrowserType::APP_OFFICE => [['name' => 'LibreOffice', 'id' => 'office', 'regexp' => '/LibreOffice/u'], ['name' => 'Microsoft Office', 'id' => 'office', 'regexp' => '/MSOffice ([0-9.]*)/u'], ['name' => 'Microsoft Office', 'id' => 'office', 'regexp' => '/Microsoft Office Mobile ?\\/([0-9.]*)/u'], ['name' => 'Microsoft Excel', 'id' => 'office', 'regexp' => '/Microsoft Office Excel ([0-9.]*)/u'], ['name' => 'Microsoft OneNote', 'id' => 'office', 'regexp' => '/Microsoft Office OneNote ([0-9.]*)/u'], ['name' => 'Microsoft PowerPoint', 'id' => 'office', 'regexp' => '/Microsoft Office PowerPoint ([0-9.]*)/u'], ['name' => 'Microsoft Word', 'id' => 'office', 'regexp' => '/Microsoft Office Word ([0-9.]*)/u'], ['name' => 'OpenOffice', 'id' => 'office', 'regexp' => '/OpenOffice\\/([0-9.]*)/u']], Constants\BrowserType::APP_SEARCH => [['name' => 'Baidu Hao123', 'id' => 'hao123', 'regexp' => '/hao123\\/([0-9.]*)/u', 'details' => 2], ['name' => 'Google Search', 'id' => 'gsa', 'regexp' => '/GSA\\/([0-9.]*)/u', 'details' => 3], ['name' => 'NAVER', 'id' => 'naver', 'regexp' => '/NAVER\\(inapp; search; [0-9]+; ([0-9.]*)\\)/u']], Constants\BrowserType::APP_EDITOR => [['name' => 'Atom', 'id' => 'atom', 'regexp' => '/Atom\\/([0-9.]*)/u'], ['name' => 'Adobe GoLive', 'id' => 'golive', 'regexp' => '/GoLive ([0-9.]*)/u'], ['name' => 'Brackets', 'id' => 'brackets', 'regexp' => '/Brackets\\/([0-9.]*)/u'], ['name' => 'iWeb', 'id' => 'iweb', 'regexp' => '/iWeb\\/([0-9])/u'], ['name' => 'Microsoft FrontPage', 'id' => 'frontpage', 'regexp' => '/MS ?FrontPage[ \\/]([0-9.]*)/u', 'details' => 2, 'type' => Constants\DeviceType::DESKTOP], ['name' => 'W3C Amaya', 'id' => 'amaya', 'regexp' => '/amaya\\/([0-9.]*)/u']], Constants\BrowserType::APP_DOWNLOAD => [['name' => 'Download Manager', 'id' => 'download', 'regexp' => '/AndroidDownloadManager\\//u']], Constants\BrowserType::APP_GAME => [['name' => 'EA Origin', 'id' => 'origin', 'regexp' => '/Origin\\/([0-9.]*)/u'], ['name' => 'SecondLife', 'id' => 'secondlife', 'regexp' => '/SecondLife\\/([0-9.]*)/u'], ['name' => 'Valve Steam', 'id' => 'valve', 'regexp' => '/Valve Steam/u'], ['name' => 'Raptr', 'id' => 'raptr', 'regexp' => '/Raptr/u']], Constants\BrowserType::APP => [['name' => 'Cooliris', 'id' => 'cooliris', 'regexp' => '/Cooliris\\/([0-9.]*)/u'], ['name' => 'Google Earth', 'id' => 'google', 'regexp' => '/Google Earth\\/([0-9.]*)/u', 'details' => 2], ['name' => 'Google Desktop', 'id' => 'google', 'regexp' => '/Google Desktop\\/([0-9.]*)/u', 'details' => 2], ['name' => 'Leechcraft', 'id' => 'leechcraft', 'regexp' => '/Leechcraft(?:\\/([0-9.]*))?/u', 'details' => 2], ['name' => 'Lotus Expeditor', 'id' => 'expeditor', 'regexp' => '/Gecko Expeditor ([0-9.]*)/u', 'details' => 3]]];