summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMalf Furious <m@lfurio.us>2017-02-13 04:23:49 -0500
committerMalf Furious <m@lfurio.us>2017-02-13 04:23:49 -0500
commita4bdf800e224a64fc704b6d19b668287f030a3e8 (patch)
tree0ae64f8936ba55805c97d2cfc9dfe9791087cfce
parent30fc005d7cea626184ee57f3dea88881ad6cf6fa (diff)
downloadscrott-a4bdf800e224a64fc704b6d19b668287f030a3e8.tar.gz
scrott-a4bdf800e224a64fc704b6d19b668287f030a3e8.zip
Add function database::checkConfig()
-rw-r--r--app/class/database.class.php17
1 files changed, 17 insertions, 0 deletions
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;
+ }
}
?>