[development] DEP - cascading variable system

Michelangelo Partipilo michelangelo_pm at cantv.net
Wed Nov 30 18:55:44 UTC 2005


What about module settings per user? Let's say I write an Album Module 
and I want each user to be able to select the way his gallery should be 
presented, or the theme that should be used for it. Of course I could 
put these on a DB table, but that wouldn't that just add more tables and 
module logic? These wouldn't be needed if this is implemented.

Gerhard Killesreiter wrote:
> Chris Johnson wrote:
> 
>> Moshe Weitzman wrote:
>>
>>> about #4. I'd like for user variables to be loaded into the $user 
>>> object  so that we don't go to the DB for them multiple times on a 
>>> page view. For example, lets say we invent a user pref called 'show 
>>> signatures' and I set that to FALSE because I am on a low bandwidth 
>>> connection. I would not want a variable_get('show signatures') to hit 
>>> the DB every time we show a node or comment. maybe a static cache 
>>> would solve this.
>>
>>
>>
>> Umm, doesn't variable_get() only hit the database the _first_ time the 
>> variable is requested on a page?  After that, it's in the global 
>> $conf, isn't it?
> 
> 
> 
> Right. More specifically: The cached serialized array of variables is 
> retrieved from the cache table and the vars are assigned to the $conf 
> array. You can override those with vars from settings.php
> 
>>
>> In general, I think it makes sense to keep user variables in 
>> user-related tables, *not* in the {variables} table.
>>
> 
> Anybody pursuing the user-variables-in-variable-table idea in earnest 
> has just had a bad idea. (no, that is not waht I intended to write 
> originally)
> 
> Cheers,
>    Gerhard
> 


More information about the development mailing list