/** * Database object constructor * * @param array $options List of options used to configure the connection * */ public function __construct($options) { $options['host'] = isset($options['host']) ? $options['host'] : 'localhost'; $options['user'] = isset($options['user']) ? $options['user'] : ''; $options['password'] = isset($options['password']) ? $options['password'] : ''; $options['database'] = isset($options['database']) ? $options['database'] : ''; // Finalize initialization parent::__construct($options); }
/** * Constructor. * * @param array $options List of options used to configure the connection * */ public function __construct($options) { // Get some basic values from the options. $options['host'] = isset($options['host']) ? $options['host'] : 'localhost'; $options['user'] = isset($options['user']) ? $options['user'] : ''; $options['password'] = isset($options['password']) ? $options['password'] : ''; $options['database'] = isset($options['database']) ? $options['database'] : ''; $options['select'] = isset($options['select']) ? (bool) $options['select'] : true; // Finalize initialisation parent::__construct($options); }
/** * Constructor. * * @param array $options List of options used to configure the connection * * @since 1.0 */ public function __construct($options) { // Get some basic values from the options. $options['driver'] = isset($options['driver']) ? $options['driver'] : 'odbc'; $options['dsn'] = isset($options['dsn']) ? $options['dsn'] : ''; $options['host'] = isset($options['host']) ? $options['host'] : 'localhost'; $options['database'] = isset($options['database']) ? $options['database'] : ''; $options['user'] = isset($options['user']) ? $options['user'] : ''; $options['password'] = isset($options['password']) ? $options['password'] : ''; $options['driverOptions'] = isset($options['driverOptions']) ? $options['driverOptions'] : array(); // Finalize initialisation parent::__construct($options); }