aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBart Visscher <bartv@thisnet.nl>2013-02-24 22:12:02 +0100
committerBart Visscher <bartv@thisnet.nl>2013-07-21 23:17:37 +0200
commit3e0e2cfa19389edc2da8426620b7b412819208ca (patch)
treeefea9280ded96ee5c96f766078e96aa2bda2731f
parent8a332cdc941c7f1c059dcfdf04fc851364abc1b4 (diff)
downloadnextcloud-server-3e0e2cfa19389edc2da8426620b7b412819208ca.tar.gz
nextcloud-server-3e0e2cfa19389edc2da8426620b7b412819208ca.zip
Use $connection for schema changes
-rw-r--r--lib/db.php25
1 files changed, 13 insertions, 12 deletions
diff --git a/lib/db.php b/lib/db.php
index 59fd73b37c7..b317d174313 100644
--- a/lib/db.php
+++ b/lib/db.php
@@ -347,8 +347,8 @@ class OC_DB {
* TODO: write more documentation
*/
public static function getDbStructure( $file, $mode=MDB2_SCHEMA_DUMP_STRUCTURE) {
- self::connectDoctrine();
- return OC_DB_Schema::getDbStructure(self::$DOCTRINE, $file);
+ self::connect();
+ return OC_DB_Schema::getDbStructure(self::$connection, $file);
}
/**
@@ -359,8 +359,9 @@ class OC_DB {
* TODO: write more documentation
*/
public static function createDbFromStructure( $file ) {
- self::connectDoctrine();
- return OC_DB_Schema::createDbFromStructure(self::$DOCTRINE, $file);
+ self::connect();
+ $result = OC_DB_Schema::createDbFromStructure(self::$connection, $file);
+ return $result;
}
/**
@@ -370,9 +371,9 @@ class OC_DB {
* @return bool
*/
public static function updateDbFromStructure($file) {
- self::connectDoctrine();
+ self::connect();
try {
- $result = OC_DB_Schema::updateDbFromStructure(self::$DOCTRINE, $file);
+ $result = OC_DB_Schema::updateDbFromStructure(self::$connection, $file);
} catch (Exception $e) {
OC_Log::write('core', 'Failed to update database structure ('.$e.')', OC_Log::FATAL);
throw $e;
@@ -396,8 +397,8 @@ class OC_DB {
* @param string $tableName the table to drop
*/
public static function dropTable($tableName) {
- self::connectDoctrine();
- OC_DB_Schema::dropTable(self::$DOCTRINE, $tableName);
+ self::connect();
+ OC_DB_Schema::dropTable(self::$connection, $tableName);
}
/**
@@ -405,8 +406,8 @@ class OC_DB {
* @param string $file the xml file describing the tables
*/
public static function removeDBStructure($file) {
- self::connectDoctrine();
- OC_DB_Schema::removeDBStructure(self::$DOCTRINE, $file);
+ self::connect();
+ OC_DB_Schema::removeDBStructure(self::$connection, $file);
}
/**
@@ -414,8 +415,8 @@ class OC_DB {
* @param $file string path to the MDB2 xml db export file
*/
public static function replaceDB( $file ) {
- self::connectDoctrine();
- OC_DB_Schema::replaceDB(self::$DOCTRINE, $file);
+ self::connect();
+ OC_DB_Schema::replaceDB(self::$connection, $file);
}
/**