-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
39 lines (31 loc) · 1004 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
$encoding = 'UTF-8';
header("Content-Type: text/html" . ($encoding ? "; charset=$encoding" : ""));
$modi = max(
array_map('filemtime',
array_diff(
array_merge(
scandir(__DIR__),
array_map(
function ($e) {
return 'sections' . DIRECTORY_SEPARATOR . $e;
},
scandir('sections')
)
),
array('.', '..')
)
)
);
header('Last-Modified: ' . gmdate('D, d M Y H:i:s', $modi) . ' GMT');
/* Cached resource expires in HTTP/1.1 caches 0 (-24-) h after last retrieval */
header('Cache-Control: max-age=0, s-maxage=0, must-revalidate, proxy-revalidate');
/* Cached resource expires in HTTP/1.0 caches 0 (-24-) h after last retrieval */
header('Expires: ' . gmdate('D, d M Y H:i:s', time() /*+ 86400*/) . ' GMT');
$doc = new DOMDocument();
$doc->substituteEntities = true;
$xsl = new XSLTProcessor();
$doc->load('index.xsl');
$xsl->importStyleSheet($doc);
$doc->load('index.xml');
echo $xsl->transformToXML($doc);