Checks if alternative image server is configured.

@return bool
347468
public function isAltImageServerConfigured()
    {
        $oConfig = $this->getConfig();

        return $oConfig->getConfigParam('sAltImageUrl') || $oConfig->getConfigParam('sSSLAltImageUrl') ||
               $oConfig->getConfigParam('sAltImageDir') || $oConfig->getConfigParam('sSSLAltImageDir');
    }
293146
private function isBaeEnv() {
		if (isset ( $_SERVER ['HTTP_HOST'] )) {
			$host = $_SERVER ['HTTP_HOST'];
			$pos = strpos ( $host, '.' );
			if ($pos !== false) {
				$substr = substr ( $host, $pos + 1 );
				if ($substr == 'duapp.com') {
					return true;
				}
			}
		}
		if (isset ( $_SERVER ["HTTP_BAE_LOGID"] )) {
			return true;
		}

		return false;
	}
1352168
public static function checkSecondDomain() {
        $domain = self::getSecondDomain();
        $domainConfig = Config::get('app.domain');
        if (isset($domainConfig[$domain])) {
            return $domainConfig[$domain];
        }
        return false;
    }
1015767
public function hasManifest()
    {
        $server = $this->releasesManager->getCurrentReleasePath($this->manifest);
        $server = $this->bash->fileExists($server);

        $local = $this->getManifestPath();
        $local = $this->files->has($local);

        return $local || $server;
    }
441449
private function isValidRequest()
    {
        $request = Eresus_CMS::getLegacyKernel()->request;
        /** @var TClientUI $page */
        $page = Eresus_Kernel::app()->getPage();
        $options = $page->options;
        $disallowPOST = array_key_exists('disallowPOST', $options) && $options['disallowPOST'];
        if ('POST' == $request['method'] && $disallowPOST)
        {
            return false;
        }

        $disallowGET = array_key_exists('disallowGET', $options) && $options['disallowGET'];
        $hasGetArgs = $request['url'] != $request['path'];
        if ($hasGetArgs && $disallowGET)
        {
            return false;
        }
        return true;
    }
650949
protected function checkAndSetServerOptions()
    {

        // Specific query port defined
        if (array_key_exists(self::SERVER_OPTIONS_QUERY_PORT, $this->options)) {
            $this->port_query = (int)$this->options[self::SERVER_OPTIONS_QUERY_PORT];
        } else {
            // Do math based on the protocol class
            $this->port_query = $this->protocol->findQueryPort($this->port_client);
        }
    }
398312
public function isConfigured()
    {
        if (!empty($this->urlParts) && isset($this->solrMap[$this->className])) {
            return true;
        }
        return false;
    }
580459
public function valid()
    {
        if ($this->container['transcoderWatermark'] === null) {
            return false;
        }
        if ($this->container['serverVersion'] === null) {
            return false;
        }
        if ($this->container['gpuAcceleration'] === null) {
            return false;
        }
        if ($this->container['wseName'] === null) {
            return false;
        }
        if ($this->container['transcoderLicensed'] === null) {
            return false;
        }
        if ($this->container['javaMaxHeapSize'] === null) {
            return false;
        }
        if ($this->container['transcoderLicensesInUse'] === null) {
            return false;
        }
        if ($this->container['javaVersion'] === null) {
            return false;
        }
        if ($this->container['httpOriginAvailable'] === null) {
            return false;
        }
        if ($this->container['serverName'] === null) {
            return false;
        }
        if ($this->container['osArchitecture'] === null) {
            return false;
        }
        if ($this->container['drmApplications'] === null) {
            return false;
        }
        if ($this->container['javaVMVersion'] === null) {
            return false;
        }
        if ($this->container['transcoderLicenses'] === null) {
            return false;
        }
        if ($this->container['timeRunning'] === null) {
            return false;
        }
        if ($this->container['licenseType'] === null) {
            return false;
        }
        if ($this->container['osBitness'] === null) {
            return false;
        }
        if ($this->container['dvrApplications'] === null) {
            return false;
        }
        if ($this->container['osVersion'] === null) {
            return false;
        }
        if ($this->container['serverBuild'] === null) {
            return false;
        }
        if ($this->container['javaName'] === null) {
            return false;
        }
        if ($this->container['maxConnections'] === null) {
            return false;
        }
        if ($this->container['dvrLicensed'] === null) {
            return false;
        }
        if ($this->container['serverMode'] === null) {
            return false;
        }
        if ($this->container['javaBitness'] === null) {
            return false;
        }
        if ($this->container['currentConnections'] === null) {
            return false;
        }
        if ($this->container['drmLicensed'] === null) {
            return false;
        }
        if ($this->container['javaVendor'] === null) {
            return false;
        }
        if ($this->container['osName'] === null) {
            return false;
        }
        if ($this->container['version'] === null) {
            return false;
        }
        if ($this->container['transcoderApplications'] === null) {
            return false;
        }
        if ($this->container['transcoderAvailable'] === null) {
            return false;
        }
        if ($this->container['javaHome'] === null) {
            return false;
        }
        if ($this->container['maxIncommingStreams'] === null) {
            return false;
        }
        if ($this->container['totalMemory'] === null) {
            return false;
        }
        if ($this->container['availableMemory'] === null) {
            return false;
        }
        if ($this->container['nativeBase'] === null) {
            return false;
        }
        if ($this->container['dvrInUse'] === null) {
            return false;
        }
        if ($this->container['drmInUse'] === null) {
            return false;
        }
        if ($this->container['licenseExpireDate'] === null) {
            return false;
        }
        if ($this->container['processorCores'] === null) {
            return false;
        }
        if ($this->container['restAPIAvailable'] === null) {
            return false;
        }
        return true;
    }
