Checks PHP version and other parameters of the environment

@return mixed
178069
protected function ensureRequiredEnvironment()
    {
        if (version_compare(phpversion(), \Neos\Flow\Core\Bootstrap::MINIMUM_PHP_VERSION, '<')) {
            return new Error('Flow requires PHP version %s or higher but your installed version is currently %s.', 1172215790, [\Neos\Flow\Core\Bootstrap::MINIMUM_PHP_VERSION, phpversion()]);
        }
        if (!extension_loaded('mbstring')) {
            return new Error('Flow requires the PHP extension "mbstring" to be available', 1207148809);
        }
        if (DIRECTORY_SEPARATOR !== '/' && PHP_WINDOWS_VERSION_MAJOR < 6) {
            return new Error('Flow does not support Windows versions older than Windows Vista or Windows Server 2008, because they lack proper support for symbolic links.', 1312463704);
        }
        foreach ($this->requiredExtensions as $extension => $errorKey) {
            if (!extension_loaded($extension)) {
                return new Error('Flow requires the PHP extension "%s" to be available.', $errorKey, [$extension]);
            }
        }
        foreach ($this->requiredFunctions as $function => $errorKey) {
            if (!function_exists($function)) {
                return new Error('Flow requires the PHP function "%s" to be available.', $errorKey, [$function]);
            }
        }

        // TODO: Check for database drivers? PDO::getAvailableDrivers()

        $method = new \ReflectionMethod(__CLASS__, __FUNCTION__);
        $docComment = $method->getDocComment();
        if ($docComment === false || $docComment === '') {
            return new Error('Reflection of doc comments is not supported by your PHP setup. Please check if you have installed an accelerator which removes doc comments.', 1329405326);
        }

        set_time_limit(0);

        if (ini_get('session.auto_start')) {
            return new Error('Flow requires the PHP setting "session.auto_start" set to off.', 1224003190);
        }

        return null;
    }
551159
protected function _checkVersion()
    {
        $edition = \OxidEsales\Eshop\Core\Registry::getConfig()->getEdition();
        $query = 'http://admin.oxid-esales.com/' . $edition . '/onlinecheck.php?getlatestversion';
        if ($version = \OxidEsales\Eshop\Core\Registry::getUtilsFile()->readRemoteFileAsString($query)) {
            // current version is older ..
            if (version_compare(\OxidEsales\Eshop\Core\Registry::getConfig()->getVersion(), $version) == '-1') {
                return sprintf(\OxidEsales\Eshop\Core\Registry::getLang()->translateString('NAVIGATION_NEWVERSIONAVAILABLE'), $version);
            }
        }
    }
572736
public function check()
    {
        if (function_exists($this->functionName)) {
            return [EnvironmentCheck::OK, $this->functionName . '() exists'];
        }
        return [EnvironmentCheck::ERROR, $this->functionName . '() doesn\'t exist'];
    }
852926
public function version()
	{
		if (isset($this->data_cache['version']))
		{
			return $this->data_cache['version'];
		}

		if ( ! $this->conn_id OR ($version = mysql_get_server_info($this->conn_id)) === FALSE)
		{
			return FALSE;
		}

		return $this->data_cache['version'] = $version;
	}
