Moved router to Modules. Router is no longer a Core class.

This commit is contained in:
Abel Hoogeveen 2015-02-10 21:04:31 +01:00
parent 22d835257e
commit 69998316be
4 changed files with 4 additions and 4 deletions

View File

@ -13,6 +13,8 @@ class Router extends Bus {
parent::__construct($core);
}
public function onLoad() {}
public function setPath($path) {
if (substr($path, -1, 1) == '/')
$path = substr($path, 0, strlen($path)-1);

View File

@ -10,7 +10,6 @@ abstract class Bus {
protected $models;
protected $layout;
protected $events;
protected $router;
protected function __construct(&$core){
$this->core = &$core;
@ -21,8 +20,8 @@ abstract class Bus {
$this->models = &$core->mods->models;
$this->layout = &$core->mods->layout;
$this->events = &$core->mods->events;
$this->router = &$core->mods->router;
}
}
// Holds the mods in a seperate object besides the bus

View File

@ -35,7 +35,6 @@ class Core {
require_once(FUZESYSPATH . "/class.models.php");
require_once(FUZESYSPATH . "/class.layout.php");
require_once(FUZESYSPATH . "/class.events.php");
require_once(FUZESYSPATH . "/class.router.php");
// Load them
$this->mods->events = new Events ($this);
@ -43,7 +42,6 @@ class Core {
$this->mods->logger = new Logger ($this);
$this->mods->models = new Models ($this);
$this->mods->layout = new Layout ($this);
$this->mods->router = new Router ($this);
}
public function shutdown() {

View File

@ -9,6 +9,7 @@ require_once( dirname(__FILE__) . "/Core/System/class.core.php");
// Load it
$core = new Core();
$core->init();
$core->loadMod('router');
$core->mods->router->setPath( (isset($_GET['path']) ? $_GET['path'] : null) );
$core->mods->router->route();