[development] DEP - cascading variable system

Adrian Rossouw adrian at bryght.com
Wed Nov 30 19:24:37 UTC 2005


On 30 Nov 2005, at 10:12 PM, Gerhard Killesreiter wrote:

> Michelangelo Partipilo wrote:
>
>> 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.
>>
>
> Hi, glad you are back.
>
> it is a bad idea because you would have a variable for each user.  
> On Drupal.org it would mean 40000 variables. Those would be (with  
> the current design) loaded per page view and maybe break you php  
> memory limit.

They would not all be loaded into memory at the same time..

each layer gets loaded individually.

So the only ones loaded by default are the ones specified in code  
(default or override), and then each other layer would get  
initialised seperately.

ie: variable_load('user', $user->uid);
blog module might have variable_load('blog', $user->uid);
themes might have variable_load($themes, $GLOBALS['theme']);

This would only load something IF the user has overridden any  
specific settings, and then only specifically those
variables that have been changed.


--
Adrian Rossouw
Drupal developer and Bryght Guy
http://drupal.org | http://bryght.com




More information about the development mailing list