From da6c7f811fa32ec86a7ef6942e40709e5e112363 Mon Sep 17 00:00:00 2001 From: juergen-pecher Date: Fri, 9 Sep 2016 13:18:31 +0200 Subject: [PATCH] chmod of htdocs file to composer post-update and install added --- scripts/composer/ScriptHandler.php | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/scripts/composer/ScriptHandler.php b/scripts/composer/ScriptHandler.php index a9fafdf851..81341661b5 100644 --- a/scripts/composer/ScriptHandler.php +++ b/scripts/composer/ScriptHandler.php @@ -49,20 +49,31 @@ public static function createRequiredFiles(Event $event) { $event->getIO()->write("Create a sites/default/services.yml file with chmod 0666"); } - // Create the files directory with chmod 0777 + // Create the files directory with chmod 2775 if (!$fs->exists($root . '/sites/default/files')) { $oldmask = umask(0); - $fs->mkdir($root . '/sites/default/files', 0777); + $fs->mkdir($root . '/sites/default/files', 2775); umask($oldmask); - $event->getIO()->write("Create a sites/default/files directory with chmod 0777"); + $event->getIO()->write("Create a sites/default/files directory with chmod 2775"); } - // Create the simpletest directory with chmod chmod 0777 + // Create the simpletest directory with chmod chmod 2775 if (!$fs->exists($root . '/sites/simpletest')) { $oldmask = umask(0); - $fs->mkdir($root . '/sites/simpletest', 0777); + $fs->mkdir($root . '/sites/simpletest', 2775); umask($oldmask); - $event->getIO()->write("Create a sites/simpletests directory with chmod 0777"); + $event->getIO()->write("Create a sites/simpletests directory with chmod 2775"); + } + + //chmod of drupal-root and settings files, needed for local docker dev-environment + if ($fs->exists($root)) { + shell_exec('chmod -R 2775 ' . $root); + } + if ($fs->exists($root . '/sites/default/settings.php')) { + shell_exec('chmod -R 444 ' . $root . '/sites/default/settings.php'); + } + if ($fs->exists($root . '/sites/default/.settings.local.php')) { + shell_exec('chmod -R 444 ' . $root . '/sites/default/.settings.local.php'); } }