show exception stack traces when debugging is on
[phorkie.git] / www / www-header.php
index 520d793520627c73ae116f882e0a6fdf299014dc..0a3b5628ce0d9c2e33c413b6b5e73a3a1c415fb0 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-namespace Phorkie;
+namespace phorkie;
 set_include_path(
     __DIR__ . '/../src/'
     . PATH_SEPARATOR . get_include_path()
@@ -21,12 +21,21 @@ set_exception_handler(
         } else {
             header('HTTP/1.0 500 Internal server error');
         }
-        render('exception', array('exception' => $e));
+        render(
+            'exception',
+            array(
+                'exception' => $e,
+                'debug'     => $GLOBALS['phorkie']['cfg']['debug']
+            )
+        );
         exit();
     }
 );
 
 require_once __DIR__ . '/../data/config.default.php';
+if (file_exists(__DIR__ . '/../data/config.php')) {
+    require_once __DIR__ . '/../data/config.php';
+}
 require_once 'VersionControl/Git.php';
 require_once 'Twig/Autoloader.php';
 \Twig_Autoloader::register();
@@ -42,6 +51,7 @@ $twig = new \Twig_Environment(
 
 function render($tplname, $vars)
 {
+    $vars['css'] = $GLOBALS['phorkie']['cfg']['css'];
     $template = $GLOBALS['twig']->loadTemplate($tplname . '.htm');
     echo $template->render($vars);
 }