diff options
author | Robin Appelman <icewind1991@gmail.com> | 2011-10-16 20:47:25 +0200 |
---|---|---|
committer | Robin Appelman <icewind1991@gmail.com> | 2011-10-16 21:11:03 +0200 |
commit | d11a8f4103c4de974f2f52c30defaeb7c1055819 (patch) | |
tree | e5f75654c55ec266dbc96d1b765dab866e6617f0 /lib/db.php | |
parent | 90c54ade673983d28d1eab810705fb6185632d2e (diff) | |
download | nextcloud-server-d11a8f4103c4de974f2f52c30defaeb7c1055819.tar.gz nextcloud-server-d11a8f4103c4de974f2f52c30defaeb7c1055819.zip |
some minor tweaks to oc_db
Diffstat (limited to 'lib/db.php')
-rw-r--r-- | lib/db.php | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/db.php b/lib/db.php index 20adff30787..ef6d1dcc8b7 100644 --- a/lib/db.php +++ b/lib/db.php @@ -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){ |