diff options
author | Bart Visscher <bartv@thisnet.nl> | 2013-07-29 17:46:20 +0200 |
---|---|---|
committer | Bart Visscher <bartv@thisnet.nl> | 2013-08-02 13:14:18 +0200 |
commit | 943288542804996687d41c548acf25800d270a49 (patch) | |
tree | 462ea3705691f2209ea5ee5de0db7d99ff554d25 /lib/db.php | |
parent | eed63ae5127680011256093588a7c68ca95ddd02 (diff) | |
download | nextcloud-server-943288542804996687d41c548acf25800d270a49.tar.gz nextcloud-server-943288542804996687d41c548acf25800d270a49.zip |
Change OC_DB_Schema to use DI for db connection object
Diffstat (limited to 'lib/db.php')
-rw-r--r-- | lib/db.php | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/lib/db.php b/lib/db.php index dd48c329490..a618e8ebb94 100644 --- a/lib/db.php +++ b/lib/db.php @@ -397,7 +397,8 @@ class OC_DB { */ public static function getDbStructure( $file, $mode=MDB2_SCHEMA_DUMP_STRUCTURE) { self::connectDoctrine(); - return OC_DB_Schema::getDbStructure(self::$DOCTRINE, $file); + $schema = new \OC\DB\Schema(self::$connection); + return $schema->getDbStructure($file); } /** @@ -409,7 +410,9 @@ class OC_DB { */ public static function createDbFromStructure( $file ) { self::connectDoctrine(); - return OC_DB_Schema::createDbFromStructure(self::$DOCTRINE, $file); + $schema = new \OC\DB\Schema(self::$connection); + $result = $schema->createDbFromStructure($file); + return $result; } /** @@ -420,8 +423,9 @@ class OC_DB { */ public static function updateDbFromStructure($file) { self::connectDoctrine(); + $schema = new \OC\DB\Schema(self::$connection); try { - $result = OC_DB_Schema::updateDbFromStructure(self::$DOCTRINE, $file); + $result = $schema->updateDbFromStructure($file); } catch (Exception $e) { OC_Log::write('core', 'Failed to update database structure ('.$e.')', OC_Log::FATAL); throw $e; @@ -601,7 +605,8 @@ class OC_DB { */ public static function dropTable($tableName) { self::connectDoctrine(); - OC_DB_Schema::dropTable(self::$DOCTRINE, $tableName); + $schema = new \OC\DB\Schema(self::$connection); + $schema->dropTable($tableName); } /** @@ -610,7 +615,8 @@ class OC_DB { */ public static function removeDBStructure($file) { self::connectDoctrine(); - OC_DB_Schema::removeDBStructure(self::$DOCTRINE, $file); + $schema = new \OC\DB\Schema(self::$connection); + $schema->removeDBStructure($file); } /** @@ -619,7 +625,8 @@ class OC_DB { */ public static function replaceDB( $file ) { self::connectDoctrine(); - OC_DB_Schema::replaceDB(self::$DOCTRINE, $file); + $schema = new \OC\DB\Schema(self::$connection); + $schema->replaceDB($file); } /** |