class connection_factory

Doctrine DBAL connection factory.

Methods

static Connection
get_connection(config_php_file $config)

Creates a Doctrine DBAL connection from phpBB configuration.

static Connection
get_connection_from_params(string $driver, string $host, string|null $user = null, string|null $password = null, string|null $name = null, string|null $port = null)

Creates a database connection from the specified parameters.

Details

at line 39
static Connection get_connection(config_php_file $config)

Creates a Doctrine DBAL connection from phpBB configuration.

Parameters

config_php_file $config

Config PHP file wrapper.

Return Value

Connection

Doctrine DBAL connection.

Exceptions

runtime_exception

If the database connection could not be established.

InvalidArgumentException

If the provided driver name is not a valid phpBB database driver.

at line 73
static Connection get_connection_from_params(string $driver, string $host, string|null $user = null, string|null $password = null, string|null $name = null, string|null $port = null)

Creates a database connection from the specified parameters.

Parameters

string $driver

Driver name.

string $host

Hostname.

string|null $user

Username.

string|null $password

Password.

string|null $name

Database name.

string|null $port

Database port.

Return Value

Connection

Doctrine DBAL connection.

Exceptions

runtime_exception

If the database connection could not be established.

InvalidArgumentException

If $driver is not a valid phpBB database driver.