Example #1
0
 public function router()
 {
     //get the nodes to node object
     $this->nodes();
     require_once 'app' . DS . 'root.php';
     $controller = new ControllerRoot();
     if (!isset($this->n1)) {
         $controller->main();
     } elseif (method_exists('controllerRoot', $this->n1)) {
         $method = $this->n1;
         $controller->{$method}();
     } else {
         $controller->main();
     }
 }
Example #2
0
 public function main()
 {
     //set the configuration
     $config = json_decode(file_get_contents('config.json'));
     foreach ($config as $property => &$value) {
         $this->{$property} =& $value;
     }
     $root = $this->SITE->ROOT;
     define('ROOT', $root);
     if (!$this->SITE->INSTALLATION) {
         require_once 'app/root.php';
         $rootObj = new ControllerRoot();
         $rootObj->installation();
         exit;
     }
     //load the node file and initiate the process of routing
     require_once "lib" . DS . "node.php";
     $node = pathang::getInstance('node');
     $node->router();
 }