summaryrefslogtreecommitdiff
path: root/holidays.php
diff options
context:
space:
mode:
Diffstat (limited to 'holidays.php')
-rw-r--r--holidays.php19
1 files changed, 19 insertions, 0 deletions
diff --git a/holidays.php b/holidays.php
new file mode 100644
index 0000000..a48868b
--- /dev/null
+++ b/holidays.php
@@ -0,0 +1,19 @@
+<?php
+function load_holidays()
+{
+ $files = glob("../data/*.json");
+ $holidays = [];
+
+ foreach ($files as $file) {
+ $contents = file_get_contents($file);
+ array_push($holidays, json_decode($contents, true));
+ }
+
+ return $holidays;
+}
+
+define("HOLIDAYS", load_holidays());
+
+// other constants
+
+define("CLIENT_REQUIRES_JSON", isset($_SERVER["HTTP_ACCEPT"]) && $_SERVER["HTTP_ACCEPT"] == "application/json"); \ No newline at end of file