Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | n/a |
0 / 0 |
n/a |
0 / 0 |
CRAP | n/a |
0 / 0 |
|||
| UserAgents | n/a |
0 / 0 |
n/a |
0 / 0 |
0 | n/a |
0 / 0 |
|||
| 1 | <?php |
| 2 | |
| 3 | namespace Config; |
| 4 | |
| 5 | use CodeIgniter\Config\BaseConfig; |
| 6 | |
| 7 | /** |
| 8 | * ------------------------------------------------------------------- |
| 9 | * User Agents |
| 10 | * ------------------------------------------------------------------- |
| 11 | * |
| 12 | * This file contains four arrays of user agent data. It is used by the |
| 13 | * User Agent Class to help identify browser, platform, robot, and |
| 14 | * mobile device data. The array keys are used to identify the device |
| 15 | * and the array values are used to set the actual name of the item. |
| 16 | */ |
| 17 | class UserAgents extends BaseConfig |
| 18 | { |
| 19 | /** |
| 20 | * ------------------------------------------------------------------- |
| 21 | * OS Platforms |
| 22 | * ------------------------------------------------------------------- |
| 23 | * |
| 24 | * @var array<string, string> |
| 25 | */ |
| 26 | public array $platforms = [ |
| 27 | 'windows nt 10.0' => 'Windows 10', |
| 28 | 'windows nt 6.3' => 'Windows 8.1', |
| 29 | 'windows nt 6.2' => 'Windows 8', |
| 30 | 'windows nt 6.1' => 'Windows 7', |
| 31 | 'windows nt 6.0' => 'Windows Vista', |
| 32 | 'windows nt 5.2' => 'Windows 2003', |
| 33 | 'windows nt 5.1' => 'Windows XP', |
| 34 | 'windows nt 5.0' => 'Windows 2000', |
| 35 | 'windows nt 4.0' => 'Windows NT 4.0', |
| 36 | 'winnt4.0' => 'Windows NT 4.0', |
| 37 | 'winnt 4.0' => 'Windows NT', |
| 38 | 'winnt' => 'Windows NT', |
| 39 | 'windows 98' => 'Windows 98', |
| 40 | 'win98' => 'Windows 98', |
| 41 | 'windows 95' => 'Windows 95', |
| 42 | 'win95' => 'Windows 95', |
| 43 | 'windows phone' => 'Windows Phone', |
| 44 | 'windows' => 'Unknown Windows OS', |
| 45 | 'android' => 'Android', |
| 46 | 'blackberry' => 'BlackBerry', |
| 47 | 'iphone' => 'iOS', |
| 48 | 'ipad' => 'iOS', |
| 49 | 'ipod' => 'iOS', |
| 50 | 'os x' => 'Mac OS X', |
| 51 | 'ppc mac' => 'Power PC Mac', |
| 52 | 'freebsd' => 'FreeBSD', |
| 53 | 'ppc' => 'Macintosh', |
| 54 | 'linux' => 'Linux', |
| 55 | 'debian' => 'Debian', |
| 56 | 'sunos' => 'Sun Solaris', |
| 57 | 'beos' => 'BeOS', |
| 58 | 'apachebench' => 'ApacheBench', |
| 59 | 'aix' => 'AIX', |
| 60 | 'irix' => 'Irix', |
| 61 | 'osf' => 'DEC OSF', |
| 62 | 'hp-ux' => 'HP-UX', |
| 63 | 'netbsd' => 'NetBSD', |
| 64 | 'bsdi' => 'BSDi', |
| 65 | 'openbsd' => 'OpenBSD', |
| 66 | 'gnu' => 'GNU/Linux', |
| 67 | 'unix' => 'Unknown Unix OS', |
| 68 | 'symbian' => 'Symbian OS', |
| 69 | ]; |
| 70 | |
| 71 | /** |
| 72 | * ------------------------------------------------------------------- |
| 73 | * Browsers |
| 74 | * ------------------------------------------------------------------- |
| 75 | * |
| 76 | * The order of this array should NOT be changed. Many browsers return |
| 77 | * multiple browser types so we want to identify the subtype first. |
| 78 | * |
| 79 | * @var array<string, string> |
| 80 | */ |
| 81 | public array $browsers = [ |
| 82 | 'OPR' => 'Opera', |
| 83 | 'Flock' => 'Flock', |
| 84 | 'Edge' => 'Spartan', |
| 85 | 'Edg' => 'Edge', |
| 86 | 'Chrome' => 'Chrome', |
| 87 | // Opera 10+ always reports Opera/9.80 and appends Version/<real version> to the user agent string |
| 88 | 'Opera.*?Version' => 'Opera', |
| 89 | 'Opera' => 'Opera', |
| 90 | 'MSIE' => 'Internet Explorer', |
| 91 | 'Internet Explorer' => 'Internet Explorer', |
| 92 | 'Trident.* rv' => 'Internet Explorer', |
| 93 | 'Shiira' => 'Shiira', |
| 94 | 'Firefox' => 'Firefox', |
| 95 | 'Chimera' => 'Chimera', |
| 96 | 'Phoenix' => 'Phoenix', |
| 97 | 'Firebird' => 'Firebird', |
| 98 | 'Camino' => 'Camino', |
| 99 | 'Netscape' => 'Netscape', |
| 100 | 'OmniWeb' => 'OmniWeb', |
| 101 | 'Safari' => 'Safari', |
| 102 | 'Mozilla' => 'Mozilla', |
| 103 | 'Konqueror' => 'Konqueror', |
| 104 | 'icab' => 'iCab', |
| 105 | 'Lynx' => 'Lynx', |
| 106 | 'Links' => 'Links', |
| 107 | 'hotjava' => 'HotJava', |
| 108 | 'amaya' => 'Amaya', |
| 109 | 'IBrowse' => 'IBrowse', |
| 110 | 'Maxthon' => 'Maxthon', |
| 111 | 'Ubuntu' => 'Ubuntu Web Browser', |
| 112 | 'Vivaldi' => 'Vivaldi', |
| 113 | ]; |
| 114 | |
| 115 | /** |
| 116 | * ------------------------------------------------------------------- |
| 117 | * Mobiles |
| 118 | * ------------------------------------------------------------------- |
| 119 | * |
| 120 | * @var array<string, string> |
| 121 | */ |
| 122 | public array $mobiles = [ |
| 123 | // legacy array, old values commented out |
| 124 | 'mobileexplorer' => 'Mobile Explorer', |
| 125 | // 'openwave' => 'Open Wave', |
| 126 | // 'opera mini' => 'Opera Mini', |
| 127 | // 'operamini' => 'Opera Mini', |
| 128 | // 'elaine' => 'Palm', |
| 129 | 'palmsource' => 'Palm', |
| 130 | // 'digital paths' => 'Palm', |
| 131 | // 'avantgo' => 'Avantgo', |
| 132 | // 'xiino' => 'Xiino', |
| 133 | 'palmscape' => 'Palmscape', |
| 134 | // 'nokia' => 'Nokia', |
| 135 | // 'ericsson' => 'Ericsson', |
| 136 | // 'blackberry' => 'BlackBerry', |
| 137 | // 'motorola' => 'Motorola' |
| 138 | |
| 139 | // Phones and Manufacturers |
| 140 | 'motorola' => 'Motorola', |
| 141 | 'nokia' => 'Nokia', |
| 142 | 'palm' => 'Palm', |
| 143 | 'iphone' => 'Apple iPhone', |
| 144 | 'ipad' => 'iPad', |
| 145 | 'ipod' => 'Apple iPod Touch', |
| 146 | 'sony' => 'Sony Ericsson', |
| 147 | 'ericsson' => 'Sony Ericsson', |
| 148 | 'blackberry' => 'BlackBerry', |
| 149 | 'cocoon' => 'O2 Cocoon', |
| 150 | 'blazer' => 'Treo', |
| 151 | 'lg' => 'LG', |
| 152 | 'amoi' => 'Amoi', |
| 153 | 'xda' => 'XDA', |
| 154 | 'mda' => 'MDA', |
| 155 | 'vario' => 'Vario', |
| 156 | 'htc' => 'HTC', |
| 157 | 'samsung' => 'Samsung', |
| 158 | 'sharp' => 'Sharp', |
| 159 | 'sie-' => 'Siemens', |
| 160 | 'alcatel' => 'Alcatel', |
| 161 | 'benq' => 'BenQ', |
| 162 | 'ipaq' => 'HP iPaq', |
| 163 | 'mot-' => 'Motorola', |
| 164 | 'playstation portable' => 'PlayStation Portable', |
| 165 | 'playstation 3' => 'PlayStation 3', |
| 166 | 'playstation vita' => 'PlayStation Vita', |
| 167 | 'hiptop' => 'Danger Hiptop', |
| 168 | 'nec-' => 'NEC', |
| 169 | 'panasonic' => 'Panasonic', |
| 170 | 'philips' => 'Philips', |
| 171 | 'sagem' => 'Sagem', |
| 172 | 'sanyo' => 'Sanyo', |
| 173 | 'spv' => 'SPV', |
| 174 | 'zte' => 'ZTE', |
| 175 | 'sendo' => 'Sendo', |
| 176 | 'nintendo dsi' => 'Nintendo DSi', |
| 177 | 'nintendo ds' => 'Nintendo DS', |
| 178 | 'nintendo 3ds' => 'Nintendo 3DS', |
| 179 | 'wii' => 'Nintendo Wii', |
| 180 | 'open web' => 'Open Web', |
| 181 | 'openweb' => 'OpenWeb', |
| 182 | |
| 183 | // Operating Systems |
| 184 | 'android' => 'Android', |
| 185 | 'symbian' => 'Symbian', |
| 186 | 'SymbianOS' => 'SymbianOS', |
| 187 | 'elaine' => 'Palm', |
| 188 | 'series60' => 'Symbian S60', |
| 189 | 'windows ce' => 'Windows CE', |
| 190 | |
| 191 | // Browsers |
| 192 | 'obigo' => 'Obigo', |
| 193 | 'netfront' => 'Netfront Browser', |
| 194 | 'openwave' => 'Openwave Browser', |
| 195 | 'mobilexplorer' => 'Mobile Explorer', |
| 196 | 'operamini' => 'Opera Mini', |
| 197 | 'opera mini' => 'Opera Mini', |
| 198 | 'opera mobi' => 'Opera Mobile', |
| 199 | 'fennec' => 'Firefox Mobile', |
| 200 | |
| 201 | // Other |
| 202 | 'digital paths' => 'Digital Paths', |
| 203 | 'avantgo' => 'AvantGo', |
| 204 | 'xiino' => 'Xiino', |
| 205 | 'novarra' => 'Novarra Transcoder', |
| 206 | 'vodafone' => 'Vodafone', |
| 207 | 'docomo' => 'NTT DoCoMo', |
| 208 | 'o2' => 'O2', |
| 209 | |
| 210 | // Fallback |
| 211 | 'mobile' => 'Generic Mobile', |
| 212 | 'wireless' => 'Generic Mobile', |
| 213 | 'j2me' => 'Generic Mobile', |
| 214 | 'midp' => 'Generic Mobile', |
| 215 | 'cldc' => 'Generic Mobile', |
| 216 | 'up.link' => 'Generic Mobile', |
| 217 | 'up.browser' => 'Generic Mobile', |
| 218 | 'smartphone' => 'Generic Mobile', |
| 219 | 'cellphone' => 'Generic Mobile', |
| 220 | ]; |
| 221 | |
| 222 | /** |
| 223 | * ------------------------------------------------------------------- |
| 224 | * Robots |
| 225 | * ------------------------------------------------------------------- |
| 226 | * |
| 227 | * There are hundred of bots but these are the most common. |
| 228 | * |
| 229 | * @var array<string, string> |
| 230 | */ |
| 231 | public array $robots = [ |
| 232 | 'googlebot' => 'Googlebot', |
| 233 | 'google-pagerenderer' => 'Google Page Renderer', |
| 234 | 'google-read-aloud' => 'Google Read Aloud', |
| 235 | 'google-safety' => 'Google Safety Bot', |
| 236 | 'msnbot' => 'MSNBot', |
| 237 | 'baiduspider' => 'Baiduspider', |
| 238 | 'bingbot' => 'Bing', |
| 239 | 'bingpreview' => 'BingPreview', |
| 240 | 'slurp' => 'Inktomi Slurp', |
| 241 | 'yahoo' => 'Yahoo', |
| 242 | 'ask jeeves' => 'Ask Jeeves', |
| 243 | 'fastcrawler' => 'FastCrawler', |
| 244 | 'infoseek' => 'InfoSeek Robot 1.0', |
| 245 | 'lycos' => 'Lycos', |
| 246 | 'yandex' => 'YandexBot', |
| 247 | 'mediapartners-google' => 'MediaPartners Google', |
| 248 | 'CRAZYWEBCRAWLER' => 'Crazy Webcrawler', |
| 249 | 'adsbot-google' => 'AdsBot Google', |
| 250 | 'feedfetcher-google' => 'Feedfetcher Google', |
| 251 | 'curious george' => 'Curious George', |
| 252 | 'ia_archiver' => 'Alexa Crawler', |
| 253 | 'MJ12bot' => 'Majestic-12', |
| 254 | 'Uptimebot' => 'Uptimebot', |
| 255 | 'duckduckbot' => 'DuckDuckBot', |
| 256 | 'sogou' => 'Sogou Spider', |
| 257 | 'exabot' => 'Exabot', |
| 258 | 'bot' => 'Generic Bot', |
| 259 | 'crawler' => 'Generic Crawler', |
| 260 | 'spider' => 'Generic Spider', |
| 261 | ]; |
| 262 | } |