Returns the remote system type.

@return string The remote system type
429753
public function systype() {
		$this->connectIfNeeded();
		$res = @ftp_systype($this->handle);
		return $res == null || $res == false ? 'UNIX' : $res;
	}
154065
public static function get_user_device_type() {
        $device = self::get_device_type();
        $switched = get_user_preferences('switchdevice'.$device, false);
        if ($switched != false) {
            return $switched;
        }
        return $device;
    }
181018
public static function getUserIp()
    {
        static $clientIp;
        
        if ($clientIp) {
            return $clientIp;
        }
        
        if (isset($_SERVER)) {
            if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
                $arr = explode(",", $_SERVER['HTTP_X_FORWARDED_FOR']);
                foreach ($arr as $ip) {
                    $ip = trim($ip);
                    if ($ip != "unknown") {
                        $clientIp = $ip;
                        break;
                    }
                }
            } elseif (isset($_SERVER['HTTP_CLIENT_IP'])) {
                $clientIp = $_SERVER['HTTP_CLIENT_IP'];
            } elseif (isset($_SERVER['REMOTE_ADDR'])) {
                $clientIp = $_SERVER['REMOTE_ADDR'];
            } else {
                $clientIp = "0.0.0.0";
            }
        } elseif (getenv("HTTP_X_FORWARDED_FOR")) {
            $clientIp = getenv("HTTP_X_FORWARDED_FOR");
        } elseif (getenv("HTTP_CLIENT_IP")) {
            $clientIp = getenv("HTTP_CLIENT_IP");
        } else {
            $clientIp = getenv("REMOTE_ADDR");
        }
        
        preg_match( "/[\\d\\.]{7,15}/", $clientIp, $onlineIp);
        $clientIp = !empty($onlineIp[0]) ? $onlineIp[0] : '0.0.0.0';
        
        $clientIp = preg_replace("/[^0-9\\.]/", '', $clientIp);
        
        return $clientIp;
    }
1021462
static function GetEnvType()
	{
		//
		//	RETURN	- environment type
		//		0	- production
		//		1	- pre-production
		//		2	- development
		//		3	- local
		//		4	- test
		//
		if ( ! is_array( $_SERVER ) ||
			! array_key_exists( 'SERVER_NAME', $_SERVER ) ||
			! is_string( $_SERVER[ 'SERVER_NAME' ] ) ||
			empty( $_SERVER[ 'SERVER_NAME' ] ) )
		{
			return self::ENV_UNKNOWN;
		}

		//	...
		$nRet = self::ENV_PRODUCTION;

		//	...
		$sServerName	= strtolower( trim( $_SERVER[ 'SERVER_NAME' ] ) );
		$sRootDomain	= strtolower( trim( self::ROOT_DOMAIN ) );

		if ( 0 == strcasecmp( $sServerName, $sRootDomain ) )
		{
			//	production
			$nRet	= self::ENV_PRODUCTION;
		}
		else if ( strstr( $sServerName, sprintf( "-pre.%s", $sRootDomain ) ) )
		{
			//	pre-production
			$nRet	= self::ENV_PRE_PRODUCTION;
		}
		else if ( strstr( $sServerName, sprintf( "-dev.%s", $sRootDomain ) ) )
		{
			//	development
			$nRet	= self::ENV_DEVELOPMENT;
		}
		else if ( strstr( $sServerName, sprintf( "-loc.%s", $sRootDomain ) ) )
		{
			//	local
			$nRet	= self::ENV_LOCAL;
		}
		else if ( strstr( $sServerName, sprintf( "-test.%s", $sRootDomain ) ) )
		{
			//	test
			$nRet	= self::ENV_TEST;
		}
		else
		{
			//	test for production
			$sNeedle	= sprintf( ".%s", $sRootDomain );
			$nRightPos	= strlen( $sServerName ) - strlen( $sNeedle ) - 1;
			$nSearchPos	= strrpos( $sServerName, $sNeedle );

			if ( $nRightPos > 0 && $nRightPos === $nSearchPos )
			{
				//	production
				$nRet = self::ENV_PRODUCTION;
			}
		}

		return $nRet;
	}
822298
private function _get_Win32_ComputerSystem()
    {
        if ($this->_Win32_ComputerSystem === null) $this->_Win32_ComputerSystem = CommonFunctions::getWMI($this->_wmi, 'Win32_ComputerSystem', array('Name', 'Manufacturer', 'Model'));
        return $this->_Win32_ComputerSystem;
    }
