Ensures a consistent output of version for MySQL as well as MariaDB

@return string
503562
private function handleMySqlVersionConsistenly()
    {
        if (substr($this->mySQLconnection->server_info, -7) === 'MariaDB') {
            $strVersionParts = explode('.', explode('-', $this->mySQLconnection->server_info)[1]);
            return $this->getTwoDecimalsNumber($strVersionParts[0]) . $this->getTwoDecimalsNumber($strVersionParts[1])
                . $this->getTwoDecimalsNumber($strVersionParts[2]);
        }
        return $this->mySQLconnection->server_version;
    }
879644
private function checkPhpVersion(): string
    {
        $today = date('Y-m-d');

        foreach (self::PHP_SUPPORT_DATES as $version => $end_date) {
            if (version_compare(self::PHP_MINOR_VERSION, $version) <= 0 && $today > $end_date) {
                return I18N::translate('Your web server is using PHP version %s, which is no longer receiving security updates. You should upgrade to a later version as soon as possible.', PHP_VERSION) . ' <a href="' . e(self::PHP_SUPPORT_URL) . '">' . e(self::PHP_SUPPORT_URL) . '</a>';
            }
        }

        return '';
    }
1038647
function Version()
	{
		$ver = (is_null($this) ? XDB_VERSION : $this->version);
		$str = sprintf("%s/%d.%d", XDB_TAGNAME, ($ver >> 5), ($ver & 0x1f));
		if (!is_null($this)) $str .= " <base={$this->hash_base}, prime={$this->hash_prime}>";
		return $str;
	}
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;
    }
463366
public static function getSolrMajorVersion() {
        $type = static::getSolrType();
        $version = FALSE;
        if ($type) {
            list(, $version) = explode(":", $type);
            if (preg_match('/^(\d)\./', $version, $matches)) {
                $version = $matches[1];
            }
            else {
                $version = '4';
            }
            // Platform support 3,4 and 6 atm. We only support 4 and 6.
            if ($version === '3') {
                $version = '4';
            }
        }
        return $version;
    }
670377
protected function isMariaDb1027()
    {
        if (!isset($this->mariaDb1027)) {
            $version = $this->_conn->fetchColumn("select version()");

            $this->mariaDb1027 = false;
            if (preg_match('/mariadb/i', $version) && version_compare($version, '10.2.7') >= 0) {
                $this->mariaDb1027 = true;
            }
        }

        return $this->mariaDb1027;
    }
1351009
function ServerVersion() {
		$data = $this->ServerInfo();
		preg_match('/^\d{2}/', $data['version'], $matches);
		$version = (int)reset($matches);

		// We only support SQL Server 2005 and up
		if($version < 9) {
			die("SQL SERVER VERSION {$data['version']} NOT SUPPORTED IN mssqlnative DRIVER");
		}

		$this->mssql_version = $version;
	}
861698
public function getLongVersion(): string
	{
		$name = $this->getName();

		if ($name === '')
		{
			$name = 'Joomla Console Application';
		}

		if ($this->getVersion() !== '')
		{
			return sprintf('%s <info>%s</info>', $name, $this->getVersion());
		}

		return $name;
	}
13428
public function getLongVersion()
    {
        $output = '';

        if ('UNKNOWN' !== $this->getName()) {
            if ('UNKNOWN' !== $this->getVersion()) {
                $output .= sprintf('<info>%s</info> version <comment>%s</comment>', $this->getName(), $this->getVersion());
            } else {
                $output .= sprintf('<info>%s</info>', $this->getName());
            }
        } else {
            $output .= '<info>Drupal Console</info>';
        }

        return $output;
    }
1322751
private function checkSqliteVersion(): string
    {
        if (class_exists(SQLite3::class)) {
            $sqlite_version = SQLite3::version()['versionString'];

            if (version_compare($sqlite_version, self::MINIMUM_SQLITE_VERSION) < 0) {
                return I18N::translate('SQLite version %s is installed. SQLite version %s or later is required.', $sqlite_version, self::MINIMUM_SQLITE_VERSION);
            }
        }

        return '';
    }
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;
	}
