‪TYPO3CMS  10.4
TYPO3\CMS\Install\SystemEnvironment\DatabaseCheck Class Reference
Inheritance diagram for TYPO3\CMS\Install\SystemEnvironment\DatabaseCheck:
TYPO3\CMS\Install\SystemEnvironment\CheckInterface

Public Member Functions

 __construct ()
 
FlashMessageQueue getStatus ()
 
 checkDatabaseDriverRequirements (string $databaseDriver)
 
FlashMessageQueue checkDatabasePlatformRequirements (string $databaseDriver)
 
 identifyInstalledDatabaseDriver ()
 
 getMessageQueue ()
 

Static Public Member Functions

static string retrieveDatabasePlatformByDriverName (string $databaseDriverName)
 
static string retrieveDatabaseDriverClassByDriverName (string $driverName)
 
static isMysqli ()
 
static isPdoMysql ()
 
static isPdoPgsql ()
 
static isPdoSqlite ()
 
static isPdoSqlSrv ()
 
static isSqlSrv ()
 

Private Attributes

FlashMessageQueue $messageQueue
 
string[] $databaseDriverCheckMap
 

Static Private Attributes

static string[] $databaseDriverToPlatformMapping
 
static string[] $driverMap
 

Detailed Description

Check database configuration status

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).

The database requirements checks are separated into driver specific and / or more general requirements specific for each DBMS platform.

Example:

The driver pdo_mysql requires a different set of checks, then the mysqli driver (it requires other extensions to be loaded by PHP, configuration of that extension, etc.). Those specific checks could be covered in a driver specific check like follows:

  • ‪Create a new class in typo3/sysext/install/Classes/SystemEnvironment/DatabaseCheck/Driver
  • ‪It must extend TYPO3\CMS\Install\SystemEnvironment\DatabaseCheck\Driver\AbstractDriver and implement all methods
  • ‪Finally it has to be registered in TYPO3\CMS\Install\SystemEnvironment\DatabaseCheck

If the requirements are more general for the platform (e.g. MySQL, PostgreSQL, etc.), they should be placed in the platform specific checks and fulfill those requirements:

  • ‪Create a new class in typo3/sysext/install/Classes/SystemEnvironment/DatabaseCheck/Platform
  • ‪It must extend TYPO3\CMS\Install\SystemEnvironment\DatabaseCheck\Platform\AbstractPlatform and implement all methods
  • ‪Finally it has to be registered in TYPO3\CMS\Install\SystemEnvironment\DatabaseCheck

This class is only meant to be used within EXT:install and is not part of the TYPO3 Core API.

Definition at line 77 of file DatabaseCheck.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Install\SystemEnvironment\DatabaseCheck::__construct ( )

Definition at line 125 of file DatabaseCheck.php.

Member Function Documentation

◆ checkDatabaseDriverRequirements()

TYPO3\CMS\Install\SystemEnvironment\DatabaseCheck::checkDatabaseDriverRequirements ( string  $databaseDriver)

◆ checkDatabasePlatformRequirements()

FlashMessageQueue TYPO3\CMS\Install\SystemEnvironment\DatabaseCheck::checkDatabasePlatformRequirements ( string  $databaseDriver)

Get the status of a specific database platform

Parameters
string$databaseDriver
Returns
‪FlashMessageQueue
Exceptions
Exception

Definition at line 201 of file DatabaseCheck.php.

References TYPO3\CMS\Install\SystemEnvironment\DatabaseCheck\$messageQueue, TYPO3\CMS\Core\Messaging\FlashMessageQueue\enqueue(), and TYPO3\CMS\Install\SystemEnvironment\DatabaseCheck\getStatus().

Referenced by TYPO3\CMS\Install\SystemEnvironment\DatabaseCheck\getStatus().

◆ getMessageQueue()

TYPO3\CMS\Install\SystemEnvironment\DatabaseCheck::getMessageQueue ( )

◆ getStatus()

◆ identifyInstalledDatabaseDriver()

TYPO3\CMS\Install\SystemEnvironment\DatabaseCheck::identifyInstalledDatabaseDriver ( )

◆ isMysqli()

static TYPO3\CMS\Install\SystemEnvironment\DatabaseCheck::isMysqli ( )
static

◆ isPdoMysql()

static TYPO3\CMS\Install\SystemEnvironment\DatabaseCheck::isPdoMysql ( )
static

