MySqlConnector
class MySqlConnector extends Connector implements ConnectorInterface
Traits
Properties
protected array | $options | The default PDO connection options. |
from Connector |
Methods
Determine if the given exception was caused by a lost connection.
Create a new PDO connection.
Create a new PDO connection instance.
Determine if the connection is persistent.
Handle an exception that occurred during connect execution.
Get the collation for the configuration.
Create a DSN string from a configuration.
Determine if the given configuration array has a UNIX socket value.
Get the DSN string for a socket configuration.
Get the DSN string for a host / port configuration.
Get the query to enable strict mode.
Details
in
DetectsLostConnections at line 16
protected bool
causedByLostConnection(Exception $e)
Determine if the given exception was caused by a lost connection.
in
Connector at line 36
PDO
createConnection(string $dsn, array $config, array $options)
Create a new PDO connection.
in
Connector at line 62
protected PDO
createPdoConnection(string $dsn, string $username, string $password, array $options)
Create a new PDO connection instance.
in
Connector at line 77
protected bool
isPersistentConnection(array $options)
Determine if the connection is persistent.
in
Connector at line 95
protected PDO
tryAgainIfCausedByLostConnection(Exception $e, string $dsn, string $username, string $password, array $options)
Handle an exception that occurred during connect execution.
in
Connector at line 110
array
getOptions(array $config)
Get the PDO options based on the configuration.
in
Connector at line 122
array
getDefaultOptions()
Get the default PDO connection options.
in
Connector at line 133
void
setDefaultOptions(array $options)
Set the default PDO connection options.
at line 15
PDO
connect(array $config)
Establish a database connection.
at line 49
protected void
configureEncoding(PDO $connection, array $config)
Set the connection character set and collation.
at line 66
protected string
getCollation(array $config)
Get the collation for the configuration.
at line 78
protected void
configureTimezone(PDO $connection, array $config)
Set the timezone on the connection.
at line 93
protected string
getDsn(array $config)
Create a DSN string from a configuration.
Chooses socket or host/port based on the 'unix_socket' config value.
at line 106
protected bool
hasSocket(array $config)
Determine if the given configuration array has a UNIX socket value.
at line 117
protected string
getSocketDsn(array $config)
Get the DSN string for a socket configuration.
at line 128
protected string
getHostDsn(array $config)
Get the DSN string for a host / port configuration.
at line 144
protected void
setModes(PDO $connection, array $config)
Set the modes for the connection.
at line 164
protected void
setCustomModes(PDO $connection, array $config)
Set the custom modes on the connection.
at line 176
protected string
strictMode()
Get the query to enable strict mode.