docs & typos
[mdref/mdref] / public / index.php
1 <?php
2
3 define("ROOT", dirname(__DIR__));
4 define("REFS", getenv("REFPATH") ?: implode(PATH_SEPARATOR, glob(ROOT."/refs/*")));
5
6 $loader = require __DIR__ . "/../vendor/autoload.php";
7 /* @var $loader \Composer\Autoload\ClassLoader */
8 $loader->add("mdref", ROOT);
9
10 use http\Controller;
11 use http\Controller\Url;
12 use http\Controller\Observer\Layout;
13
14 use mdref\ExceptionHandler;
15 use mdref\Action;
16
17 new ExceptionHandler;
18
19 $ctl = new Controller;
20 $ctl->setDependency("baseUrl", new Url)
21 ->attach(new Action)
22 ->attach(new Layout)
23 ->notify()
24 ->getResponse()
25 ->send();