class Illuminate / Database / Connectors / ConnectionFactory

ConnectionFactory

Properties

protected

$container Container

The IoC container instance.

Default: null

Methods

public

__construct ( Container $container ) : void

Create a new connection factory instance.

Parameters

public

make ( array $config , $name ) : Connection

Establish a PDO connection based on the configuration.

Parameters

  • $config array
  • $name string|null
protected

parseConfig ( array $config , $name ) : array

Parse and prepare the database configuration.

Parameters

  • $config array
  • $name string
protected

createSingleConnection ( array $config ) : Connection

Create a single database connection instance.

Parameters

  • $config array
protected

createReadWriteConnection ( array $config ) : Connection

Create a read / write database connection instance.

Parameters

  • $config array
protected

createReadPdo ( array $config ) : Closure

Create a new PDO instance for reading.

Parameters

  • $config array
protected

getReadConfig ( array $config ) : array

Get the read configuration for a read / write connection.

Parameters

  • $config array
protected

getWriteConfig ( array $config ) : array

Get the write configuration for a read / write connection.

Parameters

  • $config array
protected

getReadWriteConfig ( array $config , $type ) : array

Get a read / write level configuration.

Parameters

  • $config array
  • $type string
protected

mergeReadWriteConfig ( array $config , array $merge ) : array

Merge a configuration for a read / write connection.

Parameters

  • $config array
  • $merge array
protected

createPdoResolver ( array $config ) : Closure

Create a new Closure that resolves to a PDO instance.

Parameters

  • $config array
protected

createPdoResolverWithHosts ( array $config ) : Closure

Create a new Closure that resolves to a PDO instance with a specific host or an array of hosts.

Parameters

  • $config array
protected

parseHosts ( array $config ) : array

Parse the hosts configuration item into an array.

Parameters

  • $config array
protected

createPdoResolverWithoutHosts ( array $config ) : Closure

Create a new Closure that resolves to a PDO instance where there is no configured host.

Parameters

  • $config array
public

createConnector ( array $config ) : ConnectorInterface

Create a connector instance based on the configuration.

Parameters

  • $config array
protected

createConnection ( $driver , $connection , $database , $prefix , array $config ) : Connection

Create a new connection instance.

Parameters

  • $driver string
  • $connection PDO |Closure
  • $database string
  • $prefix string
  • $config array