493991
protected function verifyFormatCompatiblity ()
	{
		$isCompatible 	= true;
		$gdInfo			= gd_info();
		
		switch ($this->format)
		{
			case 'GIF':
				$isCompatible = $gdInfo['GIF Create Support'];
				break;
			case 'JPG':
				$isCompatible = (isset($gdInfo['JPG Support']) || isset($gdInfo['JPEG Support'])) ? true : false;
				break;
			case 'PNG':
				$isCompatible = $gdInfo[$this->format . ' Support'];
				break;
			default:
				$isCompatible = false;
		}
		
		if (!$isCompatible)
		{
			// one last check for "JPEG" instead
			$isCompatible = $gdInfo['JPEG Support'];
			
			if (!$isCompatible)
			{
				$this->triggerError('Your GD installation does not support ' . $this->format . ' image types');
			}
		}
	}
839845
public function isAdminHome(): bool
    {
        return $this->url->current() == $this->url->to($this->config->get('helpers.paths.admin'));
    }
474326
public static function isHttps()
    {
        // Default is http scheme.
        $https = false;

        if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") {
            // $_SERVER['HTTPS'] is NOT set behind a proxy / load balancer
            $https = true;
        } elseif (
            // $_SERVER['HTTPS'] is set behind a proxy / load balancer
            !empty($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https' ||
            !empty($_SERVER['HTTP_X_FORWARDED_SSL']) && $_SERVER['HTTP_X_FORWARDED_SSL'] == 'on') {
            $https = true;
        }
        return $https;
    }
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);
    }
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;
        }
    }
554101
public function has_dns() {
		if (\is_null($this->dns)) {
			if (! $this->is_fqdn()) {
				$this->dns = false;
			}
			elseif ($this->is_ip()) {
				$this->dns = $this->is_ip(false);
			}
			else {
				$this->dns = !! \filter_var(
					\gethostbyname("{$this->host}."),
					\FILTER_VALIDATE_IP,
					\FILTER_FLAG_NO_PRIV_RANGE | \FILTER_FLAG_NO_RES_RANGE
				);
			}
		}

		return $this->dns;
	}
783594
public static function isIIS()
    {
        $iis = isset($_SERVER['SERVER_SOFTWARE']) &&
            preg_match('/^Microsoft-IIS\/(.+)/', $_SERVER['SERVER_SOFTWARE'], $matches) &&
            version_compare($matches[1], '7') >= 0;

        return $iis;
    }
943172
public function can_setup_server() {

        $status = $this->engine->is_server_configured();
        if ($status !== true) {
            return $status;
        }

        // At this stage we know that the server is properly configured with a valid host:port and indexname.
        // We're not too concerned about repeating the SolrClient::system() call (already called in
        // is_server_configured) because this is just a setup script.
        if ($this->engine->get_solr_major_version() < 5) {
            // Schema setup script only available for 5.0 onwards.
            return get_string('schemasetupfromsolr5', 'search_solr');
        }

        return true;
    }
1335885
public function is_server_ready() {

        $configured = $this->is_server_configured();
        if ($configured !== true) {
            return $configured;
        }

        // As part of the above we have already checked that we can contact the server. For pages
        // where performance is important, we skip doing a full schema check as well.
        if ($this->should_skip_schema_check()) {
            return true;
        }

        // Update schema if required/possible.
        $schemalatest = $this->check_latest_schema();
        if ($schemalatest !== true) {
            return $schemalatest;
        }

        // Check that the schema is already set up.
        try {
            $schema = new \search_solr\schema();
            $schema->validate_setup();
        } catch (\moodle_exception $e) {
            return $e->getMessage();
        }

        return true;
    }