projects
/
mdref
/
mdref
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
|
github
raw
|
inline
| side by side
fix cli-server
[mdref/mdref]
/
public
/
index.php
diff --git
a/public/index.php
b/public/index.php
index 23a1be2cf1a8595337669918a3438a80f4ef27fe..56cf3a27fb6119c75db0cd626237eed489fe6a5d 100644
(file)
--- a/
public/index.php
+++ b/
public/index.php
@@
-1,27
+1,23
@@
<?php
<?php
+use mdref\Action;
+use mdref\BaseUrl;
+use mdref\Reference;
+use mdref\ExceptionHandler;
+
+use http\Env\Request;
+use http\Env\Response;
+
define("ROOT", dirname(__DIR__));
define("ROOT", dirname(__DIR__));
-define("REFS", getenv("REFPATH") ?: implode(PATH_SEPARATOR, glob(ROOT."/refs/*")));
-ini_set("open_basedir", ROOT.":".REFS);
+
#
ini_set("open_basedir", ROOT.":".REFS);
$loader = require ROOT . "/vendor/autoload.php";
/* @var $loader \Composer\Autoload\ClassLoader */
$loader->add("mdref", ROOT);
$loader = require ROOT . "/vendor/autoload.php";
/* @var $loader \Composer\Autoload\ClassLoader */
$loader->add("mdref", ROOT);
-use http\Controller;
-use http\Controller\Url;
-use http\Controller\Observer\Layout;
-
-use mdref\ExceptionHandler;
-use mdref\Action;
-
new ExceptionHandler;
new ExceptionHandler;
-$ctl = new Controller;
-$ctl->setDependency("baseUrl", new Url)
- ->attach(new Action)
- ->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);
+$action->handle();