Lines Matching refs:this

208 			$this->reset();
210 $this->setUserAgent($useragent);
213 $this->determine();
221 $this->_agent = isset($_SERVER['HTTP_USER_AGENT']) ? $_SERVER['HTTP_USER_AGENT'] : "";
222 $this->_browser_name = self::BROWSER_UNKNOWN;
223 $this->_version = self::VERSION_UNKNOWN;
224 $this->_platform = self::PLATFORM_UNKNOWN;
225 $this->_os = self::OPERATING_SYSTEM_UNKNOWN;
226 $this->_is_aol = false;
227 $this->_is_mobile = false;
228 $this->_is_robot = false;
229 $this->_aol_version = self::VERSION_UNKNOWN;
237 …function isBrowser($browserName) { return( 0 == strcasecmp($this->_browser_name, trim($browserName…
243 public function getBrowser() { return $this->_browser_name; }
248 public function setBrowser($browser) { return $this->_browser_name = $browser; }
253 public function getPlatform() { return $this->_platform; }
258 public function setPlatform($platform) { return $this->_platform = $platform; }
263 public function getVersion() { return $this->_version; }
268 …public function setVersion($version) { $this->_version = preg_replace('/[^0-9,.,a-z,A-Z-]/','',$ve…
273 public function getAolVersion() { return $this->_aol_version; }
278 …public function setAolVersion($version) { $this->_aol_version = preg_replace('/[^0-9,.,a-z,A-Z]/',…
283 public function isAol() { return $this->_is_aol; }
288 public function isMobile() { return $this->_is_mobile; }
293 public function isRobot() { return $this->_is_robot; }
298 public function setAol($isAol) { $this->_is_aol = $isAol; }
303 protected function setMobile($value=true) { $this->_is_mobile = $value; }
308 protected function setRobot($value=true) { $this->_is_robot = $value; }
313 public function getUserAgent() { return $this->_agent; }
319 $this->reset();
320 $this->_agent = $agent_string;
321 $this->determine();
329 return( strpos($this->_agent,"chromeframe") !== false );
336 return "<strong>Browser Name:</strong>{$this->getBrowser()}<br/>\n" .
337 "<strong>Browser Version:</strong>{$this->getVersion()}<br/>\n" .
338 "<strong>Browser User Agent String:</strong>{$this->getUserAgent()}<br/>\n" .
339 "<strong>Platform:</strong>{$this->getPlatform()}<br/>";
345 $this->checkPlatform();
346 $this->checkBrowsers();
347 $this->checkForAol();
367 $this->checkBrowserWebTv() ||
368 $this->checkBrowserInternetExplorer() ||
369 $this->checkBrowserOpera() ||
370 $this->checkBrowserGaleon() ||
371 $this->checkBrowserNetscapeNavigator9Plus() ||
372 $this->checkBrowserFirefox() ||
373 $this->checkBrowserChrome() ||
374 $this->checkBrowserOmniWeb() ||
377 $this->checkBrowserAndroid() ||
378 $this->checkBrowseriPad() ||
379 $this->checkBrowseriPod() ||
380 $this->checkBrowseriPhone() ||
381 $this->checkBrowserBlackBerry() ||
382 $this->checkBrowserNokia() ||
385 $this->checkBrowserGoogleBot() ||
386 $this->checkBrowserMSNBot() ||
387 $this->checkBrowserSlurp() ||
390 $this->checkBrowserSafari() ||
393 $this->checkBrowserNetPositive() ||
394 $this->checkBrowserFirebird() ||
395 $this->checkBrowserKonqueror() ||
396 $this->checkBrowserIcab() ||
397 $this->checkBrowserPhoenix() ||
398 $this->checkBrowserAmaya() ||
399 $this->checkBrowserLynx() ||
400 $this->checkBrowserShiretoko() ||
401 $this->checkBrowserIceCat() ||
402 $this->checkBrowserW3CValidator() ||
403 $this->checkBrowserMozilla() /* Mozilla is such an open standard that you must check it last */
412 if( stripos($this->_agent,'blackberry') !== false ) {
413 $aresult = explode("/",stristr($this->_agent,"BlackBerry"));
415 $this->setVersion($aversion[0]);
416 $this->_browser_name = self::BROWSER_BLACKBERRY;
417 $this->setMobile(true);
428 $this->setAol(false);
429 $this->setAolVersion(self::VERSION_UNKNOWN);
431 if( stripos($this->_agent,'aol') !== false ) {
432 $aversion = explode(' ',stristr($this->_agent, 'AOL'));
433 $this->setAol(true);
434 $this->setAolVersion(preg_replace('/[^0-9\.a-z]/i', '', $aversion[1]));
445 if( stripos($this->_agent,'googlebot') !== false ) {
446 $aresult = explode('/',stristr($this->_agent,'googlebot'));
448 $this->setVersion(str_replace(';','',$aversion[0]));
449 $this->_browser_name = self::BROWSER_GOOGLEBOT;
450 $this->setRobot(true);
461 if( stripos($this->_agent,"msnbot") !== false ) {
462 $aresult = explode("/",stristr($this->_agent,"msnbot"));
464 $this->setVersion(str_replace(";","",$aversion[0]));
465 $this->_browser_name = self::BROWSER_MSNBOT;
466 $this->setRobot(true);
477 if( stripos($this->_agent,'W3C-checklink') !== false ) {
478 $aresult = explode('/',stristr($this->_agent,'W3C-checklink'));
480 $this->setVersion($aversion[0]);
481 $this->_browser_name = self::BROWSER_W3CVALIDATOR;
484 else if( stripos($this->_agent,'W3C_Validator') !== false ) {
486 $ua = str_replace("W3C_Validator ", "W3C_Validator/", $this->_agent);
489 $this->setVersion($aversion[0]);
490 $this->_browser_name = self::BROWSER_W3CVALIDATOR;
501 if( stripos($this->_agent,'slurp') !== false ) {
502 $aresult = explode('/',stristr($this->_agent,'Slurp'));
504 $this->setVersion($aversion[0]);
505 $this->_browser_name = self::BROWSER_SLURP;
506 $this->setRobot(true);
507 $this->setMobile(false);
520 if( stripos($this->_agent,'microsoft internet explorer') !== false ) {
521 $this->setBrowser(self::BROWSER_IE);
522 $this->setVersion('1.0');
523 $aresult = stristr($this->_agent, '/');
525 $this->setVersion('1.5');
530 … else if( stripos($this->_agent,'msie') !== false && stripos($this->_agent,'opera') === false ) {
532 if( stripos($this->_agent,'msnb') !== false ) {
533 $aresult = explode(' ',stristr(str_replace(';','; ',$this->_agent),'MSN'));
534 $this->setBrowser( self::BROWSER_MSN );
535 $this->setVersion(str_replace(array('(',')',';'),'',$aresult[1]));
538 $aresult = explode(' ',stristr(str_replace(';','; ',$this->_agent),'msie'));
539 $this->setBrowser( self::BROWSER_IE );
540 $this->setVersion(str_replace(array('(',')',';'),'',$aresult[1]));
544 … else if( stripos($this->_agent,'mspie') !== false || stripos($this->_agent,'pocket') !== false ) {
545 $aresult = explode(' ',stristr($this->_agent,'mspie'));
546 $this->setPlatform( self::PLATFORM_WINDOWS_CE );
547 $this->setBrowser( self::BROWSER_POCKET_IE );
548 $this->setMobile(true);
550 if( stripos($this->_agent,'mspie') !== false ) {
551 $this->setVersion($aresult[1]);
554 $aversion = explode('/',$this->_agent);
555 $this->setVersion($aversion[1]);
567 if( stripos($this->_agent,'opera mini') !== false ) {
568 $resultant = stristr($this->_agent, 'opera mini');
572 $this->setVersion($aversion[0]);
576 $this->setVersion($aversion[1]);
578 $this->_browser_name = self::BROWSER_OPERA_MINI;
579 $this->setMobile(true);
582 else if( stripos($this->_agent,'opera') !== false ) {
583 $resultant = stristr($this->_agent, 'opera');
585 $this->setVersion($matches[1]);
590 $this->setVersion($aversion[0]);
594 $this->setVersion(isset($aversion[1])?$aversion[1]:"");
596 $this->_browser_name = self::BROWSER_OPERA;
607 if( stripos($this->_agent,'Chrome') !== false ) {
608 $aresult = explode('/',stristr($this->_agent,'Chrome'));
610 $this->setVersion($aversion[0]);
611 $this->setBrowser(self::BROWSER_CHROME);
623 if( stripos($this->_agent,'webtv') !== false ) {
624 $aresult = explode('/',stristr($this->_agent,'webtv'));
626 $this->setVersion($aversion[0]);
627 $this->setBrowser(self::BROWSER_WEBTV);
638 if( stripos($this->_agent,'NetPositive') !== false ) {
639 $aresult = explode('/',stristr($this->_agent,'NetPositive'));
641 $this->setVersion(str_replace(array('(',')',';'),'',$aversion[0]));
642 $this->setBrowser(self::BROWSER_NETPOSITIVE);
653 if( stripos($this->_agent,'galeon') !== false ) {
654 $aresult = explode(' ',stristr($this->_agent,'galeon'));
656 $this->setVersion($aversion[1]);
657 $this->setBrowser(self::BROWSER_GALEON);
668 if( stripos($this->_agent,'Konqueror') !== false ) {
669 $aresult = explode(' ',stristr($this->_agent,'Konqueror'));
671 $this->setVersion($aversion[1]);
672 $this->setBrowser(self::BROWSER_KONQUEROR);
683 if( stripos($this->_agent,'icab') !== false ) {
684 $aversion = explode(' ',stristr(str_replace('/',' ',$this->_agent),'icab'));
685 $this->setVersion($aversion[1]);
686 $this->setBrowser(self::BROWSER_ICAB);
697 if( stripos($this->_agent,'omniweb') !== false ) {
698 $aresult = explode('/',stristr($this->_agent,'omniweb'));
700 $this->setVersion($aversion[0]);
701 $this->setBrowser(self::BROWSER_OMNIWEB);
712 if( stripos($this->_agent,'Phoenix') !== false ) {
713 $aversion = explode('/',stristr($this->_agent,'Phoenix'));
714 $this->setVersion($aversion[1]);
715 $this->setBrowser(self::BROWSER_PHOENIX);
726 if( stripos($this->_agent,'Firebird') !== false ) {
727 $aversion = explode('/',stristr($this->_agent,'Firebird'));
728 $this->setVersion($aversion[1]);
729 $this->setBrowser(self::BROWSER_FIREBIRD);
741 …if( stripos($this->_agent,'Firefox') !== false && preg_match('/Navigator\/([^ ]*)/i',$this->_agent…
742 $this->setVersion($matches[1]);
743 $this->setBrowser(self::BROWSER_NETSCAPE_NAVIGATOR);
746 …else if( stripos($this->_agent,'Firefox') === false && preg_match('/Netscape6?\/([^ ]*)/i',$this->…
747 $this->setVersion($matches[1]);
748 $this->setBrowser(self::BROWSER_NETSCAPE_NAVIGATOR);
759 …if( stripos($this->_agent,'Mozilla') !== false && preg_match('/Shiretoko\/([^ ]*)/i',$this->_agent…
760 $this->setVersion($matches[1]);
761 $this->setBrowser(self::BROWSER_SHIRETOKO);
772 …if( stripos($this->_agent,'Mozilla') !== false && preg_match('/IceCat\/([^ ]*)/i',$this->_agent,$m…
773 $this->setVersion($matches[1]);
774 $this->setBrowser(self::BROWSER_ICECAT);
785 if( preg_match("/Nokia([^\/]+)\/([^ SP]+)/i",$this->_agent,$matches) ) {
786 $this->setVersion($matches[2]);
787 if( stripos($this->_agent,'Series60') !== false || strpos($this->_agent,'S60') !== false ) {
788 $this->setBrowser(self::BROWSER_NOKIA_S60);
791 $this->setBrowser( self::BROWSER_NOKIA );
793 $this->setMobile(true);
804 if( stripos($this->_agent,'safari') === false ) {
805 if( preg_match("/Firefox[\/ \(]([^ ;\)]+)/i",$this->_agent,$matches) ) {
806 $this->setVersion($matches[1]);
807 $this->setBrowser(self::BROWSER_FIREFOX);
810 else if( preg_match("/Firefox$/i",$this->_agent,$matches) ) {
811 $this->setVersion("");
812 $this->setBrowser(self::BROWSER_FIREFOX);
824 if( stripos($this->_agent,'Iceweasel') !== false ) {
825 $aresult = explode('/',stristr($this->_agent,'Iceweasel'));
827 $this->setVersion($aversion[0]);
828 $this->setBrowser(self::BROWSER_ICEWEASEL);
838 …if( stripos($this->_agent,'mozilla') !== false && preg_match('/rv:[0-9].[0-9][a-b]?/i',$this->_ag…
839 $aversion = explode(' ',stristr($this->_agent,'rv:'));
840 preg_match('/rv:[0-9].[0-9][a-b]?/i',$this->_agent,$aversion);
841 $this->setVersion(str_replace('rv:','',$aversion[0]));
842 $this->setBrowser(self::BROWSER_MOZILLA);
845 …else if( stripos($this->_agent,'mozilla') !== false && preg_match('/rv:[0-9]\.[0-9]/i',$this->_age…
846 $aversion = explode('',stristr($this->_agent,'rv:'));
847 $this->setVersion(str_replace('rv:','',$aversion[0]));
848 $this->setBrowser(self::BROWSER_MOZILLA);
851 …else if( stripos($this->_agent,'mozilla') !== false && preg_match('/mozilla\/([^ ]*)/i',$this->_a…
852 $this->setVersion($matches[1]);
853 $this->setBrowser(self::BROWSER_MOZILLA);
864 if( stripos($this->_agent,'lynx') !== false ) {
865 $aresult = explode('/',stristr($this->_agent,'Lynx'));
867 $this->setVersion($aversion[0]);
868 $this->setBrowser(self::BROWSER_LYNX);
879 if( stripos($this->_agent,'amaya') !== false ) {
880 $aresult = explode('/',stristr($this->_agent,'Amaya'));
882 $this->setVersion($aversion[0]);
883 $this->setBrowser(self::BROWSER_AMAYA);
894 …if( stripos($this->_agent,'Safari') !== false && stripos($this->_agent,'iPhone') === false && stri…
895 $aresult = explode('/',stristr($this->_agent,'Version'));
898 $this->setVersion($aversion[0]);
901 $this->setVersion(self::VERSION_UNKNOWN);
903 $this->setBrowser(self::BROWSER_SAFARI);
914 if( stripos($this->_agent,'iPhone') !== false ) {
915 $aresult = explode('/',stristr($this->_agent,'Version'));
918 $this->setVersion($aversion[0]);
921 $this->setVersion(self::VERSION_UNKNOWN);
923 $this->setMobile(true);
924 $this->setBrowser(self::BROWSER_IPHONE);
935 if( stripos($this->_agent,'iPad') !== false ) {
936 $aresult = explode('/',stristr($this->_agent,'Version'));
939 $this->setVersion($aversion[0]);
942 $this->setVersion(self::VERSION_UNKNOWN);
944 $this->setMobile(true);
945 $this->setBrowser(self::BROWSER_IPAD);
956 if( stripos($this->_agent,'iPod') !== false ) {
957 $aresult = explode('/',stristr($this->_agent,'Version'));
960 $this->setVersion($aversion[0]);
963 $this->setVersion(self::VERSION_UNKNOWN);
965 $this->setMobile(true);
966 $this->setBrowser(self::BROWSER_IPOD);
977 if( stripos($this->_agent,'Android') !== false ) {
978 $aresult = explode(' ',stristr($this->_agent,'Android'));
981 $this->setVersion($aversion[0]);
984 $this->setVersion(self::VERSION_UNKNOWN);
986 $this->setMobile(true);
987 $this->setBrowser(self::BROWSER_ANDROID);
997 if( stripos($this->_agent, 'windows') !== false ) {
998 $this->_platform = self::PLATFORM_WINDOWS;
1000 else if( stripos($this->_agent, 'iPad') !== false ) {
1001 $this->_platform = self::PLATFORM_IPAD;
1003 else if( stripos($this->_agent, 'iPod') !== false ) {
1004 $this->_platform = self::PLATFORM_IPOD;
1006 else if( stripos($this->_agent, 'iPhone') !== false ) {
1007 $this->_platform = self::PLATFORM_IPHONE;
1009 elseif( stripos($this->_agent, 'mac') !== false ) {
1010 $this->_platform = self::PLATFORM_APPLE;
1012 elseif( stripos($this->_agent, 'android') !== false ) {
1013 $this->_platform = self::PLATFORM_ANDROID;
1015 elseif( stripos($this->_agent, 'linux') !== false ) {
1016 $this->_platform = self::PLATFORM_LINUX;
1018 else if( stripos($this->_agent, 'Nokia') !== false ) {
1019 $this->_platform = self::PLATFORM_NOKIA;
1021 else if( stripos($this->_agent, 'BlackBerry') !== false ) {
1022 $this->_platform = self::PLATFORM_BLACKBERRY;
1024 elseif( stripos($this->_agent,'FreeBSD') !== false ) {
1025 $this->_platform = self::PLATFORM_FREEBSD;
1027 elseif( stripos($this->_agent,'OpenBSD') !== false ) {
1028 $this->_platform = self::PLATFORM_OPENBSD;
1030 elseif( stripos($this->_agent,'NetBSD') !== false ) {
1031 $this->_platform = self::PLATFORM_NETBSD;
1033 elseif( stripos($this->_agent, 'OpenSolaris') !== false ) {
1034 $this->_platform = self::PLATFORM_OPENSOLARIS;
1036 elseif( stripos($this->_agent, 'SunOS') !== false ) {
1037 $this->_platform = self::PLATFORM_SUNOS;
1039 elseif( stripos($this->_agent, 'OS\/2') !== false ) {
1040 $this->_platform = self::PLATFORM_OS2;
1042 elseif( stripos($this->_agent, 'BeOS') !== false ) {
1043 $this->_platform = self::PLATFORM_BEOS;
1045 elseif( stripos($this->_agent, 'win') !== false ) {
1046 $this->_platform = self::PLATFORM_WINDOWS;