Skip to content
Snippets Groups Projects
Unverified Commit fdb2f1d2 authored by Seamus Lee's avatar Seamus Lee Committed by GitHub
Browse files

Merge pull request #17261 from seamuslee001/dev_core_1681

#1681 Add in deprecation notice for Systems using MySQL versions before 5.7 and require 5.5 for install
parents 72f27d33 965596b4
No related branches found
No related tags found
No related merge requests found
......@@ -44,6 +44,20 @@ class CRM_Upgrade_Incremental_General {
*/
const MIN_INSTALL_PHP_VER = '7.1.0';
/**
* The minimum recommended MySQL/MariaDB version.
*
* A site running an earlier version will be told to upgrade.
*/
const MIN_RECOMMENDED_MYSQL_VER = '5.7';
/**
* The minimum MySQL/MariaDB version required to install Civi.
*
* @see install/index.php
*/
const MIN_INSTALL_MYSQL_VER = '5.5';
/**
* Compute any messages which should be displayed before upgrade.
*
......
......@@ -935,4 +935,25 @@ class CRM_Utils_Check_Component_Env extends CRM_Utils_Check_Component {
return $messages;
}
public function checkMysqlVersion() {
$messages = [];
$version = CRM_Utils_SQL::getDatabaseVersion();
$minInstallVersion = CRM_Upgrade_Incremental_General::MIN_INSTALL_MYSQL_VER;
$minRecommendedVersion = CRM_Upgrade_Incremental_General::MIN_RECOMMENDED_MYSQL_VER;
if (version_compare(CRM_Utils_SQL::getDatabaseVersion(), $minInstallVersion, '<')) {
$messages[] = new CRM_Utils_Check_Message(
__FUNCTION__,
ts('This system uses MySQL/MariaDB version %1. To ensure the continued operation of CiviCRM, upgrade your server now. At least MySQL version %2 or MariaDB version %3 is recommended', [
1 => $version,
2 => $minRecommendedVersion,
3 => '10.1',
]),
ts('MySQL Out of date'),
\Psr\Log\LogLevel::WARNING,
'fa-server'
);
}
return $messages;
}
}
......@@ -291,7 +291,7 @@ class Requirements {
* @return array
*/
public function checkMysqlVersion(array $db_config) {
$min = '5.1';
$min = CRM_Upgrade_Incremental_General::MIN_INSTALL_MYSQL_VER;
$results = [
'title' => 'CiviCRM MySQL Version',
'severity' => $this::REQUIREMENT_OK,
......
......@@ -480,11 +480,11 @@ class InstallRequirements {
)
)
) {
@$this->requireMySQLVersion("5.1",
@$this->requireMySQLVersion(CRM_Upgrade_Incremental_General::MIN_INSTALL_MYSQL_VER,
array(
ts("MySQL %1 Configuration", array(1 => $dbName)),
ts("MySQL version at least %1", array(1 => '5.1')),
ts("MySQL version %1 or higher is required, you are running MySQL %2.", array(1 => '5.1', 2 => mysqli_get_server_info($this->conn))),
ts("MySQL version at least %1", array(1 => CRM_Upgrade_Incremental_General::MIN_INSTALL_MYSQL_VER)),
ts("MySQL version %1 or higher is required, you are running MySQL %2.", array(1 => CRM_Upgrade_Incremental_General::MIN_INSTALL_MYSQL_VER, 2 => mysqli_get_server_info($this->conn))),
ts("MySQL %1", array(1 => mysqli_get_server_info($this->conn))),
)
);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment