protected function windowsNTVerToStr($winVer, $returnServerFlavor = false)
    {
        //https://en.wikipedia.org/wiki/List_of_Microsoft_Windows_versions

        $cleanWinVer = explode('.', $winVer);
        while (count($cleanWinVer) > 2) {
            array_pop($cleanWinVer);
        }
        $cleanWinVer = implode('.', $cleanWinVer);

        if ($this->compareVersions($cleanWinVer, '11') >= 0) {
            //Future versions of Windows
            return self::PLATFORM_WINDOWS . ' ' . $winVer;
        } else if ($this->compareVersions($cleanWinVer, '10') >= 0) {
            //Current version of Windows
            return $returnServerFlavor ? (self::PLATFORM_WINDOWS . ' Server 2016') : (self::PLATFORM_WINDOWS . ' 10');
        } else if ($this->compareVersions($cleanWinVer, '7') < 0) {
            if ($this->compareVersions($cleanWinVer, '6.3') == 0) {
                return $returnServerFlavor ? (self::PLATFORM_WINDOWS . ' Server 2012 R2') : (self::PLATFORM_WINDOWS . ' 8.1');
            } else if ($this->compareVersions($cleanWinVer, '6.2') == 0) {
                return $returnServerFlavor ? (self::PLATFORM_WINDOWS . ' Server 2012') : (self::PLATFORM_WINDOWS . ' 8');
            } else if ($this->compareVersions($cleanWinVer, '6.1') == 0) {
                return $returnServerFlavor ? (self::PLATFORM_WINDOWS . ' Server 2008 R2') : (self::PLATFORM_WINDOWS . ' 7');
            } else if ($this->compareVersions($cleanWinVer, '6') == 0) {
                return $returnServerFlavor ? (self::PLATFORM_WINDOWS . ' Server 2008') : (self::PLATFORM_WINDOWS . ' Vista');
            } else if ($this->compareVersions($cleanWinVer, '5.2') == 0) {
                return $returnServerFlavor ? (self::PLATFORM_WINDOWS . ' Server 2003 / ' . self::PLATFORM_WINDOWS . ' Server 2003 R2') : (self::PLATFORM_WINDOWS . ' XP x64 Edition');
            } else if ($this->compareVersions($cleanWinVer, '5.1') == 0) {
                return self::PLATFORM_WINDOWS . ' XP';
            } else if ($this->compareVersions($cleanWinVer, '5') == 0) {
                return self::PLATFORM_WINDOWS . ' 2000';
            } else if ($this->compareVersions($cleanWinVer, '5') < 0 && $this->compareVersions($cleanWinVer, '3') >= 0) {
                return self::PLATFORM_WINDOWS . ' NT ' . $winVer;
            }
        }

        return self::PLATFORM_VERSION_UNKNOWN; //Invalid Windows NT version
    }
protected function windowsNTVerToStr($winVer, $returnServerFlavor = false)
    {
        //https://en.wikipedia.org/wiki/List_of_Microsoft_Windows_versions

        $cleanWinVer = explode('.', $winVer);
        while (count($cleanWinVer) > 2) {
            array_pop($cleanWinVer);
        }
        $cleanWinVer = implode('.', $cleanWinVer);

        if ($this->compareVersions($cleanWinVer, '11') >= 0) {
            //Future versions of Windows
            return self::PLATFORM_WINDOWS . ' ' . $winVer;
        } else if ($this->compareVersions($cleanWinVer, '10') >= 0) {
            //Current version of Windows
            return $returnServerFlavor ? (self::PLATFORM_WINDOWS . ' Server 2016') : (self::PLATFORM_WINDOWS . ' 10');
        } else if ($this->compareVersions($cleanWinVer, '7') < 0) {
            if ($this->compareVersions($cleanWinVer, '6.3') == 0) {
                return $returnServerFlavor ? (self::PLATFORM_WINDOWS . ' Server 2012 R2') : (self::PLATFORM_WINDOWS . ' 8.1');
            } else if ($this->compareVersions($cleanWinVer, '6.2') == 0) {
                return $returnServerFlavor ? (self::PLATFORM_WINDOWS . ' Server 2012') : (self::PLATFORM_WINDOWS . ' 8');
            } else if ($this->compareVersions($cleanWinVer, '6.1') == 0) {
                return $returnServerFlavor ? (self::PLATFORM_WINDOWS . ' Server 2008 R2') : (self::PLATFORM_WINDOWS . ' 7');
            } else if ($this->compareVersions($cleanWinVer, '6') == 0) {
                return $returnServerFlavor ? (self::PLATFORM_WINDOWS . ' Server 2008') : (self::PLATFORM_WINDOWS . ' Vista');
            } else if ($this->compareVersions($cleanWinVer, '5.2') == 0) {
                return $returnServerFlavor ? (self::PLATFORM_WINDOWS . ' Server 2003 / ' . self::PLATFORM_WINDOWS . ' Server 2003 R2') : (self::PLATFORM_WINDOWS . ' XP x64 Edition');
            } else if ($this->compareVersions($cleanWinVer, '5.1') == 0) {
                return self::PLATFORM_WINDOWS . ' XP';
            } else if ($this->compareVersions($cleanWinVer, '5') == 0) {
                return self::PLATFORM_WINDOWS . ' 2000';
            } else if ($this->compareVersions($cleanWinVer, '5') < 0 && $this->compareVersions($cleanWinVer, '3') >= 0) {
                return self::PLATFORM_WINDOWS . ' NT ' . $winVer;
            }
        }

        return self::PLATFORM_VERSION_UNKNOWN; //Invalid Windows NT version
    }
