X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=public%2Findex.php;h=853c0916398ec77e7878c34c8ec99ff8d5aaa2e0;hb=17dc7637588fb5d34bdc13e17e52db49f02bd3d8;hp=1e6d37f83bcf26f45822e31c68db7065f5d65b45;hpb=6478b415c59070f70ed860f3a592377eef9783b1;p=mdref%2Fmdref diff --git a/public/index.php b/public/index.php index 1e6d37f..853c091 100644 --- a/public/index.php +++ b/public/index.php @@ -1,27 +1,27 @@ add("mdref", ROOT); -use http\Controller; -use http\Controller\Url; -use http\Controller\Observer\Layout; - -use mdref\ExceptionHandler; -use mdref\Action; - new ExceptionHandler; -$ctl = new Controller; -$ctl->setDependency("baseUrl", new Url) - ->attach(new Action(["refpath" => REFS])) - ->attach(new Layout) - ->notify() - ->getResponse() - ->send(); +$reference = new Reference(($refs = getenv("REFPATH")) ? explode(PATH_SEPARATOR, $refs) : glob(ROOT."/refs/*")); +$action = new Action($reference, new Request, new Response, new BaseUrl); + +ob_start($response); +$action->handle(); +ob_end_flush(); +$response->send();