Skip to content

Commit

Permalink
chmod of htdocs file to composer post-update and install added
Browse files Browse the repository at this point in the history
  • Loading branch information
juergen-pecher committed Sep 9, 2016
1 parent 032648a commit da6c7f8
Showing 1 changed file with 17 additions and 6 deletions.
23 changes: 17 additions & 6 deletions scripts/composer/ScriptHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}

}
Expand Down

0 comments on commit da6c7f8

Please sign in to comment.