Пример #1
0
 /**
  * This method takesccase of registration all modules
  *
  * @param $app Name
  *            of the part of application
  */
 protected function registerModules($app)
 {
     if (!class_exists('\\Modules\\Factory')) {
         return;
     }
     // register the modules path, if you can
     $modules_path = $this->dir . "/src/" . $this->namespace . "/Modules/";
     if (!file_exists($modules_path)) {
         // let's try more specific route
         $modules_path = $this->dir . "/src/" . $this->namespace . '/' . $app . "/Modules/";
         if (!file_exists($modules_path)) {
             // not even here? maybe more luck next time
             $modules_path = '';
         }
     }
     if (strlen($modules_path)) {
         \Modules\Factory::registerPath($modules_path);
     }
 }