lithium\data\source\Database::__construct()
Overrides
lithium\data\Source::__construct()
Constructor.
Parameters
-
$config
array
Available configuration options are:
'database'
string: Name of the database to use. Defaults tonull
.'host'
string: Name/address of server to connect to. Defaults to'localhost'
.'login'
string: Username to use when connecting to server. Defaults to'root'
.'password'
string: Password to use when connecting to server. Defaults to''
.'persistent'
boolean: If true a persistent connection will be attempted, provided the adapter supports it. Defaults totrue
.'options'
array: An array with additional PDO options. Maps (driver specific) PDO attribute constants to values.
Returns
voidSource
public function __construct(array $config = []) {
$defaults = [
'persistent' => true,
'host' => 'localhost',
'login' => 'root',
'password' => '',
'database' => null,
'encoding' => null,
'dsn' => null,
'options' => []
];
parent::__construct($config + $defaults);
}