@recaptime-dev's working patches + fork for Phorge, a community fork of Phabricator. (Upstream dev and stable branches are at upstream/main and upstream/stable respectively.) hq.recaptime.dev/wiki/Phorge
phorge phabricator
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Setup: Check for minimum required MariaDB/MySQL version

Summary:
rP555fb3a8 defined a minimum MariaDB / MySQL version requirement.
Thus also make the Phorge code check for that.

Closes T16229

Refs T16107

Test Plan:
* Change the version_compare condition in order to trigger.
* Go to http://phorge.localhost/config/issue/

Reviewers: O1 Blessed Committers, avivey

Reviewed By: O1 Blessed Committers, avivey

Subscribers: avivey, tobiaswiese, valerio.bozzolan, Matthew, Cigaryno

Maniphest Tasks: T16229, T16107

Differential Revision: https://we.phorge.it/D26454

+35
+35
src/applications/config/check/PhabricatorDatabaseSetupCheck.php
··· 97 97 98 98 private function executeRefChecks(PhabricatorDatabaseRef $ref) { 99 99 $conn_raw = $ref->newManagementConnection(); 100 + 101 + $versions = queryfx_one($conn_raw, 'SELECT VERSION() as v'); 102 + $server_string = $versions['v']; 103 + if (phutil_nonempty_string($server_string)) { 104 + $matches = array(); 105 + if (preg_match('/^(\d+\.\d+\.\d+)/', $server_string, $matches)) { 106 + $server_version = $matches[1]; 107 + $is_maria_db = stripos($server_string, 'MariaDB'); 108 + // Keep $min_version in sync with 'installation_guide.diviner'! 109 + if ($is_maria_db) { 110 + $software_name = 'MariaDB'; 111 + $min_version = '10.5.1'; 112 + } else { 113 + $software_name = 'MySQL'; 114 + $min_version = '8.0.0'; 115 + } 116 + if (version_compare($server_version, $min_version, '<')) { 117 + $message = pht( 118 + 'You are running %s version "%s", which is older than the '. 119 + 'minimum required version, "%s". Update to at least "%s".', 120 + $software_name, 121 + $server_version, 122 + $min_version, 123 + $min_version); 124 + 125 + $this->newIssue('mysql.version') 126 + ->setName(pht('Update %s', $software_name)) 127 + ->setMessage($message) 128 + ->setIsFatal(true); 129 + 130 + return true; 131 + } 132 + } 133 + } 134 + 100 135 $ref_key = $ref->getRefKey(); 101 136 102 137 $engines = queryfx_all($conn_raw, 'SHOW ENGINES');