1
0
mirror of https://github.com/php/web-php.git synced 2026-03-24 07:12:16 +01:00
Files
archived-web-php/search-index.php
2011-01-01 20:49:54 +00:00

29 lines
624 B
PHP

<?php
require dirname(__FILE__) . "/include/languages.inc";
$langcode = language_convert(isset($_GET["lang"]) ? $_GET["lang"] : "en");
if (isset($_GET["description"])) {
$filename = "search-description";
$varname = "descriptionIndex";
}
else {
$filename = "search-index";
$varname = "searchIndex";
}
header("Content-Type: application/javascript");
// Will send out the proper header, if the browser supports it at all
ob_start("ob_gzhandler");
echo "$varname = ";
$file = dirname(__FILE__) . "/manual/$langcode/$filename.json";
if (is_readable($file)) {
readfile($file);
} else {
echo "[]";
}