373024
final public static function checkPhpVersion()
    {
        $phpv = phpversion();

        if ($phpv >= self::$php_accept) {
            return (json_encode(array("code" => 200, "results" => "OK", "phpv" => $phpv)));
        } else {
            return (json_encode(array("code" => 500, "results" => "NOK", "phpv" => $phpv, "msg" =>
                "The version of PHP is incompatible with iumio Framework. You must have at least version 7.2
                 of PHP on your web server.")));
        }
    }
3676
public function getServerVersion()
    {
        $di = new DBInstance($this->rawConfig);
        $version = $di->getServerVersion();
        unset($di);

        return array(
            'version' => $version,
        );
    }
1002494
public function getVersions()
    {
        while (
            !empty($this->version) &&
            substr_count($this->version, '.') < 2
        ) {
            $this->version .= '.0';
        }
        // Remove part by part of the version.
        $result = array_merge(
            [$this->version],
            $this->explode($this->version, '.')
        );
        asort($result);
        usort($result, function ($a, $b) {
            // PHP 7: Switch to the <=> "Spaceship" operator
            return strlen($b) - strlen($a);
        });
        return $this->filterDuplicates($result);
    }
517333
function validateVersion()
    {
        $versionValidated = false;
        $ezversion = eZPublishSDK::version();
        if ( $this->MinVersion !== false )
        {
            if ( $this->MaxVersion !== false )
            {
                if ( version_compare( $this->MinVersion, $ezversion , 'le' ) &&
                     version_compare( $this->MaxVersion, $ezversion , 'ge' ) )
                {
                    return true;
                }
                return false;
            }
            if ( version_compare( $this->MinVersion, $ezversion , 'le' ) )
            {
                return true;
            }
            return false;
        }
        else
        {
            if ( version_compare( $this->MaxVersion, $ezversion , 'ge' ) )
            {
                return true;
            }
            return false;
        }
    }
996248
public function getClientVersion()
    {
        $this->_connect();
        try {
            $version = $this->_connection->getAttribute(PDO::ATTR_CLIENT_VERSION);
            $matches = null;
            if (preg_match('/((?:[0-9]{1,2}\.){1,3}[0-9]{1,2})/', $version, $matches)) {
                return $matches[1];
            }
        } catch (PDOException $e) {
            // In case of the driver doesn't support getting attributes
        }
        return null;
    }
1035751
public function check()
    {
        if (class_exists($this->className)) {
            return [EnvironmentCheck::OK, 'Class ' . $this->className.' exists'];
        }
        return [EnvironmentCheck::ERROR, 'Class ' . $this->className.' doesn\'t exist'];
    }
1051860
protected function version()
    {
        $version = $this->argument('version');

        if (! $version) {
            return $this->latestVersion();
        }

        if (! ctype_digit($version)) {
            return $version;
        }

        $version = (int) $version;

        if ($version < 70) {
            return $this->legacyVersions[$version];
        }

        return trim(file_get_contents(
            sprintf($this->versionUrl, $version)
        ));
    }
451181
public function getServerVersion()
    {
        $this->_connect();
        try {
            $version = $this->_connection->getAttribute(PDO::ATTR_SERVER_VERSION);
        } catch (PDOException $e) {
            // In case of the driver doesn't support getting attributes
            return null;
        }
        $matches = null;
        if (preg_match('/((?:[0-9]{1,2}\.){1,3}[0-9]{1,2})/', $version, $matches)) {
            return $matches[1];
        } else {
            return null;
        }
    }
387530
public function getDependencyPhpVersionMin()
    {
        if(!isset($this->_packageXml->dependencies->required->php->min)) {
            return false;
        }
        return (string)$this->_packageXml->dependencies->required->php->min;
    }
1305794
public function getServerVersion()
    {
        if (!$this->serverVersion) {
            $this->method = 'getServerVersion';
            $this->sendRequest();
            $this->method = null;
        }

        return $this->serverVersion;
    }
775329
public function checkPhpVersion()
    {
        $min = $this->getDependencyPhpVersionMin();
        $max = $this->getDependencyPhpVersionMax();

        $minOk = $min? version_compare(PHP_VERSION, $min, ">=") : true;
        $maxOk = $max? version_compare(PHP_VERSION, $max, "<=") : true;

        if(!$minOk || !$maxOk) {
            $err = "requires PHP version ";
            if($min && $max) {
                $err .= " >= $min and <= $max ";
            } elseif($min) {
                $err .= " >= $min ";
            } elseif($max) {
                $err .=  " <= $max ";
            }
            $err .= " current is: ".PHP_VERSION;
            return $err;
        }
        return true;
    }
808504
public static function checkSystemVersion()
    {
        if (\Genesis\Utils\Common::compareVersions(self::$minPHPVersion, '<')) {
            throw new \Exception(self::getErrorMessage('system'));
        }
    }
417292
private function checkTusVersion() {
        $tusVersion = $this->getRequest()->getHeader('Tus-Resumable');
        if ($tusVersion instanceof \Zend\Http\Header\HeaderInterface) {
            return $tusVersion->getFieldValue() === self::TUS_VERSION;
        }
        return false;
    }