Uniform behaviour, preferring site-specific overrides and falling back
to shared files (without requiring symlinks).
<?php
$body = getoutput(@$Place);
-include_once DOCROOT.'head.inc.php';
+include_once 'head.inc.php';
print "<header>\n";
ob_start();
-include DOCROOT.'menu.html';
+include 'menu.html';
ob_start();
if (!empty($User)) {
print '<div class="login"><p>';
register_shutdown_function(function () {
print '<footer>';
- @include DOCROOT.'footer.html';
+ @include 'footer.html';
print "</footer>\n";
global $User;
# custom error handling
-define('DOCROOT', getcwd().'/');
+define('DOCROOT', getcwd());
+set_include_path(implode(PATH_SEPARATOR, [ DOCROOT, __DIR__ ]));
function fail($error)
{
http_response_code(500);
include_once 'page.inc.php';
ob_start();
- require_once DOCROOT.'500.html';
+ require_once '500.html';
print getoutput(['debug' => $error]);
}
if (!$found) {
# no resulting output
http_response_code(404);
- @require "./404.html";
+ @require '404.html';
}
include_once 'page.inc.php';