[development] DEP - cascading variable system
weitzman at tejasa.com
Wed Nov 30 16:55:11 UTC 2005
>  user settings. system table, user domain, userid key.
>  theme settings. system table, theme domain, theme name key.
>  system settings. system table, system domain.
>  $GLOBALS['defaults']
>  $default
so variable_get() will return the right value based on the priority
above? please add that to the DEP if it isn't there already.
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.
in general, i'm a bit hesitant about storing user variables in the
variables table. thats what $user object and users.data column and
$_SESSION are for. Would you get rid of users.data? Maybe get rid of
that users.data and change users.module to write to variables table
instead. while you are there, move users.timezone and other non critical
fields from columns in the users table to records in the variables table.
one other nit - in drupal, higher numbers have lower priority so the
table above could be numbered in reverse.
FEATURE REQUESTS for a rainy day ...
- have some way to cleanup the variables table of cruft from disabled
- in variable_get(), return a hint about what layer provided the value,
so the front end can grey out the form field if necessary.
More information about the development