From f8049fa087b6565a5462fc0c2778b4903af83fbd Mon Sep 17 00:00:00 2001 From: Trevor Slocum Date: Mon, 30 Nov 2020 17:04:46 -0800 Subject: [PATCH] Update default SQLite database path --- inc/defines.php | 6 +++++- settings.default.php | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/inc/defines.php b/inc/defines.php index 264abbd..10417e1 100644 --- a/inc/defines.php +++ b/inc/defines.php @@ -80,7 +80,11 @@ if (!defined('TINYIB_DBDSN')) { define('TINYIB_DBDSN', ''); } if (!defined('TINYIB_DBPATH')) { - define('TINYIB_DBPATH', 'tinyib.db'); + if (file_exists('tinyib.db')) { + define('TINYIB_DBPATH', 'tinyib.db'); + } else { + define('TINYIB_DBPATH', '.tinyib.db'); + } } if (!isset($tinyib_hidefieldsop)) { $tinyib_hidefieldsop = array(); diff --git a/settings.default.php b/settings.default.php index 6c6e495..9368de5 100644 --- a/settings.default.php +++ b/settings.default.php @@ -118,7 +118,7 @@ define('TINYIB_DBNAME', ''); // Database // Database configuration - SQLite / SQLite3 // The following only apply when TINYIB_DBMODE is set to sqlite or sqlite3 -define('TINYIB_DBPATH', 'tinyib.db'); // SQLite DB path relative to inc/ +define('TINYIB_DBPATH', '.tinyib.db'); // SQLite DB path // Database configuration - PDO // The following only apply when TINYIB_DBMODE is set to pdo (see README for instructions)