diff options
| author | ilotterytea <iltsu@alright.party> | 2025-08-04 11:43:53 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-08-04 11:43:53 +0500 |
| commit | f79c8898cf716c142b47ac239182ce9933e5f8c0 (patch) | |
| tree | a719572ce10d604c9ed7d8cbebaeb403d204ed42 /web/config.php | |
| parent | 9a20de85770f2f5ba09ad492aa2fb06782966096 (diff) | |
feat: web
Diffstat (limited to 'web/config.php')
| -rw-r--r-- | web/config.php | 13 |
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 |
