Check version of PHP

@return null|bool Return Null, if checking is not configured.
True, if PHP version is compatible. False otherwise.
199480
public function checkPhpVersion() {
		$phpVesion = $this->_modelConfigInstaller->getPhpVersionConfig();
		if (empty($phpVesion)) {
			return null;
		}

		$result = true;
		foreach ($phpVesion as $phpVesionItem) {
			if (!is_array($phpVesionItem)) {
				continue;
			}

			$phpVesionItem += ['', null];
			list($version, $operator) = $phpVesionItem;
			if (empty($operator)) {
				$operator = '==';
			}

			$checkResult = false;
			if (!empty($version)) {
				$checkResult = version_compare(PHP_VERSION, $version, $operator);
			}
			if (!$checkResult) {
				$result = false;
			}
		}

		return $result;
	}
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;
    }
112511
public function isValidPHPVersion()
    {
        if (version_compare(PHP_VERSION, '5.6.0') < 0) {
            return Splash::log()->err(
                'PHP : Your PHP version is too low to use Splash ('.PHP_VERSION.'). PHP >5.6 is Requiered.'
            );
        }

        return Splash::log()->msg(
            'PHP : Your PHP version is compatible with Splash ('.PHP_VERSION.')'
        );
    }
1193800
public static function phpVersion($version)
    {
        static $phpVerisons = [];

        $version = (string)$version;

        if (!isset($phpVerisons[$version])) {
            $phpVerisons[$version] = version_compare(PHP_VERSION, $version, '>=');
        }
        return $phpVerisons[$version];
    }
761857
public function check()
    {
        $returnValue = null;

        
        $validity = null;
        $name = $this->getName();
        if (($value = ini_get($name)) !== false){
            // The ini value exists for this name.
            if ((($value == '') ? '0' : $value) == $this->getExpectedValue()){
                $validity = common_configuration_Report::VALID;
                $message = "PHP Configuration Option '${name}' = '${value}' has an expected value.";
            }
            else {
                $validity = common_configuration_Report::INVALID;
                $message = "PHP Configuration Option '${name}' = '${value}' has an unexpected value.";
            }
        }
        else {
            // Unknown ini value name.
            $validity = common_configuration_Report::UNKNOWN;
            $message = "PHP Configuration Option '${name}' is unknown.";
        }

        $returnValue = new common_configuration_Report($validity, $message, $this);
        

        return $returnValue;
    }
298630
protected function isVersioned()
    {
        if (!class_exists(Versioned::class)) {
            return false;
        }
        /** @var Versioned|DataObject $singleton */
        $singleton = DataObject::singleton($this->getBaseClass());
        return $singleton->hasExtension(Versioned::class) && $singleton->hasStages();
    }
165031
public function check()
    {
        foreach($this->classes as $class) {
            $ret = $this->_check($class);
            if ($ret === false) {
                echo 'Database need migration' . PHP_EOL;
                break;
            }
        }

        return $ret;
    }
99315
public function minPHPVersion()
    {
        if (null === $this->min_php) {
            $this->min_php = $this->remote->getMinPHPVersion();
        }
        return $this->min_php;
    }
1257950
protected static function is_minimum_version_met() {
        global $CFG;

        $currentversion = 0;
        $supportedversion = 0.7;
        $unoconvbin = \escapeshellarg($CFG->pathtounoconv);
        $command = "$unoconvbin --version";
        exec($command, $output);

        // If the command execution returned some output, then get the unoconv version.
        if ($output) {
            foreach ($output as $response) {
                if (preg_match('/unoconv (\\d+\\.\\d+)/', $response, $matches)) {
                    $currentversion = (float) $matches[1];
                }
            }
            if ($currentversion < $supportedversion) {
                return false;
            } else {
                return true;
            }
        }

        return false;
    }
234485
public function check()
    {
        $result = false;

        $version = $this->dataService->getVersion();

        // Check the version. If this is > 0 then it seems to be a version number like 1.2.3
        // Because the getVersion method can return an error like
        //      Warning: Identity file /Users/agrunwald/.ssh/id_rsa_config not accessible: No such file or directory.
        //      Permission denied (publickey).
        //
        if ($version && version_compare($version, 0, '>')) {
            $this->version = $version;
            $result = true;
        }

        return $result;
    }
472099
public function isDemoVersion()
    {
        if ($this->_blDemoVersion == null) {
            $this->_blDemoVersion = \OxidEsales\Eshop\Core\Registry::getConfig()->detectVersion() == 1;
        }

        return $this->_blDemoVersion;
    }
75415
protected function printVersion()
    {
        if ( !isset( $this->options['version'] ) )
        {
            return false;
        }

        $version = '$Revision$';
        if ( preg_match( '(\\$Revision:\\s+(?P<revision>\\d+)\\s*\\$)', $version, $match ) )
        {
            $version = 'svn-' . $match['revision'];
        }

        fwrite( $this->stdout, "PHPillow backup tool - version: $version\n" );
        return true;
    }
1171117
protected static function fetch_core_version() {
        global $CFG;
        if (self::$version === null) {
            $version = null; // Prevent IDE complaints.
            require($CFG->dirroot . '/version.php');
            self::$version = $version;
        }
        return self::$version;
    }
1011541
public static function isNewestVersionAvailable()
    {
        $latestVersion = self::getLatestVersion();
        if (!empty($latestVersion)
            && version_compare(Version::VERSION, $latestVersion) == -1
        ) {
            return $latestVersion;
        }
        return false;
    }
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.")));
        }
    }
836985
public function checkVersion()
    {
        if ($this->checkCacheVersion()) {
            return;
        }
        $this->syncAssets();
        $this->cache->flushAll();
        $this->updateAutoloader();
        $this->updateCacheVersion();
    }
407109
public function getServerVersion()
    {
        $this->_connect();
        $serverInfo = sqlsrv_server_info($this->_connection);

        if ($serverInfo !== false) {
            return $serverInfo['SQLServerVersion'];
        }

        return null;
    }