<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">

<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
 namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:Helvetica;
        panose-1:2 11 6 4 2 2 2 2 2 4;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>

</head>

<body lang=EN-US link=blue vlink=blue style='word-wrap: break-word;-webkit-nbsp-mode: space;
-webkit-line-break: after-white-space'>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Ahh, &nbsp;static variables are supposed
to be local in scope to the function that they are in. &nbsp;&nbsp;&nbsp;And
they behave a bit differently than normal variables. <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>static $conf=&#8217;&#8217; assignment
doesn&#8217;t execute the second time the function gets called.&nbsp; It only
executes at the initial creation of the static variable.&nbsp; This variable
later gets converted to an array, but the next time the function gets called it
should retain the previous value of &nbsp;$conf.&nbsp; It would not be reset to
a string. You actually need to set static variables to this empty strings to
get them to work properly with arrays.&nbsp; I&#8217;ve done that several times
before. <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>It&#8217;s worth noting that this $conf <b><span
style='font-weight:bold'>SHOULD</span></b> be completely independent of the global
$conf variable, and that doesn&#8217;t appear to be the case for you. <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>It&#8217;s possible this is a PHP bug, but
I&#8217;m not really sure here. There are some references to such a bug at: <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><a
href="http://bugs.php.net/bug.php?id=38287">http://bugs.php.net/bug.php?id=38287</a><o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Is it possible that you are being bitten
by one of these? <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>&nbsp;I have many modules that work as you
want.&nbsp; The variable_get call pulls the database value without problem. &nbsp;&nbsp;It&#8217;s
quite possible that once the PHP bug is resolved, everything will work they way
you initially tried it. <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>And, no you should not need to call
variable_init. <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Hope that helps. <o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Dave<o:p></o:p></span></font></p>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p>&nbsp;</o:p></span></font></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
support-bounces@drupal.org [mailto:support-bounces@drupal.org] <b><span
style='font-weight:bold'>On Behalf Of </span></b>Scott Matthews<br>
<b><span style='font-weight:bold'>Sent:</span></b> Tuesday, January 29, 2008
9:43 AM<br>
<b><span style='font-weight:bold'>To:</span></b> <st1:PersonName w:st="on">support@drupal.org</st1:PersonName><br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [support] Issues with
initializing Variables on startup..</span></font><o:p></o:p></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Conf_init calls conf_path. &nbsp;the first line in conf path is:<o:p></o:p></span></font></p>

<div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&nbsp;&nbsp;static $conf = '';<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>As I said, once I globally changed the intended array variable to
something other than $conf ($config_vars for instance) it worked as expected.<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Now, as I mentioned before, before I tried to initialize in the
settings.php file, I just relied on the database value that I set. &nbsp;This
was not being retrieved when I called variables_get() and variables_get() was
only returning the value I had as the default. &nbsp;The only thing I can think
of from what you are saying is that in my module I have to specifically call
variables_init() for it to work. &nbsp;Is that true? &nbsp;when in the stack is
variables_init called?<o:p></o:p></span></font></p>

</div>

<div><span style='orphans: 2;text-align:auto;widows: 2;-webkit-border-horizontal-spacing: 0px;
-webkit-border-vertical-spacing: 0px;-webkit-text-decorations-in-effect: none;
-webkit-text-size-adjust: auto;-webkit-text-stroke-width: 0;word-spacing:0px'><span
style='orphans: 2;widows: 2;-webkit-border-horizontal-spacing: 0px;-webkit-border-vertical-spacing: 0px;
-webkit-text-decorations-in-effect: none;-webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px;word-spacing:0px'>

<div>

<p class=MsoNormal style='margin-bottom:12.0pt'><font size=1 color=black
face=Helvetica><span style='font-size:9.0pt;font-family:Helvetica;color:black'><span
style='orphans: 2;widows: 2;-webkit-border-horizontal-spacing: 0px;-webkit-border-vertical-spacing: 0px;
-webkit-text-decorations-in-effect: none;-webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px;word-spacing:0px'><o:p>&nbsp;</o:p></span></font></p>

</div>

<span style='orphans: 2;widows: 2;-webkit-border-horizontal-spacing: 0px;
-webkit-border-vertical-spacing: 0px;-webkit-text-decorations-in-effect: none;
-webkit-text-size-adjust: auto;-webkit-text-stroke-width: 0px;word-spacing:
0px'>

<div>

