9 use function spl_autoload_register
;
12 use const GLOB_ONLYDIR
;
13 use const PATH_SEPARATOR
;
17 define("ROOT", dirname(__DIR__
));
18 define("REFS", getenv("REFPATH") ?
: implode(PATH_SEPARATOR
, glob(ROOT
."/refs/*", GLOB_ONLYDIR
)));
20 ini_set("open_basedir", ROOT
.PATH_SEPARATOR
.REFS
);
22 if (!ini_get("date.timezone")) {
23 date_default_timezone_set("UTC");
26 spl_autoload_register(function($c) {
27 if (!strncmp($c, "mdref\\", 6)) {
28 return require ROOT
. "/" . strtr($c, "\\", "/") . ".php";
32 $response = new Response
;
33 $ehandler = new ExceptionHandler($response);
34 $reference = new Reference(explode(PATH_SEPARATOR
, REFS
));
35 $action = new Action($reference, new Request
, $response, new BaseUrl
);