/**
* connect to the database using pdo
*/
- private static function connectPDO(){
+ public static function connectPDO(){
+ if(self::$connection){
+ if(self::$backend==self::BACKEND_MDB2){
+ self::disconnect();
+ }else{
+ return;
+ }
+ }
// The global data we need
$name = OC_Config::getValue( "dbname", "owncloud" );
$host = OC_Config::getValue( "dbhost", "" );
/**
* connect to the database using mdb2
*/
- static private function connectMDB2(){
+ public static function connectMDB2(){
+ if(self::$connection){
+ if(self::$backend==self::BACKEND_PDO){
+ self::disconnect();
+ }else{
+ return;
+ }
+ }
// The global data we need
$name = OC_Config::getValue( "dbname", "owncloud" );
$host = OC_Config::getValue( "dbhost", "" );
self::$connection->disconnect();
}
self::$connection=false;
- self::$mdb2=false;
- self::$pdo=false;
+ self::$MDB2=false;
+ self::$PDO=false;
}
return true;
private static function connectScheme(){
// We need a mdb2 database connection
self::connectMDB2();
+ self::$MDB2->loadModule('Manager');
// Connect if this did not happen before
if(!self::$schema){