<p class=MsoNormal><font size=1 color=black face=Helvetica><span
style='font-size:9.0pt;font-family:Helvetica;color:black'>Scott Matthews<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=1 color=black face=Helvetica><span
style='font-size:9.0pt;font-family:Helvetica;color:black'>Senior Developer<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=1 color=black face=Helvetica><span
style='font-size:9.0pt;font-family:Helvetica;color:black'>(w) 617-227-1855 x164<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=1 color=black face=Helvetica><span
style='font-size:9.0pt;font-family:Helvetica;color:black'>(m) 617-710-8430<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=1 color=black face=Helvetica><span
style='font-size:9.0pt;font-family:Helvetica;color:black'>(f)&nbsp;617-224-5388<o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=1 color=black face=Helvetica><span
style='font-size:9.0pt;font-family:Helvetica;color:black'><a
href="mailto:smatthews@optaros.com">smatthews@optaros.com</a><o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=1 color=black face=Helvetica><span
style='font-size:9.0pt;font-family:Helvetica;color:black'><o:p>&nbsp;</o:p></span></font></p>

</div>

<p class=MsoNormal><font size=1 color=black face=Helvetica><span
style='font-size:9.0pt;font-family:Helvetica;color:black'></span><br>
<br>
<br>
</span></span></font><o:p></o:p></p>

</div>

</span></span>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

<div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>On Jan 29, 2008, at 12:04 PM, Metzler, David wrote:<o:p></o:p></span></font></p>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><br>
<br>
<o:p></o:p></span></font></p>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:navy'><u1:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="PersonName">Yes
true, I was mistaken about the variables being instatitated. But these values
are initially loaded from the database by the variable_init function, called in
the drupal bootstrap process before settings.php is loaded.&nbsp; Yes you can
override these in settings.php, in which case the database value doesn&#8217;t
matter, but hey are still meant to be site configuration values that do not
change.&nbsp; As the settings.php file indicates you don&#8217;t normally use
this method, unless you&#8217;re rally trying to something vhost specific.
&nbsp;They are not intended to house global variables that you intend to change
during the page load. &nbsp;&nbsp;Variable_set is designed to change the
database given values and is functioning as designed.&nbsp; It&#8217;s used by
the admin pages to alter the site specific values.&nbsp;&nbsp; <u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:navy'><u1:p>&nbsp;</u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:navy'>90% of all use cases are handled using variable_get() to get the
site specific configuration settings from the database and loaded in
cache.&nbsp;&nbsp; It&#8217;s only in weird multi-site hosting cases that you
would ever be overriding the values retrieved by variable_get in settings.php.
&nbsp;It is not the preferred method of handling values that you expect to
change during a page load or between page loads on a site. <u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:navy'><u1:p>&nbsp;</u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:navy'>Conf_init() in my inspection of the source code on drupal_api
initializes conf to an array() not a string. Where do you see this behavior? <u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:navy'><u1:p>&nbsp;</u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:navy'>Dave<u1:p></u1:p></span></font><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:navy'><u1:p>&nbsp;</u1:p></span></font><o:p></o:p></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><font
size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma;font-weight:
bold'>From:</span></font></b><font size=2 face=Tahoma><span style='font-size:
10.0pt;font-family:Tahoma'> support-bounces@drupal.org [<a
href="mailto:support-bounces@drupal.org">mailto:support-bounces@drupal.org</a>]
<b><span style='font-weight:bold'>On Behalf Of </span></b>Scott Matthews<br>
<b><span style='font-weight:bold'>Sent:</span></b> Tuesday, January 29, 2008
8:19 AM<br>
<b><span style='font-weight:bold'>To:</span></b> <st1:personname u2:st="on"><a
href="mailto:support@drupal.org">support@drupal.org</a></st1:personname><br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [support] Issues with
initializing Variables on startup..</span></font><u1:p></u1:p><o:p></o:p></p>

</div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'><u1:p>&nbsp;</u1:p><o:p></o:p></span></font></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>I don't believe
you fully understood me.<u1:p></u1:p><o:p></o:p></span></font></p>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'><u1:p>&nbsp;</u1:p><o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>First off,
variable_get does NOT retrieve from the database. &nbsp;if you look in the code
it ONLY retrieves from that $conf variable that variable_set stores the
variable in when it sets to the database. &nbsp;If, as you suggest David, it
really should retrieve from the database then it is not working as defined.<u1:p></u1:p><o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'><u1:p>&nbsp;</u1:p><o:p></o:p></span></font></p>

