/** * Constructor. * * @param array $options Array of database options with keys: host, user, password, database, select. * * @since 1.0 */ public function __construct($options) { // Get some basic values from the options. $options['driver'] = 'mysql'; $options['charset'] = isset($options['charset']) ? $options['charset'] : 'utf8'; $this->charset = $options['charset']; // Finalize initialisation. parent::__construct($options); }
/** * Constructor. * * @param array $options List of options used to configure the connection * * @since 1.0 */ public function __construct($options) { $options['driver'] = 'oci'; $options['charset'] = isset($options['charset']) ? $options['charset'] : 'AL32UTF8'; $options['dateformat'] = isset($options['dateformat']) ? $options['dateformat'] : 'RRRR-MM-DD HH24:MI:SS'; $this->charset = $options['charset']; $this->dateformat = $options['dateformat']; // Finalize initialisation parent::__construct($options); }
/** * Database object constructor * * @param array $options List of options used to configure the connection * * @since __DEPLOY_VERSION__ */ public function __construct($options) { $options['driver'] = 'pgsql'; $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['port'] = isset($options['port']) ? $options['port'] : null; // Finalize initialization parent::__construct($options); }
/** * Constructor. * * @param array $options Array of database options with keys: host, user, password, database, select. * * @since 1.0 */ public function __construct($options) { // Get some basic values from the options. $options['driver'] = 'mysql'; $options['charset'] = isset($options['charset']) ? $options['charset'] : 'utf8'; $this->charset = $options['charset']; /* * Pre-populate the UTF-8 Multibyte compatibility flag. Unfortunately PDO won't report the server version unless we're connected to it, * and we cannot connect to it unless we know if it supports utf8mb4, which requires us knowing the server version. Because of this * chicken and egg issue, we _assume_ it's supported and we'll just catch any problems at connection time. */ $this->utf8mb4 = $options['charset'] == 'utf8mb4'; // Finalize initialisation. parent::__construct($options); }