Skip to content

Commit

Permalink
Fixes #2664: chmod settings.php for re-installs.
Browse files Browse the repository at this point in the history
  • Loading branch information
greg-1-anderson committed Mar 10, 2017
1 parent 57031a5 commit e19f6cb
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Commands/core/SiteInstallCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit e19f6cb

Please sign in to comment.