|
|
@@ -1164,14 +1164,18 @@ function revokeToken($array)
|
|
|
|
|
|
function getSchema()
|
|
|
{
|
|
|
- try {
|
|
|
- $connect = new Dibi\Connection([
|
|
|
- 'driver' => 'sqlite3',
|
|
|
- 'database' => $GLOBALS['dbLocation'] . $GLOBALS['dbName'],
|
|
|
- ]);
|
|
|
- $result = $connect->fetchAll(' SELECT name, sql FROM sqlite_master WHERE type=\'table\' ORDER BY name');
|
|
|
- return $result;
|
|
|
- } catch (Dibi\Exception $e) {
|
|
|
- return false;
|
|
|
+ if (file_exists('config' . DIRECTORY_SEPARATOR . 'config.php')) {
|
|
|
+ try {
|
|
|
+ $connect = new Dibi\Connection([
|
|
|
+ 'driver' => 'sqlite3',
|
|
|
+ 'database' => $GLOBALS['dbLocation'] . $GLOBALS['dbName'],
|
|
|
+ ]);
|
|
|
+ $result = $connect->fetchAll(' SELECT name, sql FROM sqlite_master WHERE type=\'table\' ORDER BY name');
|
|
|
+ return $result;
|
|
|
+ } catch (Dibi\Exception $e) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ return 'DB not set yet...';
|
|
|
}
|
|
|
}
|