1 |
<?php |
2 |
/** |
3 |
*/ |
4 |
|
5 |
$t0 = microtime(); |
6 |
|
7 |
/** Below variables are defined after the document variables. */ |
8 |
|
9 |
/** URL of the document calling the service. */ |
10 |
$url = isset($_GET['u']) ? trim($_GET['u']) : null; |
11 |
|
12 |
/** html[lang] of the doc. */ |
13 |
$lang = isset($_GET['l']) ? trim($_GET['l']) : null; |
14 |
if ($lang == 'undefined' || |
15 |
$lang == '') { |
16 |
|
17 |
$lang = 'en'; |
18 |
} |
19 |
|
20 |
/** body[class] of the doc. */ |
21 |
$body = isset($_GET['b']) ? trim($_GET['b']) : null; |
22 |
|
23 |
/** meta[name=context] */ |
24 |
$context = isset($_GET['c']) ? trim($_GET['c']) : null; |
25 |
|
26 |
/** wrap the returned HTML in <header id="hmgn" />? */ |
27 |
$wrap = isset($_GET['w']) ? true : false; |
28 |
|
29 |
include '../lib.php'; |
30 |
|
31 |
header('Access-Control-Allow-Origin: *'); |
32 |
header('Access-Control-Allow-Methods: GET'); |
33 |
header('Content-Type: text/html;charset=utf-8'); |
34 |
header(sprintf('Expires: %s', gmdate('r', strtotime('+1 day')))); |
35 |
|
36 |
echo _mgnav_html($wrap, $lang, null, 'www.mageia.org', NCache::build('var/tmp/cache')); |
37 |
|
38 |
apache_note('navMakeTime', number_format(microtime() - $t0, 6)); |