Right, but, now you need to specify yourself as the namespace every time you set a variable. That's adding a lot of bulk.<br><br>Robin<br><br><div><span class="gmail_quote">On 5/3/07, <b class="gmail_sendername">Syscrusher
</b> <<a href="mailto:syscrusher@4th.com">syscrusher@4th.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">On Thursday 03 May 2007 14:29, Robin Monks wrote:
<br>> New names for variable functions--<br><br>Here's a suggestion:<br><br> string variable(string $name, string $namespace='', string $value=NULL)<br><br>Semantics:<br><br> variable($name)<br> returns the value of the specified variable in the current module's
<br> namespace (or the Drupal system namespace, if you prefer), or returns<br> the default if not defined, or returns NULL if no default<br><br> variable($name, $namespace)<br> returns the value of the specified variable in the specified namespace,
<br> or returns the default if not defined, or returns NULL if no default<br><br> variable($name, $namespace, $value)<br> stores $value for the specified variable in the specified namespace,<br> if $value is not null. Returns $value as-stored, both to preserve
<br> semantic consistency AND to reflect any data changes done by the<br> variable-handling code (for instance, if it did an implied trim()).<br> For now, probably a straight pass-through.<br><br>And we add one function that typically would be used only by deinstalls:
<br><br> boolean variable_unset(string $name, string $namespace)<br> removes the specified variable from storage permanently, returning TRUE<br> if successful or if the variable already didn't exist, FALSE if there
<br> was some kind of database error or if the $namespace didn't exist. In<br> other words, missing $name in valid $namespace is okay, just a no-op,<br> but invalid $namespace is an error condition.<br>
<br>The behavior of variable() is consistent with similar functions I've worked<br>with in other environments, such as REXX's GLOBALV function on mainframes.<br>It also would allow a fairly easy wrapper for legacy compatibility.
<br><br>Scott<br><br>--<br>-------------------------------------------------------------------------------<br>Syscrusher (Scott Courtney) Drupal page: <a href="http://drupal.org/user/9184">http://drupal.org/user/9184
</a><br>syscrusher at 4th dot com Home page: <a href="http://4th.com/">http://4th.com/</a><br></blockquote></div><br><br clear="all"><br>-- <br>Robin Monks<br>@ <a href="http://www.civicspacelabs.org">www.civicspacelabs.org
</a><br>@ <a href="http://www.gmking.org">www.gmking.org</a><br><br>Fax: (419) 791-8076<br><br>"Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems." ~IRC