enhance detection of un-initialized database

This commit is contained in:
Thomas Schmidt 2011-09-30 14:40:17 +02:00
parent 51e68729de
commit 7fb89c5386
2 changed files with 14 additions and 0 deletions

View File

@ -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()

View File

@ -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);