[dev] New horde conf.xml
Jan Schneider
jan at horde.org
Sat Jan 31 08:01:20 PST 2004
Zitat von Rick Emery <rick at emery.homelinux.net>:
> 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.
The latter is the correct solution.
Jan.
--
http://www.horde.org - The Horde Project
http://www.ammma.de - Neue Wege des Lernens
http://www.tip4all.de - Deine private Tippgemeinschaft
More information about the dev
mailing list