Guesses OS type.

@return int
971751
protected function guessType()
    {
        $os = strtolower(PHP_OS);
        if (false !== strpos($os, 'cygwin')) {
            return self::OS_TYPE_CYGWIN;
        }
        if (false !== strpos($os, 'darwin')) {
            return self::OS_TYPE_DARWIN;
        }
        if (false !== strpos($os, 'bsd')) {
            return self::OS_TYPE_BSD;
        }
        if (0 === strpos($os, 'win')) {
            return self::OS_TYPE_WINDOWS;
        }

        return self::OS_TYPE_UNIX;
    }
982467
def get_os_type(self, version_text):  # pylint: disable=no-self-use
        """"""
        os_type = None
        if version_text is None:
            return os_type

        match = re.search("(XR|XE|NX-OS)", version_text)
        if match:
            os_type = match.group(1)
        else:
            os_type = 'IOS'

        if os_type == "XR":
            match = re.search("Build Information", version_text)
            if match:
                os_type = "eXR"
            match = re.search("XR Admin Software", version_text)
            if match:
                os_type = "Calvados"
        return os_type
984523
public function getDeviceKind()
    {
        $kind = 'unavailable';

        if ($this->isTablet()) {
            $kind = 'Tablet';
        } elseif ($this->isPhone()) {
            $kind = 'Phone';
        } elseif ($this->isComputer()) {
            $kind = 'Computer';
        }

        return $kind;
    }
586480
public function platform()
    {
        if (preg_match('/linux/i', $this->server['HTTP_USER_AGENT'])) {
            return 'linux';
        } elseif (preg_match('/macintosh|mac os x/i', $this->server['HTTP_USER_AGENT'])) {
            return 'mac';
        } elseif (preg_match('/windows|win32/i', $this->server['HTTP_USER_AGENT'])) {
            return 'windows';
        }
        return 'unknown';
    }
455219
function getType()
    {
        if($this->_type) {
            return $this->_type;
        }
        else {
            $myclass = get_class($this);
            return strtolower(substr($myclass, strrpos($myclass, '\\') + 1, -5));
        }
    }
466116
public function getServerOs()
    {
        if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
            return self::OS_WINDOWS;
        } else {
            if (strtoupper(substr(PHP_OS, 0, 3)) === 'MAC') {
                return self::OS_MAC;
            } else {
                return self::OS_LINUX;
            }
        }
    }
31453
private function _get_Win32_OperatingSystem()
    {
        if ($this->_Win32_OperatingSystem === null) $this->_Win32_OperatingSystem = CommonFunctions::getWMI($this->_wmi, 'Win32_OperatingSystem', array('CodeSet', 'Locale', 'LastBootUpTime', 'LocalDateTime', 'Version', 'ServicePackMajorVersion', 'Caption', 'OSArchitecture', 'TotalVisibleMemorySize', 'FreePhysicalMemory'));
        return $this->_Win32_OperatingSystem;
    }
212811
function getOS()
    {
        $agent = $this->server['HTTP_USER_AGENT'];
        if (preg_match('/win/i', $agent) && strpos($agent, '95'))
        {
            $os = 'Windows 95';
        }
        elseif (preg_match('/win 9x/i', $agent) && strpos($agent, '4.90'))
        {
            $os = 'Windows ME';
        }
        elseif (preg_match('/win/i', $agent) && preg_match('/98/i', $agent))
        {
            $os = 'Windows 98';
        }
        elseif (preg_match('/win/i', $agent) && preg_match('/nt 6.0/i', $agent))
        {
            $os = 'Windows Vista';
        }
        elseif (preg_match('/win/i', $agent) && preg_match('/nt 6.1/i', $agent))
        {
            $os = 'Windows 7';
        }
        elseif (preg_match('/win/i', $agent) && preg_match('/nt 6.2/i', $agent))
        {
            $os = 'Windows 8';
        }
        elseif (preg_match('/win/i', $agent) && preg_match('/nt 10.0/i', $agent))
        {
            $os = 'Windows 10';
        }
        elseif (preg_match('/win/i', $agent) && preg_match('/nt 5.1/i', $agent))
        {
            $os = 'Windows XP';
        }
        elseif (preg_match('/win/i', $agent) && preg_match('/nt 5/i', $agent))
        {
            $os = 'Windows 2000';
        }
        elseif (preg_match('/win/i', $agent) && preg_match('/nt/i', $agent))
        {
            $os = 'Windows NT';
        }
        elseif (preg_match('/win/i', $agent) && preg_match('/32/i', $agent))
        {
            $os = 'Windows 32';
        }
        elseif (preg_match('/linux/i', $agent))
        {
            $os = 'Linux';
        }
        elseif (preg_match('/unix/i', $agent))
        {
            $os = 'Unix';
        }
        elseif (preg_match('/sun/i', $agent) && preg_match('/os/i', $agent))
        {
            $os = 'SunOS';
        }
        elseif (preg_match('/ibm/i', $agent) && preg_match('/os/i', $agent))
        {
            $os = 'IBM OS/2';
        }
        elseif (preg_match('/Mac/i', $agent) && preg_match('/PC/i', $agent))
        {
            $os = 'Macintosh';
        }
        elseif (preg_match('/PowerPC/i', $agent))
        {
            $os = 'PowerPC';
        }
        elseif (preg_match('/AIX/i', $agent))
        {
            $os = 'AIX';
        }
        elseif (preg_match('/HPUX/i', $agent))
        {
            $os = 'HPUX';
        }
        elseif (preg_match('/NetBSD/i', $agent))
        {
            $os = 'NetBSD';
        }
        elseif (preg_match('/BSD/i', $agent))
        {
            $os = 'BSD';
        }
        elseif (preg_match('/OSF1/i', $agent))
        {
            $os = 'OSF1';
        }
        elseif (preg_match('/IRIX/i', $agent))
        {
            $os = 'IRIX';
        }
        elseif (preg_match('/FreeBSD/i', $agent))
        {
            $os = 'FreeBSD';
        }
        elseif (preg_match('/teleport/i', $agent))
        {
            $os = 'teleport';
        }
        elseif (preg_match('/flashget/i', $agent))
        {
            $os = 'flashget';
        }
        elseif (preg_match('/webzip/i', $agent))
        {
            $os = 'webzip';
        }
        elseif (preg_match('/offline/i', $agent))
        {
            $os = 'offline';
        }
        else
        {
            $os = 'Unknown';
        }

        return $os;
    }
