Website
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
function az_content(string $rel): array {
|
||||
static $cache = [];
|
||||
if (!isset($cache[$rel])) {
|
||||
$file = $_SERVER['DOCUMENT_ROOT'] . '/content/' . $rel;
|
||||
$data = json_decode((string) file_get_contents($file), true);
|
||||
if (!is_array($data)) {
|
||||
http_response_code(500);
|
||||
exit('Content file missing or invalid: ' . htmlspecialchars($rel));
|
||||
}
|
||||
$cache[$rel] = $data;
|
||||
}
|
||||
return $cache[$rel];
|
||||
}
|
||||
Reference in New Issue
Block a user