Index: trunk/core/kernel/utility/unit_config_reader.php =================================================================== diff -u -r3620 -r4000 --- trunk/core/kernel/utility/unit_config_reader.php (.../unit_config_reader.php) (revision 3620) +++ trunk/core/kernel/utility/unit_config_reader.php (.../unit_config_reader.php) (revision 4000) @@ -131,10 +131,11 @@ function ParseConfigs() { - foreach ($this->configData as $prefix => $config) - { + foreach ($this->configData as $prefix => $config) { $this->parseConfig($prefix); } + + $this->Application->HandleEvent( new kEvent('m:OnAfterConfigRead') ); } function findConfigFiles($folderPath) @@ -383,13 +384,20 @@ * option specified by $option * * @param string $prefix - * @param string $option + * @param string $name + * @param mixed $default * @return string * @access public */ - function getUnitOption($prefix,$name) + function getUnitOption($prefix, $name, $default = false) { - return isset($this->configData[$prefix][$name]) ? $this->configData[$prefix][$name] : false; + if (preg_match('/(.*)\.(.*)/', $prefix, $rets)) { + $ret = getArrayValue($this->configData, $rets[1], $name, $rets[2]); + } + else { + $ret = getArrayValue($this->configData, $prefix, $name); + } + return $ret === false ? $default : $ret; } /** @@ -412,9 +420,15 @@ * @param string $value * @access public */ - function setUnitOption($prefix,$name,$value) + function setUnitOption($prefix, $name, $value) { - $this->configData[$prefix][$name] = $value; + if (preg_match('/(.*)\.(.*)/', $prefix, $rets)) { + $this->configData[$rets[1]][$name][$rets[2]] = $value; + } + else { + $this->configData[$prefix][$name] = $value; + } + } function getPrefixByParamName($paramName,$prefix)