Skip to content

Commit

Permalink
Fix MariaDB detection (#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
richard67 authored and zero-24 committed Sep 4, 2019
1 parent 40c45d6 commit b77cb35
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,12 @@ function admin_postinstall_joomla40checks_condition()
}

// Check whether we have a MariaDB version string and extract the proper version from it
if ($serverType == 'mysql'
&& preg_match('/^(?:5\.5\.5-)?(mariadb-)?(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)/i', $serverVersion, $versionParts))
if ($serverType == 'mysql' && stripos($serverVersion, 'mariadb') !== false)
{
$dbVersion = $versionParts['major'] . '.' . $versionParts['minor'] . '.' . $versionParts['patch'];
$serverVersion = preg_replace('/^5\.5\.5-/', '', $serverVersion);

// MariaDB minimum version is 10.1
if (version_compare($dbVersion, '10.1', 'lt'))
if (version_compare($serverVersion, '10.1', 'lt'))
{
return true;
}
Expand Down

0 comments on commit b77cb35

Please sign in to comment.