ConnectionFactory

class OC\DB\ConnectionFactory
Takes care of creating and configuring Doctrine connections.
Source:lib/private/DB/ConnectionFactory.php#42

Constants

DEFAULT_DBNAME = owncloud
Source:lib/private/DB/ConnectionFactory.php#44
Type:string default database name
DEFAULT_DBTABLEPREFIX = oc_
Source:lib/private/DB/ConnectionFactory.php#47
Type:string default database table prefix

Properties

protected static property OC\DB\ConnectionFactory::$defaultConnectionParams
Source:lib/private/DB/ConnectionFactory.php#55
Type:array Array mapping DBMS type to default connection parameters passed to \Doctrine\DBAL\DriverManager::getConnection().

Methods

public OC\DB\ConnectionFactory::__construct($systemConfig)
ConnectionFactory constructor.
Source:

lib/private/DB/ConnectionFactory.php#88

Parameters:
public OC\DB\ConnectionFactory::getDefaultConnectionParams($type)
Source:

lib/private/DB/ConnectionFactory.php#101

Parameters:
  • $type (string) DBMS type
Throws:

\InvalidArgumentException If $type is invalid

Returns:

array Default connection parameters.

public OC\DB\ConnectionFactory::getConnection($type, $additionalConnectionParams)
Source:

lib/private/DB/ConnectionFactory.php#123

Parameters:
  • $type (string) DBMS type
  • $additionalConnectionParams (array) Additional connection parameters
Returns:

\OC\DB\Connection

public OC\DB\ConnectionFactory::normalizeType($type)
Source:

lib/private/DB/ConnectionFactory.php#171

Parameters:
  • $type (string) DBMS type
Returns:

string Normalized DBMS type

public OC\DB\ConnectionFactory::isValidType($type)
Checks whether the specified DBMS type is valid.
Source:

lib/private/DB/ConnectionFactory.php#181

Parameters:
  • $type (string)
Returns:

bool

public OC\DB\ConnectionFactory::createConnectionParams()
Create the connection parameters for the config
Source:lib/private/DB/ConnectionFactory.php#191
Returns:array
protected OC\DB\ConnectionFactory::splitHostFromPortAndSocket($host)
Source:

lib/private/DB/ConnectionFactory.php#240

Parameters:
  • $host (string)
Returns:

array