[support] Issues with initializing Variables on startup..

Scott Matthews smatthews at optaros.com
Tue Jan 29 15:37:13 UTC 2008


I found what Appears to be a bug (or two) with initializing variables  
in Drupal.

It is suggested that you can uncomment and set initial variable  
values in settings.php with the $conf array.  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.  I know that since it  
initializes settings.php within the context it conceptually SHOULD  
reset it to a variable, but it doesn't.   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.

This bug is currently hindering the flexibility of an application  
that I'm writing that will be deployed to different environments.  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.  Is this on purpose?  I see that variable_set will not  
only set the cached variable but will also set into the database.   
This seems to be a bug as well to me.  Can someone clarify this for me?



Scott Matthews




-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.drupal.org/pipermail/support/attachments/20080129/6ae940a3/attachment.htm 


More information about the support mailing list