summaryrefslogtreecommitdiff
path: root/web/config.php
diff options
context:
space:
mode:
Diffstat (limited to 'web/config.php')
-rw-r--r--web/config.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/web/config.php b/web/config.php
new file mode 100644
index 0000000..eff0d0f
--- /dev/null
+++ b/web/config.php
@@ -0,0 +1,13 @@
+<?php
+
+$c = parse_ini_file($_SERVER['DOCUMENT_ROOT'] . '/irclogs.ini', true);
+
+if (!isset($c['database'], $c['database']['driver'], $c['database']['name'], $c['database']['hostweb'], $c['database']['user'], $c['database']['pass'])) {
+ throw new RuntimeException("Database credentials must be set in irclogs.ini!");
+}
+
+define('DB_URL', "{$c['database']['driver']}:dbname={$c['database']['name']};host={$c['database']['hostweb']}");
+define('DB_USER', $c['database']['user']);
+define('DB_PASS', $c['database']['pass']);
+
+define('INSTANCE_NAME', $c['instance']['name'] ?: $_SERVER['HTTP_HOST']); \ No newline at end of file