Skip to content
Snippets Groups Projects
Commit 6b4733fe authored by jurgenhaas's avatar jurgenhaas
Browse files

docker4drupal#63 Ensure setting files are writeable and set...

docker4drupal#63 Ensure setting files are writeable and set them read-only afterwards
parent 0b3d4579
No related branches found
No related tags found
1 merge request!89Merging develop into main
Pipeline #996530 passed
...@@ -139,10 +139,13 @@ class Handler extends BaseHandler { ...@@ -139,10 +139,13 @@ class Handler extends BaseHandler {
$file = $projectRoot . '/settings/default/' . $template; $file = $projectRoot . '/settings/default/' . $template;
$link = $webRoot . '/sites/default/' . $template; $link = $webRoot . '/sites/default/' . $template;
$rendered = $this->config->render($template, file_get_contents($pluginRoot . '/templates/' . $template . '.twig')); $rendered = $this->config->render($template, file_get_contents($pluginRoot . '/templates/' . $template . '.twig'));
if (file_exists($file)) {
$fs->chmod($file, 0664);
}
file_put_contents($file, $rendered); file_put_contents($file, $rendered);
$rel = substr($fs->makePathRelative($file, $projectRoot . '/' . $link), 3, -1); $rel = substr($fs->makePathRelative($file, $projectRoot . '/' . $link), 3, -1);
$fs->symlink($rel, $link); $fs->symlink($rel, $link);
$fs->chmod($file, 0664); $fs->chmod($file, 0444);
if ($this->config->readValue('chg-acl')) { if ($this->config->readValue('chg-acl')) {
$fs->chgrp($file, $this->config->readValue('webserver-groupname')); $fs->chgrp($file, $this->config->readValue('webserver-groupname'));
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment