5 . PATH_SEPARATOR . get_include_path()
9 $file = str_replace(array('\\', '_'), '/', $class) . '.php';
10 $hdl = @fopen($file, 'r', true);
17 set_exception_handler(
19 if ($e instanceof Exception) {
20 header('HTTP/1.0 ' . $e->httpStatusCode);
22 header('HTTP/1.0 500 Internal server error');
28 'debug' => $GLOBALS['phorkie']['cfg']['debug']
35 require_once __DIR__ . '/../data/config.default.php';
36 if (file_exists(__DIR__ . '/../data/config.php')) {
37 require_once __DIR__ . '/../data/config.php';
39 require_once 'VersionControl/Git.php';
40 require_once 'Twig/Autoloader.php';
41 \Twig_Autoloader::register();
43 $loader = new \Twig_Loader_Filesystem($GLOBALS['phorkie']['cfg']['tpl']);
44 $twig = new \Twig_Environment(
47 //'cache' => '/path/to/compilation_cache',
52 function render($tplname, $vars)
54 $vars['css'] = $GLOBALS['phorkie']['cfg']['css'];
55 $template = $GLOBALS['twig']->loadTemplate($tplname . '.htm');
56 echo $template->render($vars);
58 function redirect($target)
60 header('Location: ' . $target);