<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:purple;
        text-decoration:underline;}
span.EmailStyle18
        {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=purple 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'>I think you&#8217;re confusing two
completely independent constructs.&nbsp; <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'>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. <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'>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; <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'>Finally session variables can be used and
will persist in the database for the duration of a session.&nbsp; <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'><br>
Hope that clarifies things. &nbsp;It sounds like drupal is behaving as designed
here. <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'>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
7:37 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'>Cc:</span></b> Ron Trevarrow<br>
<b><span style='font-weight:bold'>Subject:</span></b> [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'>I found what Appears to be a bug (or two) with initializing variables
in Drupal.<o:p></o:p></span></font></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>

</div>

<div>

<p class=MsoNormal><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.<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 style='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?<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='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>

<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'><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>

<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>