/** * Read the request configuration and parse the URL */ public function __construct() { if (!extension_loaded('midgard2')) { throw new Exception('Midgard 2.x is required for this Midgard MVC setup.'); } $this->midgardmvc = midgardmvc_core::get_instance(); try { $this->_root_page = new midgardmvc_core_node($this->midgardmvc->configuration->midgardmvc_root_page); } catch (midgard_error_exception $e) { $this->_root_page = new midgardmvc_core_node(); $this->_root_page->get_by_path('/midgardmvc_root'); } }
private function load_root_node() { if (self::$root_node) { return; } $midgardmvc = midgardmvc_core::get_instance(); if ($midgardmvc->configuration->midgardmvc_root_page) { try { $node = new midgardmvc_core_node($midgardmvc->configuration->midgardmvc_root_page); } catch (midgard_error_exception $e) { $node = new midgardmvc_core_node(); $node->get_by_path('/midgardmvc_root'); } } else { $node = new midgardmvc_core_node(); $node->get_by_path('/midgardmvc_root'); } self::$root_node_id = $node->id; self::$root_node = midgardmvc_core_providers_hierarchy_node_midgard2::get_instance($node); }