Commit 4080cefa authored by Francesco Iannuzzelli's avatar Francesco Iannuzzelli

Fix DB impl

parent b1afe532
......@@ -116,8 +116,9 @@ class Configuration
default:
$values['debug'] = (isset($conf->debug) && is_bool($conf->debug))? $conf->debug : false;
$dbconf = $conf->dbconf;
if(!isset($dbconf['impl']) || $dbconf['impl']=="")
$dbconf['impl'] = "mysql";
if(!isset($dbconf['impl']) || $dbconf['impl']=="") {
$dbconf['impl'] = "mysql";
}
$values['dbconf'] = $dbconf;
$values['db_pconn'] = (isset($conf->db_pconn) && is_bool($conf->db_pconn))? $conf->db_pconn : false;
$values['delayed_inserts'] = (isset($conf->delayed_inserts) && is_bool($conf->delayed_inserts))? $conf->delayed_inserts : true;
......
......@@ -67,21 +67,9 @@ abstract class Db
$dbconf = $conf->Get("dbconf");
$db_impl = $dbconf['impl'];
$db_pconn = $conf->Get("db_pconn");
switch($db_impl)
{
case "mysql":
case "mysql-cluster":
{
include_once(SERVER_ROOT."/../classes/dbmysql.php" );
$db_conn = new DbMysql( $dbconf['server'], $dbconf['database'], $dbconf['user'], $dbconf['password'],$db_pconn);
$db_conn->StorageEngineSet($db_impl);
}
break;
default :
UserError("Database error: no support for $db_impl",array(),256,true);
break;
}
include_once(SERVER_ROOT."/../classes/dbmysql.php" );
$db_conn = new DbMysql( $dbconf['server'], $dbconf['database'], $dbconf['user'], $dbconf['password'],$db_pconn);
$db_conn->StorageEngineSet($db_impl);
$db_conn->records_per_page = $conf->Get("records_per_page");
return $db_conn;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment