30 Sep
2005
30 Sep
'05
7:35 p.m.
On Fri, Sep 30, 2005 at 02:19:51PM +0200, Karoly Negyesi 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); }
How about drupal_(set|get)_global(). And drupal_(set|get)_object() can be used to get statically cached objects (nodes, terms, users, vocabularies, etc) from the db. -Neil