Fix dsn issue in tests
This commit is contained in:
parent
bed0d1bb04
commit
8e16cc0c19
@ -38,7 +38,7 @@ class MySQL extends DB_PDO {
|
|||||||
*/
|
*/
|
||||||
public function __construct($dsn, $username=null, $password=null, $options=array())
|
public function __construct($dsn, $username=null, $password=null, $options=array())
|
||||||
{
|
{
|
||||||
// Automatically set the charset to UTF-8
|
// Set the charset to UTF-8
|
||||||
if (defined('PDO::MYSQL_ATTR_INIT_COMMAND'))
|
if (defined('PDO::MYSQL_ATTR_INIT_COMMAND'))
|
||||||
{
|
{
|
||||||
$options = array_merge($options, array(
|
$options = array_merge($options, array(
|
||||||
@ -46,6 +46,8 @@ class MySQL extends DB_PDO {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (strpos($dsn, 'mysql') === FALSE) $dsn = 'mysql:'.$dsn;
|
||||||
|
|
||||||
parent::__construct($dsn, $username, $password, $options);
|
parent::__construct($dsn, $username, $password, $options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,6 +31,8 @@ class PgSQL extends DB_PDO {
|
|||||||
*/
|
*/
|
||||||
public function __construct($dsn, $username=null, $password=null, $options=array())
|
public function __construct($dsn, $username=null, $password=null, $options=array())
|
||||||
{
|
{
|
||||||
|
if (strpos($dsn, 'pgsql') === FALSE) $dsn = 'pgsql:'.$dsn;
|
||||||
|
|
||||||
parent::__construct($dsn, $username, $password, $options);
|
parent::__construct($dsn, $username, $password, $options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user