PostgreSQLDatabaseConfigurationHelper
class PostgreSQLDatabaseConfigurationHelper implements DatabaseConfigurationHelper (View source)
This is a helper class for the SS installer.
It does all the specific checking for PostgreSQLDatabase to ensure that the configuration is setup correctly.
Methods
Create a connection of the appropriate type
Ensure that the database function for connectivity is available.
Ensure a database connection is possible using credentials provided.
Determines the version of the database server
Ensure that the PostgreSQL version is at least 8.3.
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
protected mixed|null
createConnection(array $databaseConfig, string $error)
Create a connection of the appropriate type
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)
Ensure that the PostgreSQL version is at least 8.3.
protected array
query(mixed $conn, string $sql)
Helper function to execute a query
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.