DatabaseConfigurationHelper
interface DatabaseConfigurationHelper (View source)
Interface for database helper classes.
Methods
Ensure that the database function for connectivity is available.
Ensure that the database server exists.
Ensure a database connection is possible using credentials provided.
Determines the version of the database server
Check database version is greater than the minimum supported
Ensure that the database connection is able to use an existing database, or be able to create one if it doesn't exist.
Ensure we have permissions to alter tables.
Details
bool
requireDatabaseFunctions(array $databaseConfig)
Ensure that the database function for connectivity is available.
If it is, we assume the PHP module for this database has been setup correctly.
array
requireDatabaseServer(array $databaseConfig)
Ensure that the database server exists.
array
requireDatabaseConnection(array $databaseConfig)
Ensure a database connection is possible using credentials provided.
The established connection resource is returned with the results as well.
string
getDatabaseVersion(array $databaseConfig)
Determines the version of the database server
array
requireDatabaseVersion(array $databaseConfig)
Check database version is greater than the minimum supported
array
requireDatabaseOrCreatePermissions(array $databaseConfig)
Ensure that the database connection is able to use an existing database, or be able to create one if it doesn't exist.
array
requireDatabaseAlterPermissions(array $databaseConfig)
Ensure we have permissions to alter tables.