summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Schmidt <tschmidt@suse.de>2011-09-30 14:40:17 +0200
committerThomas Schmidt <tschmidt@suse.de>2011-09-30 14:40:17 +0200
commit7fb89c5386fe7f1a1e238853a24d1da556ab9719 (patch)
tree60a2222842c490760174a412bc356a13d56ba5d6
parent51e68729de3402fd7bc90e123c432538659b6b31 (diff)
downloadnextcloud-server-7fb89c5386fe7f1a1e238853a24d1da556ab9719.tar.gz
nextcloud-server-7fb89c5386fe7f1a1e238853a24d1da556ab9719.zip
enhance detection of un-initialized database
-rw-r--r--lib/MDB2/Driver/sqlite3.php6
-rw-r--r--lib/db.php8
2 files changed, 14 insertions, 0 deletions
diff --git a/lib/MDB2/Driver/sqlite3.php b/lib/MDB2/Driver/sqlite3.php
index a41aeed4850..967e3335b13 100644
--- a/lib/MDB2/Driver/sqlite3.php
+++ b/lib/MDB2/Driver/sqlite3.php
@@ -582,6 +582,12 @@ class MDB2_Driver_sqlite3 extends MDB2_Driver_Common
return $query;
}
+ /* Dummy interface for sqlite, to stay compatible with the database abstraction */
+ function getUserInfo() {
+ return "sqlite standard user";
+ }
+
+
// }}}
// {{{ getServerVersion()
diff --git a/lib/db.php b/lib/db.php
index ede8ba897e9..4bcb184b100 100644
--- a/lib/db.php
+++ b/lib/db.php
@@ -97,6 +97,14 @@ class OC_DB {
die( $error );
}
+ self::$DBConnection->loadModule('Manager');
+ if (count(self::$DBConnection->listTables()) == 0) {
+ $error = 'database tables not initialized, using '.$CONFIG_DBTYPE.'. ('.self::$DBConnection->getUserInfo() . ')';
+ if(defined("DEBUG") && DEBUG) {error_log( $error);}
+ if(defined("DEBUG") && DEBUG) {error_log( self::$DBConnection->getUserInfo());}
+ die( $error );
+ }
+
// We always, really always want associative arrays
self::$DBConnection->setFetchMode(MDB2_FETCHMODE_ASSOC);