From a4bdf800e224a64fc704b6d19b668287f030a3e8 Mon Sep 17 00:00:00 2001 From: Malf Furious Date: Mon, 13 Feb 2017 04:23:49 -0500 Subject: Add function database::checkConfig() --- app/class/database.class.php | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'app/class/database.class.php') diff --git a/app/class/database.class.php b/app/class/database.class.php index 74587f5..cdfdfce 100644 --- a/app/class/database.class.php +++ b/app/class/database.class.php @@ -98,6 +98,23 @@ abstract class database { return self::getInstance()->_esc($str); } + + /* + * Check whether Scrott's database config is loaded + */ + public static function checkConfig() : bool + { + try + { + $db = self::getInstance(); + } + catch (Exception $e) + { + return false; + } + + return true; + } } ?> -- cgit v1.2.3