protected function checkPlatformVersion()
    {
        $result = '';
        switch ($this->getPlatform()) {
            case self::PLATFORM_WINDOWS:
                if (preg_match('/Windows NT\s*(\d+(?:\.\d+)*)/i', $this->_agent, $foundVersion)) {
                    $result = 'NT ' . $foundVersion[1];
                } else {
                    //https://support.microsoft.com/en-us/kb/158238

                    if ($this->containString($this->_agent, array('Windows XP', 'WinXP', 'Win XP'))) {
                        $result = '5.1';
                    } else if ($this->containString($this->_agent, 'Windows 2000', 'Win 2000', 'Win2000')) {
                        $result = '5.0';
                    } else if ($this->containString($this->_agent, array('Win 9x 4.90', 'Windows ME', 'WinME', 'Win ME'))) {
                        $result = '4.90.3000'; //Windows Me version range from 4.90.3000 to 4.90.3000A
                    } else if ($this->containString($this->_agent, array('Windows 98', 'Win98', 'Win 98'))) {
                        $result = '4.10'; //Windows 98 version range from 4.10.1998 to 4.10.2222B
                    } else if ($this->containString($this->_agent, array('Windows 95', 'Win95', 'Win 95'))) {
                        $result = '4.00'; //Windows 95 version range from 4.00.950 to 4.03.1214
                    } else if (($foundAt = stripos($this->_agent, 'Windows 3')) !== false) {
                        $result = '3';
                        if (preg_match('/\d+(?:\.\d+)*/', substr($this->_agent, $foundAt + strlen('Windows 3')), $foundVersion)) {
                            $result .= '.' . $foundVersion[0];
                        }
                    } else if ($this->containString($this->_agent, 'Win16')) {
                        $result = '3.1';
                    }
                }
                break;

            case self::PLATFORM_MACINTOSH:
                if (preg_match('/Mac OS X\s*(\d+(?:_\d+)+)/i', $this->_agent, $foundVersion)) {
                    $result = str_replace('_', '.', $this->cleanVersion($foundVersion[1]));
                } else if ($this->containString($this->_agent, 'Mac OS X')) {
                    $result = '10';
                }
                break;

            case self::PLATFORM_ANDROID:
                if (preg_match('/Android\s+([^\s;$]+)/i', $this->_agent, $foundVersion)) {
                    $result = $this->cleanVersion($foundVersion[1]);
                }
                break;

            case self::PLATFORM_IOS:
                if (preg_match('/(?:CPU OS|iPhone OS|iOS)[\s_]*([\d_]+)/i', $this->_agent, $foundVersion)) {
                    $result = str_replace('_', '.', $this->cleanVersion($foundVersion[1]));
                }
                break;
        }

        if (trim($result) == '') {
            $result = self::PLATFORM_VERSION_UNKNOWN;
        }
        $this->setPlatformVersion($result);
    }
protected function checkPlatformVersion()
    {
        $result = '';
        switch ($this->getPlatform()) {
            case self::PLATFORM_WINDOWS:
                if (preg_match('/Windows NT\s*(\d+(?:\.\d+)*)/i', $this->_agent, $foundVersion)) {
                    $result = 'NT ' . $foundVersion[1];
                } else {
                    //https://support.microsoft.com/en-us/kb/158238

                    if ($this->containString($this->_agent, array('Windows XP', 'WinXP', 'Win XP'))) {
                        $result = '5.1';
                    } else if ($this->containString($this->_agent, 'Windows 2000', 'Win 2000', 'Win2000')) {
                        $result = '5.0';
                    } else if ($this->containString($this->_agent, array('Win 9x 4.90', 'Windows ME', 'WinME', 'Win ME'))) {
                        $result = '4.90.3000'; //Windows Me version range from 4.90.3000 to 4.90.3000A
                    } else if ($this->containString($this->_agent, array('Windows 98', 'Win98', 'Win 98'))) {
                        $result = '4.10'; //Windows 98 version range from 4.10.1998 to 4.10.2222B
                    } else if ($this->containString($this->_agent, array('Windows 95', 'Win95', 'Win 95'))) {
                        $result = '4.00'; //Windows 95 version range from 4.00.950 to 4.03.1214
                    } else if (($foundAt = stripos($this->_agent, 'Windows 3')) !== false) {
                        $result = '3';
                        if (preg_match('/\d+(?:\.\d+)*/', substr($this->_agent, $foundAt + strlen('Windows 3')), $foundVersion)) {
                            $result .= '.' . $foundVersion[0];
                        }
                    } else if ($this->containString($this->_agent, 'Win16')) {
                        $result = '3.1';
                    }
                }
                break;

            case self::PLATFORM_MACINTOSH:
                if (preg_match('/Mac OS X\s*(\d+(?:_\d+)+)/i', $this->_agent, $foundVersion)) {
                    $result = str_replace('_', '.', $this->cleanVersion($foundVersion[1]));
                } else if ($this->containString($this->_agent, 'Mac OS X')) {
                    $result = '10';
                }
                break;

            case self::PLATFORM_ANDROID:
                if (preg_match('/Android\s+([^\s;$]+)/i', $this->_agent, $foundVersion)) {
                    $result = $this->cleanVersion($foundVersion[1]);
                }
                break;

            case self::PLATFORM_IOS:
                if (preg_match('/(?:CPU OS|iPhone OS|iOS)[\s_]*([\d_]+)/i', $this->_agent, $foundVersion)) {
                    $result = str_replace('_', '.', $this->cleanVersion($foundVersion[1]));
                }
                break;
        }

        if (trim($result) == '') {
            $result = self::PLATFORM_VERSION_UNKNOWN;
        }
        $this->setPlatformVersion($result);
    }
