some minor tweaks to oc_db

This commit is contained in:
Robin Appelman 2011-10-16 20:47:25 +02:00
parent 90c54ade67
commit d11a8f4103
1 changed files with 4 additions and 2 deletions

View File

@ -43,6 +43,9 @@ class OC_DB {
* Connects to the database as specified in config.php
*/
public static function connect(){
if(self::$connection){
return;
}
if(class_exists('PDO') && OC_Config::getValue('installed', false)){//check if we can use PDO, else use MDB2 (instalation always needs to be done my mdb2)
self::connectPDO();
self::$connection=self::$PDO;
@ -64,8 +67,7 @@ class OC_DB {
$user = OC_Config::getValue( "dbuser", "" );
$pass = OC_Config::getValue( "dbpassword", "" );
$type = OC_Config::getValue( "dbtype", "sqlite" );
$SERVERROOT=OC::$SERVERROOT;
$datadir=OC_Config::getValue( "datadirectory", "$SERVERROOT/data" );
$datadir=OC_Config::getValue( "datadirectory", OC::$SERVERROOT.'/data' );
// do nothing if the connection already has been established
if(!self::$PDO){