◆ isPdoPgsql()

static TYPO3\CMS\Install\SystemEnvironment\DatabaseCheck::isPdoPgsql ( )
static

◆ isPdoSqlite()

static TYPO3\CMS\Install\SystemEnvironment\DatabaseCheck::isPdoSqlite ( )
static

◆ isPdoSqlSrv()

static TYPO3\CMS\Install\SystemEnvironment\DatabaseCheck::isPdoSqlSrv ( )
static

Definition at line 322 of file DatabaseCheck.php.

◆ isSqlSrv()

static TYPO3\CMS\Install\SystemEnvironment\DatabaseCheck::isSqlSrv ( )
static

Definition at line 327 of file DatabaseCheck.php.

◆ retrieveDatabaseDriverClassByDriverName()

static string TYPO3\CMS\Install\SystemEnvironment\DatabaseCheck::retrieveDatabaseDriverClassByDriverName ( string  $driverName)
static
Parameters
string$driverName
Returns
‪string
Exceptions
Exception

Definition at line 285 of file DatabaseCheck.php.

Referenced by TYPO3\CMS\Install\Controller\InstallerController\checkDatabaseRequirementsForDriver().

◆ retrieveDatabasePlatformByDriverName()

static string TYPO3\CMS\Install\SystemEnvironment\DatabaseCheck::retrieveDatabasePlatformByDriverName ( string  $databaseDriverName)
static
Parameters
string$databaseDriverName
Returns
‪string
Exceptions
Exception

Definition at line 267 of file DatabaseCheck.php.

Member Data Documentation

◆ $databaseDriverCheckMap

string [] TYPO3\CMS\Install\SystemEnvironment\DatabaseCheck::$databaseDriverCheckMap
private
Initial value:
= array(
DoctrineMysqliDriver::class => DatabaseCheckDriverMysqli::class,
TYPO3PDOMySqlDriver::class => DatabaseCheckDriverPdoMysql::class,
TYPO3PDOPgSqlDriver::class => DatabaseCheckDriverPDOPgSql::class,
DoctrineSQLSrvDriver::class => DatabaseCheckDriverSQLSrv::class,
TYPO3PDOSqlSrvDriver::class => DatabaseCheckDriverPDOSqlsrv::class,
TYPO3PDOSqliteDriver::class => DatabaseCheckDriverPDOSqlite::class,
)

List of database driver to check

Definition at line 116 of file DatabaseCheck.php.

◆ $databaseDriverToPlatformMapping

string [] TYPO3\CMS\Install\SystemEnvironment\DatabaseCheck::$databaseDriverToPlatformMapping
staticprivate
Initial value:
= array(
DoctrineMysqliDriver::class => DatabaseCheckPlatformMysql::class,
TYPO3PDOMySqlDriver::class => DatabaseCheckPlatformMysql::class,
TYPO3PDOPgSqlDriver::class => DatabaseCheckPlatformPostgreSql::class,
DoctrineSQLSrvDriver::class => DatabaseCheckPlatformSqlSrv::class,
TYPO3PDOSqlSrvDriver::class => DatabaseCheckPlatformSqlSrv::class,
TYPO3PDOSqliteDriver::class => DatabaseCheckPlatformSqlite::class,
)

List of database platforms to check

Definition at line 87 of file DatabaseCheck.php.

◆ $driverMap

string [] TYPO3\CMS\Install\SystemEnvironment\DatabaseCheck::$driverMap
staticprivate
Initial value:
= array(
'pdo_mysql' => TYPO3PDOMySqlDriver::class,
'pdo_sqlite' => TYPO3PDOSqliteDriver::class,
'pdo_pgsql' => TYPO3PDOPgSqlDriver::class,
'pdo_oci' => DoctrinePDOOCIDriver::class,
'oci8' => DoctrineOCI8Driver::class,
'ibm_db2' => DB2Driver::class,
'pdo_sqlsrv' => TYPO3PDOSqlSrvDriver::class,
'mysqli' => DoctrineMysqliDriver::class,
'drizzle_pdo_mysql' => DoctrineDrizzlePDOMySQLDriver::class,
'sqlanywhere' => DoctrineSQLAnywhereDriver::class,
'sqlsrv' => DoctrineSQLSrvDriver::class,
)

Definition at line 98 of file DatabaseCheck.php.

◆ $messageQueue