diff options
author | xue <> | 2006-01-25 02:17:16 +0000 |
---|---|---|
committer | xue <> | 2006-01-25 02:17:16 +0000 |
commit | 7c46396e4ade67e61dad6259030a72a783f37515 (patch) | |
tree | 26ef3f8d75c82c2937908b403010e6d0bbac0881 /framework | |
parent | 3f803219e784b53f363b5ef25b3be00fd310fb1c (diff) |
Modified parameter parsing logic so that it can return as an XML node.
Diffstat (limited to 'framework')
-rw-r--r-- | framework/TApplication.php | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/framework/TApplication.php b/framework/TApplication.php index fde385b7..80c55e44 100644 --- a/framework/TApplication.php +++ b/framework/TApplication.php @@ -747,15 +747,15 @@ class TApplication extends TComponent $this->_parameters=new TMap; foreach($config->getParameters() as $id=>$parameter) { - if(is_string($parameter)) - $this->_parameters->add($id,$parameter); - else + if(is_array($parameter)) { $component=Prado::createComponent($parameter[0]); foreach($parameter[1] as $name=>$value) $component->setSubProperty($name,$value); $this->_parameters->add($id,$component); } + else + $this->_parameters->add($id,$parameter); } // load and init modules specified in app config @@ -1073,7 +1073,12 @@ class TApplicationConfiguration extends TComponent if(($id=$properties->remove('id'))===null) throw new TConfigurationException('appconfig_parameterid_required'); if(($type=$properties->remove('class'))===null) - $this->_parameters[$id]=$node->getValue(); + { + if(($value=$properties->remove('value'))===null) + $this->_parameters[$id]=$node; + else + $this->_parameters[$id]=$value; + } else $this->_parameters[$id]=array($type,$properties->toArray()); } |