Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#6 | 323391-explicit-BOOTSTRAP_VARIABLE.patch | 3.46 KB | Damien Tournoud |
#4 | 323391-explicit-BOOTSTRAP_VARIABLE.patch | 2.94 KB | Damien Tournoud |
#1 | 323391-explicit-BOOTSTRAP_VARIABLE.patch | 3.55 KB | Damien Tournoud |
Comments
Comment #1
Damien Tournoud CreditAttribution: Damien Tournoud commentedI 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.
Comment #2
chx CreditAttribution: chx commentedSo 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.
Comment #3
Damien Tournoud CreditAttribution: Damien Tournoud commentedThis won't fly, for now.
Comment #4
Damien Tournoud CreditAttribution: Damien Tournoud commentedOk, here is a new patch, that only adds an explicit BOOTSTRAP_VARIABLE stage. The order of initialization is unchanged.
Comment #5
Dries CreditAttribution: Dries commentedThis patch doesn't apply.
Comment #6
Damien Tournoud CreditAttribution: Damien Tournoud commentedRe-roll. And changed the name of the constant to D_B_VARIABLES.
Comment #7
Damien Tournoud CreditAttribution: Damien Tournoud commentedComment #8
Dries CreditAttribution: Dries commentedCommitted to CVS HEAD. Thanks.
Comment #9
Anonymous (not verified) CreditAttribution: Anonymous commentedAutomatically closed -- issue fixed for two weeks with no activity.