There are no BOOTSTRAP_VARIABLE stage in the current bootstrap process. That means there is no way to explicitly know if the variable subsystem has been initialized.

I suggest we add such stage and move it just after BOOTSTRAP_DATABASE.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Damien Tournoud’s picture

Assigned: Unassigned » Damien Tournoud
Status: Active » Needs review
FileSize
3.55 KB

I needed that because of #322549: t() should work regardless of the bootstrap phase.

This patch create a new BOOTSTRAP_VARIABLE stage after ACCESS but before SESSION.

chx’s picture

Status: Needs review » Needs work

So we would allow require_once DRUPAL_ROOT . '/' . variable_get('session_inc', 'includes/session.inc'); this to come from DB. However, if you have the means to run from session.inc from somewhere else, like memcache or APC then you are advanced enough that manually editing settings.php can not be a problem.

However, if a script were to bootstrap only to SESSION then now it will run variable_init as well which (in most cases) means a database query -- before, it had the access query and the session query now it has a cache query as well. That's a very big price to pay just to not need to edit settings.php in the first case.

Damien Tournoud’s picture

Status: Needs work » Closed (won't fix)

This won't fly, for now.

Damien Tournoud’s picture

Status: Closed (won't fix) » Needs review
FileSize
2.94 KB

Ok, here is a new patch, that only adds an explicit BOOTSTRAP_VARIABLE stage. The order of initialization is unchanged.

Dries’s picture

Status: Needs review » Needs work

This patch doesn't apply.

Damien Tournoud’s picture

Title: BOOTSTRAP_VARIABLE should be explicit » BOOTSTRAP_VARIABLES should be explicit
Status: Needs work » Needs review
FileSize
3.46 KB

Re-roll. And changed the name of the constant to D_B_VARIABLES.

Damien Tournoud’s picture

Category: bug » task
Dries’s picture

Status: Needs review » Fixed

Committed to CVS HEAD. Thanks.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.