336741
public function getIp()
    {
        $keys = array('X_FORWARDED_FOR', 'HTTP_X_FORWARDED_FOR', 'CLIENT_IP', 'REMOTE_ADDR');
        foreach ($keys as $key) {
            if (isset($this->env[$key])) {
                return $this->env[$key];
            }
        }

        return $this->env['REMOTE_ADDR'];
    }
531453
public function getClientIP(): string
    {
        $ip = $this->getServerParam('REMOTE_ADDR');

        if ($this->getServerParam('HTTP_X_FORWARDED_FOR') !== null) {
            $ip = $this->getServerParam('HTTP_X_FORWARDED_FOR');
        }

        if ($this->getServerParam('HTTP_CLIENT_IP') !== null) {
            $ip = $this->getServerParam('HTTP_CLIENT_IP');
        }

        if ($this->headers->has('X-Real-Ip')) {
            $ip = $this->getHeaderLine('X-Real-Ip');
        }

        if ($this->headers->has('X-Client-Ip')) {
            $ip = $this->getHeaderLine('X-Client-Ip');
        }

        return is_null($ip) ? 'Unknow' : $ip;
    }
1180314
public function getIp(): string
	{
		if($this->ip === null)
		{
			$ip = $this->server->get('REMOTE_ADDR');

			if(!empty($this->trustedProxies))
			{
				$ips = $this->server->get('HTTP_X_FORWARDED_FOR');

				if(!empty($ips))
				{
					$ips = array_map('trim', explode(',', $ips));

					foreach($ips as $key => $value)
					{
						foreach($this->trustedProxies as $trustedProxy)
						{
							if(IP::inRange($value, $trustedProxy))
							{
								unset($ips[$key]);

								break;
							}
						}
					}

					$ip = end($ips);
				}
			}

			$this->ip = (filter_var($ip, FILTER_VALIDATE_IP) !== false) ? $ip : '127.0.0.1';
		}

		return $this->ip;
	}
31019
public function getHostName()
    {
        $remoteAddress = $this->server()->remoteAddress();

        $host = $this->server()->serverName();
        $fwdHost = $this->server()->get($this->getTrustedHeaders()['client_host']);
        if ($fwdHost && $fwdHost != '' && in_array($remoteAddress, $this->getTrustedProxies())) {
            $host = $fwdHost;
        }

        return strtolower($host);
    }
1281297
public function getOS()
    {
        if (!$this->os) {
            // Detect the native operating system type.
            $this->os = strtoupper(substr($this->uname, 0, 3));
        }

        return $this->os;
    }
237709
private function getSystem()
    {
        $system = $this->suluSystem;
        $request = $this->requestStack->getCurrentRequest();

        if (null !== $request
            && $request->attributes->has('_sulu')
            && null !== ($webspace = $request->attributes->get('_sulu')->getAttribute('webspace'))
            && null !== ($security = $webspace->getSecurity())
        ) {
            $system = $security->getSystem();
        }

        return $system;
    }
663237
public function uname()
    {
        if ($this->host_os === 'WINDOWS') {
            $wmi = new \COM("winmgmts:\\\\.\\root\\cimv2");
            $os=  $wmi->ExecQuery("Select * from Win32_OperatingSystem");

            foreach ($os as $o) {
                $osname = explode('|', $o->Name);
                $uname = $osname[0].' '.$o->Version;
            }
        } else {
            $uname = shell_exec('uname -rs');
        }
        return trim($uname);
    }
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;
    }
1128399
public function isCli()
    {
        static $isCli = null;
        if(null !== $isCli) { return $isCli; }

        return $isCli = (php_sapi_name() == 'cli' && empty($_SERVER['REMOTE_ADDR']));
    }
1049568
public function getIp()
    {
        if (isset($this->env['HTTP_X_FORWARDED_FOR'])) {
            return $this->env['HTTP_X_FORWARDED_FOR'];
        } elseif (isset($this->env['HTTP_CLIENT_IP'])) {
            return $this->env['HTTP_CLIENT_IP'];
        }

        return $this->env['REMOTE_ADDR'];
    }
5497
public static Type getType() {
        String osName = System.getProperty("os.name").toLowerCase();

        if (osName.contains("windows")) {
            return Type.WINDOWS;
        } else if (osName.contains("linux")) {
            return Type.LINUX;
        } else if (osName.contains("mac")) {
            return Type.MAC;
        }

        return Type.UNKNOWN;
    }
1227258
protected function findType()
    {
        foreach ($this->envNames as $envName) {
            if (isset($_SERVER[$envName])) {
                return $_SERVER[$envName];
            }
        }

        $cfgEnv = get_cfg_var($this->iniName);
        if ($cfgEnv !== false) {
            return $cfgEnv;
        }

        return static::$DEFAULT_TYPE;
    }