From e19f6cb73bd6cd1511a4eaa673b0731c3c35be4d Mon Sep 17 00:00:00 2001 From: Greg Anderson Date: Fri, 10 Mar 2017 09:47:52 -0800 Subject: [PATCH] Fixes #2664: chmod settings.php for re-installs. --- src/Commands/core/SiteInstallCommands.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Commands/core/SiteInstallCommands.php b/src/Commands/core/SiteInstallCommands.php index ceaef9ee47..568b1c611f 100644 --- a/src/Commands/core/SiteInstallCommands.php +++ b/src/Commands/core/SiteInstallCommands.php @@ -269,12 +269,17 @@ public function pre(CommandData $commandData) { else { $this->logger()->info(dt('Sites directory @subdir already exists - proceeding.', array('@subdir' => $conf_path))); } + // Quietly try to make the conf_path directory writable for re-installs. + @chmod($conf_path, 0777); if (!drush_file_not_empty($settingsfile)) { if (!drush_op('copy', 'sites/default/default.settings.php', $settingsfile) && !drush_get_context('DRUSH_SIMULATE')) { throw new \Exception(dt('Failed to copy sites/default/default.settings.php to @settingsfile', array('@settingsfile' => $settingsfile))); } } + // Quietly try to make settings.php writable for re-installs. We will let the + // Drupal installer report any problems. + @chmod($settingsfile, 0666); // Write an empty sites.php if we using multi-site. if ($sitesfile_write) {