summaryrefslogtreecommitdiff
path: root/holidays.php
blob: a48868b0b10487eee93935a1888725dfd2402330 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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");