/**
  * Routing controllers.
  *
  * @access private
  */
 private function __construct()
 {
     /** Objects are created for the functioning of the class. * */
     $this->oConfig = Config::getInstance();
     $this->oRegistry = Registry::getInstance();
     $this->oHttpRequest = new Http();
     $this->oUri = Uri::getInstance();
     $this->indexFileRouter();
     if ($this->oUri->fragment(0) === 'asset' && $this->oUri->fragment(1) === 'gzip') {
         // Loading and compress CSS and JavaScript files
         $this->gzipRouter();
         exit;
     }
     /**
      * @internal We initialize the database after compression of static files (\PH7\Framework\Mvc\Router\FrontController::gzipRouter() method),
      * so we can always display static files even if there are problems with the database.
      */
     $this->_databaseInitialize();
     /**
      * @internal This method must be declared before the rest of the code, because it initializes essential language constants for the rest of the code.
      */
     $this->_languageInitialize();
     // For the resources of the assets folders
     if ($this->oUri->fragment(0) === 'asset') {
         switch ($this->oUri->fragment(1)) {
             case 'ajax':
                 // Loading Asynchronous Ajax files
                 $this->ajaxRouter();
                 break;
             case 'file':
                 // Loading files
                 $this->fileRouter();
                 break;
             case 'cron':
                 // Loading Cron Jobs files
                 $this->cronRouter();
                 break;
             case 'css':
                 // Loading Style sheet files
                 $this->cssRouter();
                 break;
             case 'js':
                 // Loading JavaScript files
                 $this->jsRouter();
                 break;
             default:
                 $this->notFound('Not found Asset file!', 1);
         }
         exit;
     }
     $oUrl = UriRoute::loadFile(new \DomDocument());
     foreach ($oUrl->getElementsByTagName('route') as $oRoute) {
         if (preg_match('`^' . $oRoute->getAttribute('url') . '/?(?:\\?[^/]+\\=[^/]+)?$`', $this->oHttpRequest->requestUri(), $aMatches)) {
             $this->bRouterRewriting = true;
             $sPathModule = $oRoute->getAttribute('path') . PH7_SH;
             // Get module
             $this->oRegistry->module = $oRoute->getAttribute('module');
             // Check if file exist
             if (!$this->oConfig->load(PH7_PATH_APP . $sPathModule . $this->oRegistry->module . PH7_DS . PH7_CONFIG . PH7_CONFIG_FILE)) {
                 $this->notFound('The <b>' . $this->oRegistry->module . '</b> system module is not found.<br />File: <b>' . PH7_PATH_APP . $sPathModule . $this->oRegistry->module . PH7_DS . '</b><br /> or the <b>' . PH7_CONFIG_FILE . '</b> file is not found.<br />File: <b>' . PH7_PATH_APP . $sPathModule . $this->oRegistry->module . PH7_DS . PH7_CONFIG . PH7_CONFIG_FILE . '</b>');
                 // It reloads the config.ini file for the new module "error"
                 $this->oConfig->load(PH7_PATH_MOD . $this->oRegistry->module . PH7_DS . PH7_CONFIG . PH7_CONFIG_FILE);
             }
             /***** PATH THE MODULE *****/
             $this->oRegistry->path_module = PH7_PATH_APP . $sPathModule . $this->oRegistry->module . PH7_DS;
             /***** URL THE MODULE *****/
             $this->oRegistry->url_module = PH7_URL_ROOT . $this->oRegistry->module . PH7_SH;
             /***** PATH THE TEMPLATE *****/
             $this->oRegistry->path_themes_module = PH7_PATH_ROOT . PH7_LAYOUT . $sPathModule . $this->oRegistry->module . PH7_DS . PH7_TPL;
             /***** URL THE TEMPLATE *****/
             $this->oRegistry->url_themes_module = PH7_RELATIVE . PH7_LAYOUT . $sPathModule . $this->oRegistry->module . PH7_SH . PH7_TPL;
             // Get the default controller
             $this->oRegistry->controller = ucfirst($oRoute->getAttribute('controller')) . 'Controller';
             // Get the default action
             $this->oRegistry->action = $oRoute->getAttribute('action');
             if ($oRoute->hasAttribute('vars')) {
                 $aVars = explode(',', $oRoute->getAttribute('vars'));
                 $iOffset = count($aVars);
                 foreach ($aMatches as $sKey => $sMatch) {
                     if ($sKey !== 0) {
                         $this->oHttpRequest->setGet($aVars[$sKey - 1], $sMatch);
                         /** Request Parameter for the Router Rewriting mode. * */
                         $this->aRequestParameter = $this->oUri->segments($this->oUri->totalFragment() - $iOffset);
                     }
                 }
             }
             break;
         }
     }
     unset($oUrl);
     if (empty($this->bRouterRewriting)) {
         if ($this->oUri->fragment(0) === 'm') {
             $this->simpleModuleRouter();
         } else {
             $this->simpleRouter();
         }
     }
 }