Enabled a param so that some calls to getValue() are not fatal

This commit is contained in:
Deon George
2009-07-05 13:55:27 +10:00
parent 8e8db2e4ed
commit db2e8861fa
2 changed files with 6 additions and 4 deletions

View File

@@ -69,16 +69,18 @@ abstract class DS {
/**
* Return a configuration value
*/
public function getValue($key,$setting) {
public function getValue($key,$setting,$fatal=true) {
if (isset($this->custom->{$key}[$setting]))
return $this->custom->{$key}[$setting];
elseif (isset($this->default->{$key}[$setting]) && array_key_exists('default',$this->default->{$key}[$setting]))
return $this->default->{$key}[$setting]['default'];
else {
elseif ($fatal)
debug_dump_backtrace("Error trying to get a non-existant value ($key,$setting)",1);
}
else
return null;
}
/**