MySqlConnector

class MySqlConnector extends Connector implements ConnectorInterface (View source)

Properties

protected array $options The default PDO connection options. from Connector

Methods

array getOptions(array $config)

Get the PDO options based on the configuration.

from Connector
PDO createConnection(string $dsn, array $config, array $options)

Create a new PDO connection.

from Connector
array getDefaultOptions()

Get the default PDO connection options.

from Connector
void setDefaultOptions(array $options)

Set the default PDO connection options.

from Connector
PDO connect(array $config)

Establish a database connection.

string getDsn(array $config)

Create a DSN string from a configuration. Chooses socket or host/port based on the 'unix_socket' config value

bool configHasSocket(array $config)

Determine if the given configuration array has a UNIX socket value.

string getSocketDsn(array $config)

Get the DSN string for a socket configuration.

string getHostDsn(array $config)

Get the DSN string for a host / port configuration.

Details

array getOptions(array $config)

Get the PDO options based on the configuration.

Parameters

array $config

Return Value

array

PDO createConnection(string $dsn, array $config, array $options)

Create a new PDO connection.

Parameters

string $dsn
array $config
array $options

Return Value

PDO

array getDefaultOptions()

Get the default PDO connection options.

Return Value

array

void setDefaultOptions(array $options)

Set the default PDO connection options.

Parameters

array $options

Return Value

void

PDO connect(array $config)

Establish a database connection.

Parameters

array $config

Return Value

PDO

protected string getDsn(array $config)

Create a DSN string from a configuration. Chooses socket or host/port based on the 'unix_socket' config value

Parameters

array $config

Return Value

string

protected bool configHasSocket(array $config)

Determine if the given configuration array has a UNIX socket value.

Parameters

array $config

Return Value

bool

protected string getSocketDsn(array $config)

Get the DSN string for a socket configuration.

Parameters

array $config

Return Value

string

protected string getHostDsn(array $config)

Get the DSN string for a host / port configuration.

Parameters

array $config

Return Value

string

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/4.2/Illuminate/Database/Connectors/MySqlConnector.html