MySql extends AbstractPlatform
Check database configuration status for MySQL server
This class is a hardcoded requirement check for the database server.
The status messages and title must not include HTML, use plain text only. The return values of this class are not bound to HTML and can be used in different scopes (eg. as json array).
This class is only meant to be used within EXT:install and is not part of the TYPO3 Core API.
Table of Contents
Constants
- PLATFORM_MARIADB = 'mariadb'
- PLATFORM_MYSQL = 'mysql'
- SCHEMA_NAME_MAX_LENGTH = 64
Properties
- $databaseCharsetToCheck : array<string|int, mixed>
- Charset of the database that should be fulfilled
- $databaseServerCharsetToCheck : array<string|int, mixed>
- Charset of the database server that should be fulfilled
- $incompatibleSqlModes : array<string|int, mixed>
- List of MySQL modes that are incompatible with TYPO3 CMS
- $messageQueue : FlashMessageQueue
- $minimumVersion : array<string, string>
- Minimum supported MySQL version
- $platformLabel : array<string, string>
Methods
- __construct() : mixed
- checkDefaultDatabaseCharset() : void
- Checks the character set of the database and reports an error if it is not utf-8.
- checkDefaultDatabaseServerCharset() : void
- Checks the character set of the database server and reports an info if it is not utf-8.
- getMessageQueue() : FlashMessageQueue
- getStatus() : FlashMessageQueue
- Get all status information as array with status objects
- isValidDatabaseName() : bool
- Validate the database name
- checkDatabaseName() : void
- checkInvalidSqlModes() : mixed
- Check if any SQL mode is set which is not compatible with TYPO3
- checkMySQLOrMariaDBVersion() : void
- Check minimum MySQL version
- getIncompatibleSqlModes() : array<string|int, mixed>
- Returns an array with the current sql mode settings
- getMinimumVersion() : string
- getPlatformLabel() : string
- getPlatformType() : string
- isMariaDb() : bool
Constants
PLATFORM_MARIADB
protected
mixed
PLATFORM_MARIADB
= 'mariadb'
PLATFORM_MYSQL
protected
mixed
PLATFORM_MYSQL
= 'mysql'
SCHEMA_NAME_MAX_LENGTH
protected
int
SCHEMA_NAME_MAX_LENGTH
= 64
The maximum length of the schema name
Properties
$databaseCharsetToCheck
Charset of the database that should be fulfilled
protected
array<string|int, mixed>
$databaseCharsetToCheck
= ['utf8', 'utf8mb3', 'utf8mb4']
$databaseServerCharsetToCheck
Charset of the database server that should be fulfilled
protected
array<string|int, mixed>
$databaseServerCharsetToCheck
= ['utf8', 'utf8mb3', 'utf8mb4']
$incompatibleSqlModes
List of MySQL modes that are incompatible with TYPO3 CMS
protected
array<string|int, mixed>
$incompatibleSqlModes
= ['NO_BACKSLASH_ESCAPES']
$messageQueue
protected
FlashMessageQueue
$messageQueue
$minimumVersion
Minimum supported MySQL version
protected
array<string, string>
$minimumVersion
= [self::PLATFORM_MYSQL => '8.0.0', self::PLATFORM_MARIADB => '10.3.0']
$platformLabel
protected
array<string, string>
$platformLabel
= [self::PLATFORM_MYSQL => 'MySQL', self::PLATFORM_MARIADB => 'MariaDB']
Methods
__construct()
public
__construct() : mixed
checkDefaultDatabaseCharset()
Checks the character set of the database and reports an error if it is not utf-8.
public
checkDefaultDatabaseCharset(Connection $connection) : void
Parameters
- $connection : Connection
-
to the database to be checked
checkDefaultDatabaseServerCharset()
Checks the character set of the database server and reports an info if it is not utf-8.
public
checkDefaultDatabaseServerCharset(Connection $connection) : void
Parameters
- $connection : Connection
-
to the database to be checked
getMessageQueue()
public
getMessageQueue() : FlashMessageQueue
Return values
FlashMessageQueuegetStatus()
Get all status information as array with status objects
public
getStatus() : FlashMessageQueue
Tags
Return values
FlashMessageQueueisValidDatabaseName()
Validate the database name
public
static isValidDatabaseName(string $databaseName) : bool
Parameters
- $databaseName : string
Return values
boolcheckDatabaseName()
protected
checkDatabaseName(Connection $connection) : void
Parameters
- $connection : Connection
checkInvalidSqlModes()
Check if any SQL mode is set which is not compatible with TYPO3
protected
checkInvalidSqlModes(Connection $connection) : mixed
Parameters
- $connection : Connection
-
to the database to be checked
checkMySQLOrMariaDBVersion()
Check minimum MySQL version
protected
checkMySQLOrMariaDBVersion(Connection $connection) : void
Parameters
- $connection : Connection
-
to the database to be checked
getIncompatibleSqlModes()
Returns an array with the current sql mode settings
protected
getIncompatibleSqlModes(Connection $connection) : array<string|int, mixed>
Parameters
- $connection : Connection
-
to the database to be checked
Return values
array<string|int, mixed> —Contains all configured SQL modes that are incompatible
getMinimumVersion()
protected
getMinimumVersion(Connection $connection) : string
Parameters
- $connection : Connection
Return values
stringgetPlatformLabel()
protected
getPlatformLabel(Connection $connection) : string
Parameters
- $connection : Connection
Return values
stringgetPlatformType()
protected
getPlatformType(Connection $connection) : string
Parameters
- $connection : Connection
Return values
stringisMariaDb()
protected
isMariaDb(Connection $connection) : bool
Parameters
- $connection : Connection