Example #1
0
 /**
  * Reads a configuration file of a module ($modulename . '.config.php')
  *
  * @param $modulename Name of Module
  * @return array Module Configuration Array
  */
 public function readModuleConfig($modulename = null)
 {
     // if no modulename is set, determine the name of the current module
     if ($modulename === null) {
         $modulename = Koch\Router\TargetRoute::getModuleName();
     }
     $file = ROOT_MOD . $modulename . DIRECTORY_SEPARATOR . $modulename . '.config.php';
     if (is_file($file)) {
         return Factory::getConfiguration($configfile);
     } else {
         // module has no configuration file
         return array();
     }
 }
Example #2
0
File: Config.php Project: ksst/kf
 /**
  * Reads a configuration file of a module ($modulename . '.config.php').
  *
  * @param string $module Name of Module
  *
  * @return array Module Configuration Array
  */
 public function readModuleConfig($module = null)
 {
     // if no modulename is set, determine the name of the current module
     $module = $module === null ? \Koch\Router\TargetRoute::getModule() : ucfirst($module);
     $file = APPLICATION_MODULES_PATH . $module . DIRECTORY_SEPARATOR . $module . '.config.php';
     $result = is_file($file) ? Factory::getConfiguration($file) : [];
     return $result;
 }