Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authorRobin Appelman <icewind1991@gmail.com>2010-09-11 23:09:53 +0400
committerRobin Appelman <icewind1991@gmail.com>2010-09-11 23:09:53 +0400
commit1d1bb352d92376edbb572771941dd807dc167fa5 (patch)
tree64af9424ae48f1b2debd628e755c7ec79b002d0b /inc
parentaf8b66c2c368cee8dbd57591a0daa2566f63af96 (diff)
do not initialize mdb2_scheme if we don't use it, saves a lot of time
Diffstat (limited to 'inc')
-rw-r--r--inc/lib_base.php10
1 files changed, 8 insertions, 2 deletions
diff --git a/inc/lib_base.php b/inc/lib_base.php
index 19288f58c73..3f7a98d7ac3 100644
--- a/inc/lib_base.php
+++ b/inc/lib_base.php
@@ -403,6 +403,12 @@ class OC_DB {
die(self::$DBConnection->getMessage());
}
self::$DBConnection->setFetchMode(MDB2_FETCHMODE_ASSOC);
+ }
+ }
+
+ public static function connectScheme(){
+ self::connect();
+ if(!self::$schema){
self::$schema=&MDB2_Schema::factory(self::$DBConnection);
}
}
@@ -570,7 +576,7 @@ class OC_DB {
}
static function getDbStructure($file){
- OC_DB::connect();
+ OC_DB::connectScheme();
$definition = self::$schema->getDefinitionFromDatabase();
$dump_options = array(
'output_mode' => 'file',
@@ -581,7 +587,7 @@ class OC_DB {
}
static function createDbFromStructure($file){
- OC_DB::connect();
+ OC_DB::connectScheme();
global $CONFIG_DBNAME;
global $CONFIG_DBTABLEPREFIX;
$content=file_get_contents($file);