</div>

<div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>function
variable_get($name, $default) {<u1:p></u1:p><o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;&nbsp;global
$conf;<u1:p></u1:p><o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'><u1:p>&nbsp;</u1:p><o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;&nbsp;return
isset($conf[$name]) ? $conf[$name] : $default;<u1:p></u1:p><o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>}<u1:p></u1:p><o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'><u1:p>&nbsp;</u1:p><o:p></o:p></span></font></p>

</div>

</div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'><u1:p>&nbsp;</u1:p><o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'><u1:p>&nbsp;</u1:p><o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>Second, according
to the comments in the settings.php, you can initially override any variables
stored in the database in the settings.php file by setting the same variable
that variable_get and variable_set uses:<u1:p></u1:p><o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'><u1:p>&nbsp;</u1:p><o:p></o:p></span></font></p>

</div>

<div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>/**<u1:p></u1:p><o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;* Variable
overrides:<u1:p></u1:p><o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;*<u1:p></u1:p><o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;* To
override specific entries in the 'variable' table for this site,<u1:p></u1:p><o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;* set them
here. You usually don't need to use this feature. This is<u1:p></u1:p><o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;* useful in
a configuration file for a vhost or directory, rather than<u1:p></u1:p><o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;* the
default settings.php. Any configuration setting from the 'variable'<u1:p></u1:p><o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;* table can
be given a new value.<u1:p></u1:p><o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;*<u1:p></u1:p><o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;* Remove the
leading hash signs to enable.<u1:p></u1:p><o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>&nbsp;*<u1:p></u1:p><o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>/# </span></font><span
class=apple-style-span><b><u><font size=2><span style='font-size:10.5pt;
font-weight:bold'>$conf</span></font></u></b></span> = array(<u1:p></u1:p><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'># &nbsp;
'site_name' =&gt; 'My Drupal site',<u1:p></u1:p><o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'># &nbsp;
'theme_default' =&gt; 'minnelli',<u1:p></u1:p><o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'># &nbsp;
'anonymous' =&gt; 'Visitor',<u1:p></u1:p><o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'># );<u1:p></u1:p><o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'><u1:p>&nbsp;</u1:p><o:p></o:p></span></font></p>

</div>

<div><span style='orphans: 2;text-align:auto;widows: 2;-webkit-border-horizontal-spacing: 0px;
-webkit-border-vertical-spacing: 0px;-webkit-text-decorations-in-effect: none;
-webkit-text-size-adjust: auto;-webkit-text-stroke-width: 0;word-spacing:0px'><span
style='orphans: 2;widows: 2;-webkit-border-horizontal-spacing: 0px;-webkit-border-vertical-spacing: 0px;
-webkit-text-decorations-in-effect: none;-webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px;word-spacing:0px'>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;margin-bottom:12.0pt'><font
size=1 color=black face=Helvetica><span style='font-size:9.0pt;font-family:
Helvetica;color:black'><span style='orphans: 2;widows: 2;-webkit-border-horizontal-spacing: 0px;
-webkit-border-vertical-spacing: 0px;-webkit-text-decorations-in-effect: none;
-webkit-text-size-adjust: auto;-webkit-text-stroke-width: 0px;word-spacing:
0px'><u1:p>&nbsp;</u1:p></span></span></font><o:p></o:p></p>

</div>

<span style='orphans: 2;widows: 2;-webkit-border-horizontal-spacing: 0px;
-webkit-border-vertical-spacing: 0px;-webkit-text-decorations-in-effect: none;
-webkit-text-size-adjust: auto;-webkit-text-stroke-width: 0px;word-spacing:
0px'>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=1 color=black face=Helvetica><span style='font-size:9.0pt;font-family:
Helvetica;color:black'>Scott Matthews<u1:p></u1:p></span></font><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=1 color=black face=Helvetica><span style='font-size:9.0pt;font-family:
Helvetica;color:black'>Senior Developer<u1:p></u1:p></span></font><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=1 color=black face=Helvetica><span style='font-size:9.0pt;font-family:
Helvetica;color:black'>(w) 617-227-1855 x164<u1:p></u1:p></span></font><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=1 color=black face=Helvetica><span style='font-size:9.0pt;font-family:
Helvetica;color:black'>(m) 617-710-8430<u1:p></u1:p></span></font><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=1 color=black face=Helvetica><span style='font-size:9.0pt;font-family:
Helvetica;color:black'>(f)&nbsp;617-224-5388<u1:p></u1:p></span></font><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=1 color=black face=Helvetica><span style='font-size:9.0pt;font-family:
Helvetica;color:black'><a href="mailto:smatthews@optaros.com">smatthews@optaros.com</a><u1:p></u1:p></span></font><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=1 color=black face=Helvetica><span style='font-size:9.0pt;font-family:
Helvetica;color:black'><u1:p>&nbsp;</u1:p></span></font><o:p></o:p></p>

</div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=1 color=black face=Helvetica><span style='font-size:7.5pt;font-family:
Helvetica;color:black'><br>
<br>
<br>
<br>
</span></font><o:p></o:p></p>

</div>

<u1:p></u1:p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'></span></span></span><u1:p>&nbsp;</u1:p><o:p></o:p></span></font></p>

<div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>On Jan 29, 2008,
at 11:04 AM, Metzler, David wrote:<u1:p></u1:p><o:p></o:p></span></font></p>

</div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'><br>
<br>
<br>
<o:p></o:p></span></font></p>

<u1:p></u1:p>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:navy'><u3:smarttagtype namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="PersonName">I
think you&#8217;re confusing two completely independent constructs.&nbsp; <u3:p></u3:p></u3:smarttagtype></span></font><u1:p></u1:p><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:navy'><u3:p>&nbsp;</u3:p></span></font><u1:p></u1:p><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:navy'>Variable_get and variable_set are used to store system wide
settings that should persist in the database.&nbsp; They are never (to my
knowledge) instantiated as PHP variables. The caching structure is meant to
reduce the number of database hits involved in loading variables, and should
not generally be accessed directly.&nbsp; Multiple calls to variable_get should
leverage the cached variables as appropriate. <u3:p></u3:p></span></font><u1:p></u1:p><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:navy'><u3:p>&nbsp;</u3:p></span></font><u1:p></u1:p><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:navy'>The variables in settings.php can be used, you can define your own
global variables there, but if you want them to persist between page loads you
need to do that yourself. &nbsp;IN your hooks you can reference these variables
after defining them as globals, but be careful with namespace collisions.&nbsp;
I usually create a global variable that has the same name as my module and
store everying inside it (as an associative array).&nbsp; <u3:p></u3:p></span></font><u1:p></u1:p><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:navy'><u3:p>&nbsp;</u3:p></span></font><u1:p></u1:p><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:navy'>Finally session variables can be used and will persist in the
database for the duration of a session.&nbsp; <u3:p></u3:p></span></font><u1:p></u1:p><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:navy'><br>
Hope that clarifies things. &nbsp;It sounds like drupal is behaving as designed
here. <u3:p></u3:p></span></font><u1:p></u1:p><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:navy'><u3:p>&nbsp;</u3:p></span></font><u1:p></u1:p><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:navy'>Dave<u3:p></u3:p></span></font><u1:p></u1:p><o:p></o:p></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:navy'><u3:p>&nbsp;</u3:p></span></font><u1:p></u1:p><o:p></o:p></p>

<div>

<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>

<hr size=2 width="100%" align=center tabindex=-1>

</span></font></div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><b><font
size=2 face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma;font-weight:
bold'>From:</span></font></b><font size=2 face=Tahoma><span style='font-size:
10.0pt;font-family:Tahoma'> <a href="mailto:support-bounces@drupal.org">support-bounces@drupal.org</a>
[<a href="mailto:support-bounces@drupal.org">mailto:support-bounces@drupal.org</a>]
<b><span style='font-weight:bold'>On Behalf Of </span></b>Scott Matthews<br>
<b><span style='font-weight:bold'>Sent:</span></b> Tuesday, January 29, 2008
7:37 AM<br>
<b><span style='font-weight:bold'>To:</span></b> <st1:personname u4:st="on"><a
href="mailto:support@drupal.org">support@drupal.org</a></st1:personname><br>
<b><span style='font-weight:bold'>Cc:</span></b> Ron Trevarrow<br>
<b><span style='font-weight:bold'>Subject:</span></b> [support] Issues with
initializing Variables on startup..</span></font><u3:p></u3:p><u1:p></u1:p><o:p></o:p></p>

</div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'><u3:p>&nbsp;</u3:p><u1:p></u1:p><o:p></o:p></span></font></p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>I found what
Appears to be a bug (or two) with initializing variables in Drupal.<u3:p></u3:p><u1:p></u1:p><o:p></o:p></span></font></p>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'><u3:p>&nbsp;</u3:p><u1:p></u1:p><o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>It is suggested
that you can uncomment and set initial variable values in settings.php with the
$conf array. &nbsp;In doing so, and not seeing my variables set when retrieving
using variable_get, I discovered that conf_init(), when called to initialize
the configure file path, it sets $conf to a string. &nbsp;I know that since it
initializes settings.php within the context it conceptually SHOULD reset it to
a variable, but it doesn't. &nbsp; I proved this by changing the variable array
name in settings.php, variable_get, variable_set, variable_init and conf_init
to $config_vars and the values I initialized in settings.php were reflected
when my application later retrieved them using variable_get.<u3:p></u3:p><u1:p></u1:p><o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'><u3:p>&nbsp;</u3:p><u1:p></u1:p><o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;margin-bottom:12.0pt'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>This bug is
currently hindering the flexibility of an application that I'm writing that
will be deployed to different environments. &nbsp;I initially tried to set the
variables in the 'variable' table of the Database in order to retrieve them
with variable_get but that method only accesses the cached variables in $conf
(or in my case, $config_vars. &nbsp;Is this on purpose? &nbsp;I see that
variable_set will not only set the cached variable but will also set into the
database. &nbsp;This seems to be a bug as well to me. &nbsp;Can someone clarify
this for me?<u3:p></u3:p><u1:p></u1:p><o:p></o:p></span></font></p>

<div><span style='orphans: 2;text-align:auto;widows: 2;-webkit-border-horizontal-spacing: 0px;
-webkit-border-vertical-spacing: 0px;-webkit-text-decorations-in-effect: none;
-webkit-text-size-adjust: auto;-webkit-text-stroke-width: 0;word-spacing:0px'><span
style='orphans: 2;widows: 2;-webkit-border-horizontal-spacing: 0px;-webkit-border-vertical-spacing: 0px;
-webkit-text-decorations-in-effect: none;-webkit-text-size-adjust: auto;
-webkit-text-stroke-width: 0px;word-spacing:0px'>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;margin-bottom:12.0pt'><font
size=1 color=black face=Helvetica><span style='font-size:9.0pt;font-family:
Helvetica;color:black'><span style='orphans: 2;widows: 2;-webkit-border-horizontal-spacing: 0px;
-webkit-border-vertical-spacing: 0px;-webkit-text-decorations-in-effect: none;
-webkit-text-size-adjust: auto;-webkit-text-stroke-width: 0px;word-spacing:
0px'><u3:p>&nbsp;</u3:p></span></span></font><u1:p></u1:p><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=1 color=black face=Helvetica><span style='font-size:9.0pt;font-family:
Helvetica;color:black'>Scott Matthews<u3:p></u3:p></span></font><u1:p></u1:p><o:p></o:p></p>

</div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=1 color=black face=Helvetica><span style='font-size:9.0pt;font-family:
Helvetica;color:black'><u3:p>&nbsp;</u3:p></span></font><u1:p></u1:p><o:p></o:p></p>

</div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=1 color=black face=Helvetica><span style='font-size:7.5pt;font-family:
Helvetica;color:black'><br>
<br>
<br>
<br>
<br>
</span></font><o:p></o:p></p>

</div>

<u1:p></u1:p>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><u3:p><span style='font-size:12.0pt'></span></span><u3:p></u3:p>&nbsp;<o:p></o:p></span></u3:p><u1:p></u1:p></font></p>

</div>

</div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>--<span
class=apple-converted-space>&nbsp;<u1:p></u1:p></span><o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'>[ Drupal support
list | <a href="http://lists.drupal.org">http://lists.drupal.org</a>/ ]<u1:p></u1:p><o:p></o:p></span></font></p>

</div>

</div>

<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><font
size=3 face="Times New Roman"><span style='font-size:12.0pt'><u1:p>&nbsp;</u1:p><o:p></o:p></span></font></p>

</div>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'></u1:smarttagtype>--<span class=apple-converted-space>&nbsp;</span><o:p></o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>[ Drupal support list | <a href="http://lists.drupal.org">http://lists.drupal.org</a>/
]<o:p></o:p></span></font></p>

</div>

</div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p>&nbsp;</o:p></span></font></p>

</div>

</div>

</body>

</html>