[dev] Annoyance in Registry.php

David Ulevitch davidu@everydns.net
Fri, 5 Jul 2002 05:54:01 -0700 (PDT)


<quote who="Jan Schneider">
> I see no reason why anybody should wanna have a different backend for an
> application's preferences, but I see a reason that an application's
> configuration may depend on a user's preference.

Well lets see:

In Registry.php the order is:
1) $this->importConfig('horde');
2) $this->loadPrefs($app);
3) $this->importConfig($app);

In loadPrefs($app) we have (assuming authenticated):
1) global $conf;
2) $prefs = &Prefs::factory($conf['prefs']['driver'], $app,
Auth::getAuth(),
Auth::getCredential('password'),$conf['prefs']['params']);

So when 2 is called and Registry step 3 hasn't occured, any custom $conf
entries in $APP/config/conf.php are not in $conf and thus loadPrefs step2
which uses the variable: $conf['prefs']['driver'] is set to the horde
default and even if overridden in the $APP/config/conf.php it is not read.
 if Registry.php step3 is run BEFORE loadPrefs($app) then $conf holds the
correct values from the eyes of the application developer.

Is this not correct?

-davidu

-- 
"Never doubt that a small group of thoughtful citizens can change the
world. Indeed, it is the only thing that ever has." --Margaret Mead