100 lines
1.7 KiB
YAML
100 lines
1.7 KiB
YAML
|
name: MySqlConnector
|
||
|
class_comment: null
|
||
|
dependencies:
|
||
|
- name: PDO
|
||
|
type: class
|
||
|
source: PDO
|
||
|
properties: []
|
||
|
methods:
|
||
|
- name: connect
|
||
|
visibility: public
|
||
|
parameters:
|
||
|
- name: config
|
||
|
comment: '# * Establish a database connection.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param array $config
|
||
|
|
||
|
# * @return \PDO'
|
||
|
- name: getDsn
|
||
|
visibility: protected
|
||
|
parameters:
|
||
|
- name: config
|
||
|
comment: '# * Create a DSN string from a configuration.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * Chooses socket or host/port based on the ''unix_socket'' config value.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param array $config
|
||
|
|
||
|
# * @return string'
|
||
|
- name: hasSocket
|
||
|
visibility: protected
|
||
|
parameters:
|
||
|
- name: config
|
||
|
comment: '# * Determine if the given configuration array has a UNIX socket value.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param array $config
|
||
|
|
||
|
# * @return bool'
|
||
|
- name: getSocketDsn
|
||
|
visibility: protected
|
||
|
parameters:
|
||
|
- name: config
|
||
|
comment: '# * Get the DSN string for a socket configuration.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param array $config
|
||
|
|
||
|
# * @return string'
|
||
|
- name: getHostDsn
|
||
|
visibility: protected
|
||
|
parameters:
|
||
|
- name: config
|
||
|
comment: '# * Get the DSN string for a host / port configuration.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param array $config
|
||
|
|
||
|
# * @return string'
|
||
|
- name: configureConnection
|
||
|
visibility: protected
|
||
|
parameters:
|
||
|
- name: connection
|
||
|
- name: config
|
||
|
comment: '# * Configure the given PDO connection.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param \PDO $connection
|
||
|
|
||
|
# * @param array $config
|
||
|
|
||
|
# * @return void'
|
||
|
- name: getSqlMode
|
||
|
visibility: protected
|
||
|
parameters:
|
||
|
- name: connection
|
||
|
- name: config
|
||
|
comment: '# * Get the sql_mode value.
|
||
|
|
||
|
# *
|
||
|
|
||
|
# * @param \PDO $connection
|
||
|
|
||
|
# * @param array $config
|
||
|
|
||
|
# * @return string|null'
|
||
|
traits:
|
||
|
- PDO
|
||
|
interfaces:
|
||
|
- ConnectorInterface
|