I like the idea in general. Better change it to be : drupal_set($key, $value = NULL, $module='system', $force = FALSE) This way we just have key and value being mandatory. This will be useful for widespread variables like $user for example. On 9/30/05, Karoly Negyesi <karoly@negyesi.net> wrote:
Hi!
global variables are hard to debug and error prone. Let's make it explicit:
drupal_set($module, $key, $value = NULL, $force = FALSE) { static $storage; if ($value || $force) { $storage[$module][$key] = $value; } return $storage[$module][$key]; }
drupal_get($module, $key) { return drupal_set($module, $key); }
$force is useful when you want to set to NULL ie. delete a value.
If we can't find a revelant module for a core global value, we can use 'system'.
Regards
NK