class DatabaseRequirements

Database engine version requirements for this Flarum version.

Two tiers per engine: - MINIMUM: below this Flarum will not run. The installer refuses to proceed and the admin dashboard shows a blocking error. - RECOMMENDED: above the minimum but below this runs, but the admin is warned to encourage upgrading to a modern, supported release. Centralised here so the installer, `ApplicationInfoProvider` and the admin surfaces share a single source of truth.

Constants

MYSQL_MINIMUM

Minimum MySQL version. The `JSON` column type, which Flarum relies on, was introduced in MySQL 5.7.8.

MYSQL_RECOMMENDED

Recommended MySQL version — a modern, supported release.

MARIADB_MINIMUM

Minimum MariaDB version. While JSON support arrived in 10.2.7, Flarum's migrations require features present from 10.3 onwards.

MARIADB_RECOMMENDED

Recommended MariaDB version — a modern, supported release.

PGSQL_MINIMUM

PGSQL_RECOMMENDED

Recommended PostgreSQL version. PostgreSQL supports each major release for five years; below this a release is (or is about to be) end-of-life, so we warn to encourage staying on a maintained release.

SQLITE_MINIMUM

OK

The result of comparing a version against the tiers.

BELOW_MINIMUM

BELOW_RECOMMENDED

Methods

static bool
isMariaDb(string $rawVersion)

Whether a raw `VERSION()` string reports a MariaDB server.

static string|null
normaliseVersion(string $rawVersion, bool $isMariaDb)

Extract a dotted numeric version (e.g. "8.0.36" or "11.8.2") from a raw `VERSION()` string.

static array
mysqlFamilyTiers(bool $isMariaDb)

The minimum and recommended versions for a MySQL/MariaDB server.

static string
compare(string $version, string $minimum, string $recommended)

Compare a normalised version against a tier pair.

Details

static bool isMariaDb(string $rawVersion)

Whether a raw `VERSION()` string reports a MariaDB server.

Parameters

string $rawVersion

Return Value

bool

static string|null normaliseVersion(string $rawVersion, bool $isMariaDb)

Extract a dotted numeric version (e.g. "8.0.36" or "11.8.2") from a raw `VERSION()` string.

MariaDB reports itself with a legacy "5.5.5-" compatibility prefix in some configurations (e.g. "5.5.5-10.11.6-MariaDB-..."). We strip that prefix before parsing so we read the real MariaDB version. The third segment is optional: since PostgreSQL 10, `SHOW server_version` reports a two-part `major.minor` string (e.g. "16.3"). MySQL and MariaDB always report all three parts, which the greedy match still captures.

Parameters

string $rawVersion
bool $isMariaDb

Return Value

string|null

static array mysqlFamilyTiers(bool $isMariaDb)

The minimum and recommended versions for a MySQL/MariaDB server.

Parameters

bool $isMariaDb

Return Value

array

static string compare(string $version, string $minimum, string $recommended)

Compare a normalised version against a tier pair.

Parameters

string $version
string $minimum
string $recommended

Return Value

string