summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8301653)
raw | patch | inline | side by side (parent: 8301653)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 11 May 2010 05:42:22 +0000 (05:42 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 11 May 2010 05:42:22 +0000 (05:42 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@18308 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/class_config.inc | patch | blob | history |
index 314867e2da3fa9ae123df7ea5a69839c2ad58e66..7715388dd4482505629424e1e475ca7c3b91c19b 100644 (file)
*
*
*/
- function get_cfg_value($class,$name, $default= "")
+ function get_cfg_value($class,$name, $default= NULL)
{
+ // The default parameter is deprecated
+ if($default != NULL){
+# trigger_error("Third parameter 'default' is deprecated for function 'get_cfg_value'!");
+ }
+ // Return the matching property value if it exists.
if($this->configRegistry->propertyExists($class,$name)){
return($this->configRegistry->getPropertyValue($class,$name));
}
- syslog(1, $name);
+ // Show a warning in the syslog if there is an undefined property requested.
+ syslog(1,"Unconfigured property: {$class}::{$name}");
+ // Try to find the property in the config file directly.
$name= strtoupper($name);
-
- /* Check if we have a current value for $name */
- if (isset($this->current[$name])){
- return ($this->current[$name]);
- }
-
- /* Check if we have a global value for $name */
- if (isset($this->data["MAIN"][$name])){
- return ($this->data["MAIN"][$name]);
- }
-
- return ($default);
+ if (isset($this->current[$name])) return ($this->current[$name]);
+ if (isset($this->data["MAIN"][$name])) return ($this->data["MAIN"][$name]);
+ return ("");
}