protected function checkPlatformVersion ( ) { $ result = '' ; switch ( $ this -> getPlatform ( ) ) { case self :: PLATFORM_WINDOWS : if ( preg_match ( '/Windows NT\s*(\d+(?:\.\d+)*)/i' , $ this -> _agent , $ foundVersion ) ) { $ result = 'NT ' . $ foundVersion [ 1 ] ; } else { //https://support.microsoft.com/en-us/kb/158238 if ( $ this -> containString ( $ this -> _agent , array ( 'Windows XP' , 'WinXP' , 'Win XP' ) ) ) { $ result = '5.1' ; } else if ( $ this -> containString ( $ this -> _agent , 'Windows 2000' , 'Win 2000' , 'Win2000' ) ) { $ result = '5.0' ; } else if ( $ this -> containString ( $ this -> _agent , array ( 'Win 9x 4.90' , 'Windows ME' , 'WinME' , 'Win ME' ) ) ) { $ result = '4.90.3000' ; //Windows Me version range from 4.90.3000 to 4.90.3000A } else if ( $ this -> containString ( $ this -> _agent , array ( 'Windows 98' , 'Win98' , 'Win 98' ) ) ) { $ result = '4.10' ; //Windows 98 version range from 4.10.1998 to 4.10.2222B } else if ( $ this -> containString ( $ this -> _agent , array ( 'Windows 95' , 'Win95' , 'Win 95' ) ) ) { $ result = '4.00' ; //Windows 95 version range from 4.00.950 to 4.03.1214 } else if ( ( $ foundAt = stripos ( $ this -> _agent , 'Windows 3' ) ) !== false ) { $ result = '3' ; if ( preg_match ( '/\d+(?:\.\d+)*/' , substr ( $ this -> _agent , $ foundAt + strlen ( 'Windows 3' ) ) , $ foundVersion ) ) { $ result .= '.' . $ foundVersion [ 0 ] ; } } else if ( $ this -> containString ( $ this -> _agent , 'Win16' ) ) { $ result = '3.1' ; } } break ; case self :: PLATFORM_MACINTOSH : if ( preg_match ( '/Mac OS X\s*(\d+(?:_\d+)+)/i' , $ this -> _agent , $ foundVersion ) ) { $ result = str_replace ( '_' , '.' , $ this -> cleanVersion ( $ foundVersion [ 1 ] ) ) ; } else if ( $ this -> containString ( $ this -> _agent , 'Mac OS X' ) ) { $ result = '10' ; } break ; case self :: PLATFORM_ANDROID : if ( preg_match ( '/Android\s+([^\s;$]+)/i' , $ this -> _agent , $ foundVersion ) ) { $ result = $ this -> cleanVersion ( $ foundVersion [ 1 ] ) ; } break ; case self :: PLATFORM_IOS : if ( preg_match ( '/(?:CPU OS|iPhone OS|iOS)[\s_]*([\d_]+)/i' , $ this -> _agent , $ foundVersion ) ) { $ result = str_replace ( '_' , '.' , $ this -> cleanVersion ( $ foundVersion [ 1 ] ) ) ; } break ; } if ( trim ( $ result ) == '' ) { $ result = self :: PLATFORM_VERSION_UNKNOWN ; } $ this -> setPlatformVersion ( $ result ) ; }
Determine the user's platform version.
@access protected
Determine the user s platform version .