2 require_once __DIR__ . '/../data/config.default.php';
3 require_once 'VersionControl/Git.php';
4 require_once 'Twig/Autoloader.php';
5 Twig_Autoloader::register();
7 $loader = new Twig_Loader_Filesystem($GLOBALS['phorkie']['cfg']['tpl']);
8 $twig = new Twig_Environment(
11 //'cache' => '/path/to/compilation_cache',
16 function render($tplname, $vars)
18 $template = $GLOBALS['twig']->loadTemplate($tplname . '.htm');
19 echo $template->render($vars);
21 function redirect($target)
23 header('Location: /' . $target);
26 function errout($statusCode, $message)
28 header('HTTP/1.0 ' . $statusCode);
32 function get_type_from_file($file)
34 return substr($file, strrpos($file, '.') + 1);