1139378
public static String getOsType() {
        String osType = "unknown";
        String osName = System.getProperty("os.name");
        if (osName.contains("Windows")) {
            osType = "Windows";
        }
        else if (osName.contains("Linux")) {
            osType = "Linux";
        }
        return osType;
    }
1045284
public function getIosType()
    {
        if ($this->platform !== Software::PLATFORM_IOS) {
            throw new \LogicException('Can\'t get type iOS in Mac software.');
        }

        if ($this->screenshotsIphone && $this->screenshotsIpad) {
            return Software::TYPE_IOS_UNIVERSAL;
        } else if ($this->screenshotsIphone) {
            return Software::TYPE_IOS_IPHONE;
        } else if ($this->screenshotsIpad) {
            return Software::TYPE_IOS_IPAD;
        } else {
            throw new \LogicException('Can\'t get type iOS. Undefined screenshots');
        }
    }
1170889
protected function getType()
  {
    if($this->currObj instanceof Server)
    {
      return "server";
    }
    elseif($this->currObj instanceof Channel)
    {
      return "channel";
    }
    elseif($this->currObj instanceof Client)
    {
      return "client";
    }
    elseif($this->currObj instanceof ServerGroup || $this->currObj instanceof ChannelGroup)
    {
      return "group";
    }

    return "host";
  }
301210
private OsType determineOsType(String imageId) {
        InspectImageResponse ir = getClient().inspectImageCmd(imageId).exec();
        if ("linux".equalsIgnoreCase(ir.getOs())) {
            LOG.trace("Detected LINUX operating system for image: {}", imageId);
            return OsType.LINUX;
        } else if ("windows".equalsIgnoreCase(ir.getOs())) {
            LOG.trace("Detected WINDOWS operating system for image: {}", imageId);
            return OsType.WINDOWS;
        } else {
            LOG.trace("Detected OTHER operating system ({}) for image: {}", ir.getOs(), imageId);
            return OsType.OTHER;
        }
    }
140144
public function getType() {
		if ($this->moufManager->getCode($this->getIdentifierName())===null) {
			return self::TYPE_DECLARATIVE;
		} else {
			return self::TYPE_PHP;
		}
	}
1103516
public function getType()
    {
        if($this->_type == null)
        {
            if($path = $this->getPath())
            {
                if(!$this->_type = @filetype($path)) {
                    $this->_type = self::TYPE_UNKNOWN;
                }
            }
        }

        return $this->_type;
    }
275284
static public function detectClientType()
    {
        $clientType       = static::PC;
        if (HttpHelper::isMobile()) {
            if (HttpHelper::isWechat()) {
                $clientType = static::WX;
            } elseif (HttpHelper::isAlipay()) {
                $clientType = static::ALIPAY;
            } else {
                $clientType = static::MOBILE;
            }
        }
        
        return $clientType;
    }
1060793
public function phpOs()
    {
        $os = PHP_OS;
        switch ($os) {
            case 'WINNT':
            case 'WINNT32':
            case 'WINNT64':
            case 'Windows':
                $c_os = 'Windows';
                break;
            case 'DragonFly':
            case 'FreeBSD':
            case 'NetBSD':
            case 'OpenBSD':
                $c_os = 'BSD';
                break;
            case 'Linux':
                $c_os = 'Linux';
                break;
            case 'SunOS':
                $c_os = 'Solaris';
                break;
            default:
                $c_os = 'Unknown';
                break;
         }

        return $c_os;
    }
799845
public function checkKernel()
    {
        $content = file_get_contents($this->kernelURL);

        $out = JSON::decode($content, true);

        if ($this->compaireSecondary($out->version, $this->kernel->version)
         && ($out->sha != $this->kernel->sha)) {
            return $out;
        } else {
            return false;
        }
    }