advanced build (1/2): a small refactor of index generating procedure; generation strategies

This commit is contained in:
czaks
2016-05-08 10:54:30 +02:00
parent 644f227ab3
commit b6f0317bde
8 changed files with 169 additions and 47 deletions

View File

@@ -3,14 +3,16 @@ require_once("inc/functions.php");
require_once("inc/route.php");
require_once("inc/controller.php");
if (!$config['smart_build'] && !$config["smart_build_helper"]) {
die('You need to enable $config["smart_build"] or $config["smart_build_helper"]');
if (!$config["smart_build_helper"]) {
die('You need to enable $config["smart_build_helper"]');
}
$config['smart_build'] = false; // Let's disable it, so we can build the page for real
$config['generation_strategies'] = array('strategy_immediate');
function after_open_board() { global $config;
$config['smart_build'] = false;
$config['generation_strategies'] = array('strategy_immediate');
};
$request = $_SERVER['REQUEST_URI'];
@@ -59,6 +61,9 @@ if ($reached) {
elseif (preg_match('/\.xml$/', $request)) {
header("Content-Type", "application/xml");
}
elseif (preg_match('/\.rss$/', $request)) {
header("Content-Type", "application/rss+xml");
}
else {
header("Content-Type", "text/html; charset=utf-8");
}