SQLiteDatabaseConfigurationHelper
class SQLiteDatabaseConfigurationHelper implements DatabaseConfigurationHelper (View source)
This is a helper class for the SS installer.
It does all the specific checking for SQLiteDatabase 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
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.
Creates the provided directory and prepares it for storing SQLlite. Use secure_db_dir() to secure it against unauthorized access.
Secure the provided directory via web-access by placing a .htaccess file in it.
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.
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.
static bool
create_db_dir(string $path)
Creates the provided directory and prepares it for storing SQLlite. Use secure_db_dir() to secure it against unauthorized access.
static bool
secure_db_dir(string $path)
Secure the provided directory via web-access by placing a .htaccess file in it.
This is just required if the database directory is placed within a publically accessible webroot (the default path is in a hidden folder within assets/).
array
requireDatabaseAlterPermissions(array $databaseConfig)
Ensure we have permissions to alter tables.