1172720
public function checkMysqlVersion($installedVersion = null)
    {
        $requirementFits = null;

        $minimalRequiredVersion = '5.5.0';
        $maximalRequiredVersion = '5.7.9999';

        if ($installedVersion === null) {
            $resultContainingDatabaseVersion = \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->getRow("SHOW VARIABLES LIKE 'version'");
            $installedVersion = $resultContainingDatabaseVersion[1];
        }

        if (version_compare($installedVersion, $minimalRequiredVersion, '<')) {
            $requirementFits = static::MODULE_STATUS_BLOCKS_SETUP;
        }

        /**
         * There is a bug in MySQL 5.6,* which under certain conditions affects OXID eShop Enterprise Edition.
         * Version MySQL 5.6.* in neither recommended nor supported by OXID eSales.
         * See https://bugs.mysql.com/bug.php?id=79203
         */
        if (is_null($requirementFits) &&
            version_compare($installedVersion, '5.6.0', '>=') &&
            version_compare($installedVersion, '5.7.0', '<')
        ) {
            $requirementFits = static::MODULE_STATUS_FITS_MINIMUM_REQUIREMENTS;
        }

        if (is_null($requirementFits) &&
            version_compare($installedVersion, $minimalRequiredVersion, '>=') &&
            version_compare($installedVersion, $maximalRequiredVersion, '<=')
        ) {
            $requirementFits = static::MODULE_STATUS_OK;
        }

        if (is_null($requirementFits)) {
            $requirementFits = static::MODULE_STATUS_FITS_MINIMUM_REQUIREMENTS;
        }

        return $requirementFits;
    }
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;
    }
619981
public function version()
	{
		if (isset($this->data_cache['version']))
		{
			return $this->data_cache['version'];
		}

		if (($service = ibase_service_attach($this->hostname, $this->username, $this->password)))
		{
			$this->data_cache['version'] = ibase_server_info($service, IBASE_SVC_SERVER_VERSION);

			// Don't keep the service open
			ibase_service_detach($service);
			return $this->data_cache['version'];
		}

		return FALSE;
	}
608459
public function getServerVersion() : string
    {
        return (is_array($this->apache_info) && array_key_exists('server-version', $this->apache_info))
                ? $this->apache_info['server-version']
                : 'Unknown'
        ;
    }
619726
public function get_database_version($missingVersionAllowed=false) {
		$sql = "SELECT * FROM ". $this->dbTable ." WHERE ".
				"project_name=:projectName";
		
		$numrows = $this->db->run_query($sql, array('projectName'=>$this->projectName));
		$dberror = $this->db->errorMsg();
		
		if(strlen($dberror) || $numrows != 1) {
			//
			if(preg_match('/doesn\'t exist/', $dberror) || preg_match('/does not exist/', $dberror)) {
				//add the table...
				$loadTableResult = $this->load_table();
				if($loadTableResult === TRUE) {
					//now try the SQL...
					$numrows = $this->db->run_query($sql, array('projectName'=>$this->projectName));
					$dberror = $this->db->errorMsg();
					
					//retrieve the data...
					$data = $this->db->get_single_record();
					$this->databaseVersion = $data['version_string'];
					$retval = $this->parse_version_string($data['version_string']);
				}
				else {
					$message = __METHOD__ .": no table in database, failed to create one... ORIGINAL " .
						"ERROR: ". $dberror .", SCHEMA LOAD ERROR::: ". $loadTableResult;
					$this->error_handler($message);
				}
			}
			elseif(!strlen($dberror) && $numrows == 0) {
				if($missingVersionAllowed) {
					$retval = false;
				}
				else {
					$this->error_handler(__METHOD__ .": no version data found for (". $this->projectName .")");
				}
			}//@codeCoverageIgnoreStart
			else {
				$this->error_handler(__METHOD__ .": failed to retrieve version... numrows=(". $numrows ."), DBERROR::: ". $dberror);
			}//@codeCoverageIgnoreEnd
		}
		else {
			$data = $this->db->get_single_record();
			$this->databaseVersion = $data['version_string'];
			$retval = $this->parse_version_string($data['version_string']);
		}
		
		return($retval);
	}
1049082
protected function getVersionInfo()
	{
		if(YII_DEBUG)
		{
			$version='<a href="http://www.yiiframework.com/">Yii Framework</a>/'.Yii::getVersion();
			if(isset($_SERVER['SERVER_SOFTWARE']))
				$version=$_SERVER['SERVER_SOFTWARE'].' '.$version;
		}
		else
			$version='';
		return $version;
	}