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.
I'm using drush site-install after having generated the settings.php file from a deployment script.
my settings.php file contains a conditional inclusion of the domain bootstrap:
if (!drupal_installation_attempted()){
include DRUPAL_ROOT . '/sites/all/modules/domain/settings.inc';
}
But the drupal_installation_attempted will return false and the domain bootstrap will be loaded, because drush site-install sets the MAINTENANCE_MODE after having read settings.php.
Why does drush do so?
I think it's related to the fact that my settings.php is already containing database settings.
But shouldn't the MAINTENANCE_MODE be set asap, when calling site-install?
Comments
Comment #1
moshe weitzman CreditAttribution: moshe weitzman commentedSeems reasonable. When does MAINTENANCE_MODE get set today? That string does not appear in site-install command at all.
Comment #2
benoit.pointet CreditAttribution: benoit.pointet commentedIt get set at ./commands/core/drupal/site_install.inc:11
inside the drush_core_site_install_version function.
Comment #3
greg.1.anderson CreditAttribution: greg.1.anderson commentedDrush loads the settings.php file in drush_core_pre_site_install(), when it calls
drush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_CONFIGURATION)
(d6) ordrush_bootstrap(DRUSH_BOOTSTRAP_DRUPAL_SITE)
(d7).site_install.inc does not get included until drush_core_site_install(). Seems reasonable to me to move the
define('MAINTENANCE_MODE', 'install');
from site_install.inc to drush_core_pre_site_install, just prior to including settings.php.Comment #4
moshe weitzman CreditAttribution: moshe weitzman commentedAh right, thanks. Moved it earlier and committed.
Comment #5
benoit.pointet CreditAttribution: benoit.pointet commentedthanks!
Comment #7
DuaelFrI can't understand why but this does not work anymore.
Comment #8
greg.1.anderson CreditAttribution: greg.1.anderson commentedCould we get a more specific report than #7? Please test against latest dev, and follow the instructions on the new issue page when describing your symptoms.
Comment #9
greg.1.anderson CreditAttribution: greg.1.anderson commentedThis issue was marked
closed (won't fix)
because Drush has moved to Github.If desired, you may copy this bug to our Github project and then post a link here to the new issue. Please also change the status of this issue to
closed (duplicate)
.Please ask support questions on Drupal Answers.
Comment #9.0
greg.1.anderson CreditAttribution: greg.1.anderson commentedprecisions