Hello,
On a drupal 6.6 multisite installation, I can't change the online status with - changing the site_offline value (`s:1:"1";` or `s:1:"0";`) in the variable table - adding $conf['site_offline'] = 's:1:"0";'; (or $conf['site_offline'] = 's:1:"1";';) in my settings.php and I don't understand why!
When I change the status by the "normal" way (admin/settings/site-maintenance), the only change in the variable table are (by diff on 2 dumps): before (online) INSERT INTO `dev_variable` VALUES ('site_offline','s:1:"1";'); INSERT INTO `dev_variable` VALUES ('cache_flush','i:1225586663;'); after (offline) INSERT INTO `dev_variable` VALUES ('site_offline','s:1:"0";'); INSERT INTO `dev_variable` VALUES ('cache_flush','i:1225587127;');
Any idea ?
PS: - I'm sure I'm changing the right table (when I change the status with admin/settings/site-maintenance, I see the value change) - I'm sure I'm changing the right settings.php (I made a syntax error to test)
In settings.php the value you are looking for is
$conf['site_offline'] = '1';
's:1:"1";' is a serialized value used to store PHP variables in a database column. It is basically short hand for, "a string whose length is 1 character(s), and contains the character 1."
If you change this in the database, you'll also want to delete the cached variables array from the cache table. To do this simply delete the row where CID = 'variables.' For example, run:
DELETE FROM cache WHERE cid = "variables";
Drupal will rebuild this array and cache it again the next time a variable is requested.
Hope this helps.
-Mike
On Nov 1, 2008, at 6:15 PM, Daniel Caillibaud wrote:
Hello,
On a drupal 6.6 multisite installation, I can't change the online status with
- changing the site_offline value (`s:1:"1";` or `s:1:"0";`) in the
variable table
- adding $conf['site_offline'] = 's:1:"0";'; (or
$conf['site_offline'] = 's:1:"1";';) in my settings.php and I don't understand why!
When I change the status by the "normal" way (admin/settings/site- maintenance), the only change in the variable table are (by diff on 2 dumps): before (online) INSERT INTO `dev_variable` VALUES ('site_offline','s:1:"1";'); INSERT INTO `dev_variable` VALUES ('cache_flush','i:1225586663;'); after (offline) INSERT INTO `dev_variable` VALUES ('site_offline','s:1:"0";'); INSERT INTO `dev_variable` VALUES ('cache_flush','i:1225587127;');
Any idea ?
PS:
- I'm sure I'm changing the right table (when I change the status
with admin/settings/site-maintenance, I see the value change)
- I'm sure I'm changing the right settings.php (I made a syntax
error to test)
-- Daniel -- [ Drupal support list | http://lists.drupal.org/ ]
__________________ Michael Prasuhn mike@mikeyp.net http://mikeyp.net
Le 01/11/08 à 20:18, Michael Prasuhn mike@mikeyp.net a écrit :
In settings.php the value you are looking for is
$conf['site_offline'] = '1';
's:1:"1";' is a serialized value used to store PHP variables in a database column. It is basically short hand for, "a string whose length is 1 character(s), and contains the character 1."
Thanks, but it's not enough, because cache I guess.
If you change this in the database, you'll also want to delete the cached variables array from the cache table. To do this simply delete the row where CID = 'variables.' For example, run:
DELETE FROM cache WHERE cid = "variables";
Drupal will rebuild this array and cache it again the next time a variable is requested.
Hope this helps.
Yep, this helps, but I need
UPDATE variable SET value='s:1:"1";' WHERE name='site_offline'; TRUNCATE TABLE cache; TRUNCATE TABLE cache_content; TRUNCATE TABLE cache_page;
to really change the site status
Thanks
On Nov 2, 2008, at 7:15 AM, Daniel Caillibaud wrote:
Le 01/11/08 à 20:18, Michael Prasuhn mike@mikeyp.net a écrit :
In settings.php the value you are looking for is
$conf['site_offline'] = '1';
's:1:"1";' is a serialized value used to store PHP variables in a database column. It is basically short hand for, "a string whose length is 1 character(s), and contains the character 1."
Thanks, but it's not enough, because cache I guess.
I assume you have page caching turned on, and that is what you are referring to. Just to be clear, the $conf values supplied from setttings.php are *never* cached between page requests.
-Mike
__________________ Michael Prasuhn mike@mikeyp.net http://mikeyp.net
Le 02/11/08 à 08:55, Michael Prasuhn mike@mikeyp.net a écrit :
$conf['site_offline'] = '1';
's:1:"1";' is a serialized value used to store PHP variables in a database column. It is basically short hand for, "a string whose length is 1 character(s), and contains the character 1."
Thanks, but it's not enough, because cache I guess.
I assume you have page caching turned on, and that is what you are referring to. Just to be clear, the $conf values supplied from setttings.php are *never* cached between page requests.
What I did : - site is online, I'm not loggued - I write $conf['site_offline'] = '1'; at the end of my setttings.php => site is still online on homepage (even with flushing browser cache), but is offline on another page not displayed before - conf['site_offline'] = '0'; - site is still offline until I ask for another page (node/xxx not displayed before)
if I do (directly in mysql, not in php code) TRUNCATE TABLE cache_page; just after changing $conf['site_offline'] in settings.php (and before asking any page), it works fine, so I guess that online/offline pages are cached, so just changing $conf doesn't change anything for web client, until caches are cleared.
Pb is that drupal_flush_all_caches() function isn't yet definded in settings.php, so just changing something in settings.php can't toggle the site online/offline. It's not a big pb, I will write a little mysql script to put all drupal websites online/offline, I just thought changing settings was enough.
Thanks for help anyway (I learnt something about string storage in variable table).