-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: attempt to make settings.php writable on re-install #2664
Comments
Drush really tries to chmod as little as possible. It tends to upset people. I don't really love this idea. FYI, the install profile is no longer written to settings.php as of 8.3. That might improve your re-install case. See https://www.drupal.org/node/2156401 |
Well, in this case, Drush is only chmod'ing something that Drupal is already chmod'ing. Feel free to close this and the PRs if this is just off-the-table. As for https://www.drupal.org/node/2156401, though, that is only applicable for sites with exactly one distribution, right? |
TL;DNR:
I want to add
@chmod($settingsfile, 0666);
(and equivalent for$conf_dir
) at the beginning of site install, leaving any failures for the installer to detect and report. I will make PRs for the master and 8.x branch if this sounds okay.Background:
If you attempt to run site-install on a site that has already been installed, there is a risk that the installation will fail, because Drupal makes settings.php and the config directory unwritable during the installation process. This is usually not a problem, as the installer will also skip writing settings.php if the installation profile remains the same from one install to the next.
Switching installation profiles usually doesn't work; however, there is one use-case where it does work -- switching to the config_installer.
My use-case involves a Drupal site that is configured for the user. On the initial install, the standard installation profile is used. Using the config_installer on the initial install doesn't work, because config_installer requires config files be exported in the sync directory, and I don't want to maintain these.
In the past, I would use
drush site-install
with the--config-dir
option with the minimal installation profile. This works fine, but if you want to start with the standard installation profile, and then switch to minimal, you have to hand-modify your exported configuration files, which is awkward. The transition to the config_installer is much smoother.I don't think there's any downside to making settings.php writable in
drush site-install
; the Drupal installer will reset it back to unmodifiable in short order.Workaround (for Drush 8):
reinstall.drush.inc
The text was updated successfully, but these errors were encountered: