summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/config.php9
-rw-r--r--lib/partials.php16
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