diff options
| author | ilotterytea <iltsu@alright.party> | 2025-12-06 16:03:44 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-12-06 16:03:44 +0500 |
| commit | 880776528c0acf361ee06b8a5ec6c4071c329d7f (patch) | |
| tree | c28600a0d369860ac1f0849b1fac7c04723ec4b1 /lib | |
initial commit
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/config.php | 9 | ||||
| -rw-r--r-- | lib/partials.php | 16 |
2 files changed, 25 insertions, 0 deletions
diff --git a/lib/config.php b/lib/config.php new file mode 100644 index 0000000..6481767 --- /dev/null +++ b/lib/config.php @@ -0,0 +1,9 @@ +<?php +$config = []; + +$file_path = "{$_SERVER['DOCUMENT_ROOT']}/config.ini"; +if (file_exists($file_path)) { + $config = parse_ini_file($file_path, true); +} + +define('INSTANCE_NAME', $config['instance']['name'] ?? $_SERVER['HTTP_HOST']);
\ No newline at end of file diff --git a/lib/partials.php b/lib/partials.php new file mode 100644 index 0000000..493b469 --- /dev/null +++ b/lib/partials.php @@ -0,0 +1,16 @@ +<?php +include_once $_SERVER['DOCUMENT_ROOT'] . '/lib/config.php'; + +function render_header() +{ + echo '' ?> + <header> + <div class="banner"> + <h1><?= INSTANCE_NAME ?></h1> + </div> + <div class="links"> + <a href="/">Home</a> + </div> + </header> + <?php ; +}
\ No newline at end of file |
