Checks whether PHP is running on a Cygwin platform

@return  bool    True when PHP is running on a Cygwin platform, false otherwise.
510012
public static function isCygwin() : bool
    {
        // Return the cached result if it's already available.
        if (null !== static::$type) {
            return static::$type === self::TYPE_CYGWIN;
        }

        return static::getType() === self::TYPE_CYGWIN;
    }
875443
public function isAWS()
    {
        return in_array($this->type(), [TargetEnum::TYPE_CD, TargetEnum::TYPE_EB, TargetEnum::TYPE_S3]);
    }
543570
protected function hasColorSupport()
    {
        // @codeCoverageIgnoreStart
        if (DIRECTORY_SEPARATOR == '\\') {
            return false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI');
        }

        return function_exists('posix_isatty') && @posix_isatty($this->stream->stream);
        // @codeCoverageIgnoreEnd
    }
332667
public function isValid() {
		if (is_resource($this->process)) {
			$status = proc_get_status($this->process);
			return $status['running'];
		} else {
			return false;
		}
	}
933226
public function isSupported()
    {
        $sql = 'SHOW TABLES LIKE :table';

        $stat = $this->pdo->prepare($sql);
        $stat->bindValue(':table', $this->table);
        $stat->execute();

        return (bool) $stat->fetch(\PDO::FETCH_ASSOC);
    }
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;
    }
1308806
public static function onAppEngine() {
        $appEngineProduction = isset($_SERVER['SERVER_SOFTWARE']) &&
            0 === strpos($_SERVER['SERVER_SOFTWARE'], 'Google App Engine');
        if ($appEngineProduction) {
            return true;
        }
        $appEngineDevAppServer = isset($_SERVER['APPENGINE_RUNTIME']) &&
            $_SERVER['APPENGINE_RUNTIME'] == 'php';
        if ($appEngineDevAppServer) {
            return true;
        }
        return false;
    }
407105
private function checkHosts():bool
    {
        if (null === $this->config) {
            return (true);
        }
        $current_env = FEnv::get("framework.env");
        $ip = ToolsExceptions::getClientIp();
        $result = true;
        if ("dev" === $current_env) {
            if (property_exists($this->config, "hosts_denied_dev")) {
                $dd = $this->config->hosts_denied_dev;
                if (null !== $dd) {
                    if (false != in_array("*", $dd)) {
                        $result = false;
                    } elseif (false != in_array($ip, $dd)) {
                        $result = false;
                    }
                }
            }
            if (property_exists($this->config, "hosts_allowed_dev")) {
                $dd = $this->config->hosts_allowed_dev;
                if (null !== $dd) {
                    if (true == in_array("*", $dd) && $result) {
                        $result = true;
                    } elseif (true === in_array($ip, $dd) && false === $result) {
                        $result = true;
                    }
                }
            }
        } elseif ("prod" === $current_env) {
            if (property_exists($this->config, "hosts_denied_prod")) {
                $dd = $this->config->hosts_denied_prod;
                if (null !== $dd) {
                    if (false != in_array("*", $dd)) {
                        $result = false;
                    } elseif (false != in_array($ip, $dd)) {
                        $result = false;
                    }
                }
            }
            if (property_exists($this->config, "hosts_allowed_prod")) {
                $dd = $this->config->hosts_allowed_prod;
                if (null !== $dd) {
                    if (true == in_array("*", $dd) && $result) {
                        $result = true;
                    } elseif (true === in_array($ip, $dd) && false === $result) {
                        $result = true;
                    }
                }
            }
        }

        if (false === $result) {
            throw new Server403(new \ArrayObject(array("solution" =>
                "Add the current host to the allowed hosts list")));
        }

        return (true);
    }
225623
public function compiledExists()
    {
        return $this->cached === false ? false : file_exists($this->cachePath.'/'.$this->getClassName().'.php');
    }
546982
protected static function is_developer() {
        global $CFG;

        // Note we can not rely on $CFG->debug here because DB is not initialised yet.
        if (isset($CFG->config_php_settings['debug'])) {
            $debug = (int)$CFG->config_php_settings['debug'];
        } else {
            return false;
        }

        if ($debug & E_ALL and $debug & E_STRICT) {
            return true;
        }

        return false;
    }
667182
public static function checkBrowserLynx()
    {
        if (stripos(self::$userAgentString, 'lynx') !== false) {
            $aresult = explode('/', stristr(self::$userAgentString, 'Lynx'));
            $aversion = explode(' ', (isset($aresult[1]) ? $aresult[1] : ''));
            self::$browser->setVersion($aversion[0]);
            self::$browser->setName(Browser::LYNX);

            return true;
        }

        return false;
    }
986493
public function is_cli(){
    if ( !isset($this->cli) ){
      $this->cli = (php_sapi_name() === 'cli');
      if ( $this->cli ){
        $opt = getopt('', ['cli']);
        if ( isset($opt['cli']) ){
          $this->cli = 'direct';
        }
      }
    }
    return $this->cli;
  }
1160929
public static function hasColorSupport(): bool
    {
        if (DIRECTORY_SEPARATOR === '\\') {
            $winColor = Env::get('ANSICON', Env::VAR_BOOL)
                || 'ON' === Env::get('ConEmuANSI')
                || 'xterm' === Env::get('TERM');

            return $winColor;
        }

        if (!defined('STDOUT')) {
            return false;
        }

        return self::isInteractive(STDOUT);
    }
441182
public static function getPHPExecutable() {
    if(defined("PHP_BINARY") && PHP_BINARY != ""){
      return PHP_BINARY;
    }else{
      $paths = explode(PATH_SEPARATOR, getenv('PATH'));
      foreach ($paths as $path) {
        // we need this for XAMPP (Windows)
        if (strstr($path, 'php.exe') && isset($_SERVER["WINDIR"]) && file_exists($path) && is_file($path)) {
          return $path;
        }else {
          $php_executable = $path . DIRECTORY_SEPARATOR . "php" . (isset($_SERVER["WINDIR"]) ? ".exe" : "");
          if (file_exists($php_executable) && is_file($php_executable)) {
            return $php_executable;
          }
        }
      }
    }
    return FALSE; // not found
  }
928008
public static function isShellExecution()
    {
        $sapiType = php_sapi_name();

        if ( $sapiType == 'cli' )
            return true;

        // For CGI we have to check, if the script has been executed over shell.
        // Currently it looks like the HTTP_HOST variable is the most reasonable to check.
        if ( substr( $sapiType, 0, 3 ) == 'cgi' )
        {
            if ( !self::serverVariable( 'HTTP_HOST', true ) )
                return true;
            else
                return false;
        }
        return false;
    }
824105
public static function isPtySupported()
    {
        static $result;

        if (null !== $result) {
            return $result;
        }

        if ('\\' === \DIRECTORY_SEPARATOR) {
            return $result = false;
        }

        return $result = (bool) @proc_open('echo 1 >/dev/null', [['pty'], ['pty'], ['pty']], $pipes);
    }
1330246
function is_system_configured() {
        global $CFG;
        return (!empty($CFG->jabberhost) && !empty($CFG->jabberport) && !empty($CFG->jabberusername) && !empty($CFG->jabberpassword));
    }