new entry sorting; style updates
[mdref/mdref] / public / index.php
index 58ec5fe565cec71e20192088a1b0592fbc4b6099..e6d0f75a4ce4a9fe449d1cd92c8f81c97b9c7570 100644 (file)
@@ -13,14 +13,18 @@ define("REFS", getenv("REFPATH") ?: implode(PATH_SEPARATOR, glob(ROOT."/refs/*")
 
 ini_set("open_basedir", ROOT.PATH_SEPARATOR.REFS);
 
+if (!ini_get("date.timezone")) {
+       date_default_timezone_set("UTC");
+}
+
 spl_autoload_register(function($c) {
        if (!strncmp($c, "mdref\\", 6)) {
                return require ROOT . "/" . strtr($c, "\\", "/") . ".php";
        }
 });
 
-new ExceptionHandler;
-
+$response = new Response;
+$ehandler = new ExceptionHandler($response);
 $reference = new Reference(explode(PATH_SEPARATOR, REFS));
-$action = new Action($reference, new Request, new Response, new BaseUrl);
+$action = new Action($reference, new Request, $response, new BaseUrl);
 $action->handle();