[dev] New horde conf.xml

Rick Emery rick at emery.homelinux.net
Fri Jan 30 14:44:27 PST 2004


I've noticed some problems with the new conf.xml system for horde. Namely, if a
value is left blank, the value is not generated. Let me explain with an
example (I'm not sure how to best exaplin it with words :-)

$conf['prefs']['maxsize']. The comments say to leave it empty to skip the
checking for max length. In conf.php.dist, it defaults to null. Using
conf.xml, if the value is left empty, then $conf['prefs']['maxsize'] is not
set, leading to (a lot of) "Undefined index 'maxsize'" errors.

I had the same problem when setting the partner ID and the license key for the
weather.com block. In conf.php.dist, I set
$conf['weatherdotcom']['partner_id'] = ''; (I guess null would have worked
too). In conf.xml, it was never set, resulting in undefined index errors. I
came up with two ways of dealing with this.

1. If no value is entered, generate the value anyway, and set it to null (or an
empty string). I haven't looked at it, but I think this would require changes
in the way the conf.xml files are generated, and currently all of the other
conf.xml files seem to work.

2. Everywhere the values are used, check for their existence with isset()
before checking the values. This is how I did it in my patch to
weatherdotcom.php.

I just wanted to make someone aware of the problem, and seek feedback on the
best way to handle it.

Thanks for listening (or reading, as it were),
Rick

--
Rick Emery

"When once you have tasted flight, you will forever walk the Earth
 with your eyes turned skyward, for there you have been, and there
 you will always long to return"
                                              -- Leonardo Da Vinci



More information about the dev mailing list