aboutsummaryrefslogtreecommitdiffhomepage
path: root/WpfTest/GlobalConfig.php
diff options
context:
space:
mode:
Diffstat (limited to 'WpfTest/GlobalConfig.php')
-rw-r--r--WpfTest/GlobalConfig.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/WpfTest/GlobalConfig.php b/WpfTest/GlobalConfig.php
new file mode 100644
index 0000000..4bbfe68
--- /dev/null
+++ b/WpfTest/GlobalConfig.php
@@ -0,0 +1,25 @@
+<?php
+namespace WpfTest;
+
+class GlobalConfig {
+ private static GlobalConfig $instance;
+
+ private function __construct() {
+
+ }
+
+ public static function getInstance() {
+ if (!isset(self::$instance)) {
+ self::$instance = new self();
+ }
+ return self::$instance;
+ }
+
+ public function getCanonicalHost(): string {
+ return $_SERVER['HTTP_HOST']; // for now this is fine
+ }
+
+ public function getBasePath(): string {
+ return 'http://' . $this->getCanonicalHost(); // fix this?
+ }
+} \ No newline at end of file