protected function windowsNTVerToStr ( $ winVer , $ returnServerFlavor = false ) { //https://en.wikipedia.org/wiki/List_of_Microsoft_Windows_versions $ cleanWinVer = explode ( '.' , $ winVer ) ; while ( count ( $ cleanWinVer ) > 2 ) { array_pop ( $ cleanWinVer ) ; } $ cleanWinVer = implode ( '.' , $ cleanWinVer ) ; if ( $ this -> compareVersions ( $ cleanWinVer , '11' ) >= 0 ) { //Future versions of Windows return self :: PLATFORM_WINDOWS . ' ' . $ winVer ; } else if ( $ this -> compareVersions ( $ cleanWinVer , '10' ) >= 0 ) { //Current version of Windows return $ returnServerFlavor ? ( self :: PLATFORM_WINDOWS . ' Server 2016' ) : ( self :: PLATFORM_WINDOWS . ' 10' ) ; } else if ( $ this -> compareVersions ( $ cleanWinVer , '7' ) < 0 ) { if ( $ this -> compareVersions ( $ cleanWinVer , '6.3' ) == 0 ) { return $ returnServerFlavor ? ( self :: PLATFORM_WINDOWS . ' Server 2012 R2' ) : ( self :: PLATFORM_WINDOWS . ' 8.1' ) ; } else if ( $ this -> compareVersions ( $ cleanWinVer , '6.2' ) == 0 ) { return $ returnServerFlavor ? ( self :: PLATFORM_WINDOWS . ' Server 2012' ) : ( self :: PLATFORM_WINDOWS . ' 8' ) ; } else if ( $ this -> compareVersions ( $ cleanWinVer , '6.1' ) == 0 ) { return $ returnServerFlavor ? ( self :: PLATFORM_WINDOWS . ' Server 2008 R2' ) : ( self :: PLATFORM_WINDOWS . ' 7' ) ; } else if ( $ this -> compareVersions ( $ cleanWinVer , '6' ) == 0 ) { return $ returnServerFlavor ? ( self :: PLATFORM_WINDOWS . ' Server 2008' ) : ( self :: PLATFORM_WINDOWS . ' Vista' ) ; } else if ( $ this -> compareVersions ( $ cleanWinVer , '5.2' ) == 0 ) { return $ returnServerFlavor ? ( self :: PLATFORM_WINDOWS . ' Server 2003 / ' . self :: PLATFORM_WINDOWS . ' Server 2003 R2' ) : ( self :: PLATFORM_WINDOWS . ' XP x64 Edition' ) ; } else if ( $ this -> compareVersions ( $ cleanWinVer , '5.1' ) == 0 ) { return self :: PLATFORM_WINDOWS . ' XP' ; } else if ( $ this -> compareVersions ( $ cleanWinVer , '5' ) == 0 ) { return self :: PLATFORM_WINDOWS . ' 2000' ; } else if ( $ this -> compareVersions ( $ cleanWinVer , '5' ) < 0 && $ this -> compareVersions ( $ cleanWinVer , '3' ) >= 0 ) { return self :: PLATFORM_WINDOWS . ' NT ' . $ winVer ; } } return self :: PLATFORM_VERSION_UNKNOWN ; //Invalid Windows NT version }
Convert the Windows NT family version numbers to the operating system name. For instance '5.1' returns
'Windows XP'.
@access protected
@param string $winVer The Windows NT family version numbers as a string.
@param boolean $returnServerFlavor (optional) Since some Windows NT versions have the same values, this flag
determines if the Server flavor is returned or not. For instance Windows 8.1 and Windows Server 2012 R2 both use
version 6.3.
@return string The operating system name or the constant PLATFORM_VERSION_UNKNOWN if nothing match the version
numbers.
Convert the Windows NT family version numbers to the operating system name . For instance 5 . 1 returns Windows XP .