[development] Variables, lookups, and memory usage
Adrian Rossouw
adrian at bryght.com
Thu Dec 15 19:47:55 UTC 2005
On 15 Dec 2005, at 9:34 PM, Allie Micka wrote:
>>> I think discussed adding "domains" to the variable table a while
>>> back
>>> on this list.
>>
>> Yes,. It was actually the first test DEP that I wrote. You can
>> probably search the mailing list for it.
>
> I admit I didn't take the time to absorb it fully, but It seems
> that the cascading variable system is about values and overriding
> them (think vertical), where the lookup stuff is more about
> segmenting/grouping data (think horizontal)
It's both. You can get the top variable on the stack, or you can get
the variable out of just one layer. Without the last parameter to
variable_get, it just gets it from the top of the stack.
What it comes down to, is it's a more sane data storage mechanism
than the data column in the user field for instance. Although there's
a definite schism
between variables (that change how the system works) and properties
(ie: profile fields and the like). And once we step down that line ..
we are on CCK's turf.
I envision being able to set $user->settings as an associative array,
and then in the back end it uses the variables table to store that.
Think of user as one of
these realms.
Same with views, or email, or whatever.
It only loads one of the realms when you specify it in your code, and
then any lookups against it are cheap.
--
Adrian Rossouw
Drupal developer and Bryght Guy
http://drupal.org | http://bryght.com
More information about the development
mailing list