lithium\data\source\database\adapter\MySql::__construct()
Overrides
lithium\data\Source::__construct()
Constructor.
Parameters
-
array
$config
The available configuration options are the following. Further options are inherited from the parent classes. Typically, these parameters are set in
Connections::add()
, when adding the adapter to the list of active connections.'host'
string: A string in the form of'<host>'
,'<host>:<port>'
or':<port>'
indicating the host and/or port to connect to. When one or both are not provided uses general server defaults. To use Unix sockets specify the path to the socket (i.e.'/path/to/socket'
).'strict'
boolean|null: Whentrue
will enable strict mode by setting sql-mode toSTRICT_ALL_TABLES
. Whenfalse
will disable strict mode explictly by settings sql-mode to an empty value`. A value of
null` leaves the setting untouched (this is the default) and the default setting of the database is used.
Returns
voidLinks
Source
public function __construct(array $config = []) {
$defaults = [
'host' => static::DEFAULT_HOST . ':' . static::DEFAULT_PORT,
'strict' => null
];
parent::__construct($config + $defaults);
}