Skip to content
Snippets Groups Projects
Commit 54ce0eac authored by Adam G-H's avatar Adam G-H Committed by Adam G-H
Browse files

Some fixes

parent cf8f9113
No related branches found
No related tags found
1 merge request!900Issue #3363938: Package Manager should ignore default.settings.php and default.services.yml
......@@ -74,6 +74,10 @@ class SiteConfigurationExcluder implements EventSubscriberInterface {
*/
public function makeDefaultSiteDirectoryWritable(PostCreateEvent $event): void {
$dir = $this->getDefaultSiteDirectoryPath($event->stage->getStageDirectory());
// If the directory doesn't even exist, there's nothing to do here.
if (!is_dir($dir)) {
return;
}
if (!$this->fileSystem->chmod($dir, 0777)) {
throw new FileException("Could not change permissions on '$dir'.");
}
......@@ -90,8 +94,12 @@ class SiteConfigurationExcluder implements EventSubscriberInterface {
* cannot be determined, or cannot be changed on the staged `sites/default`.
*/
public function syncDefaultSiteDirectoryPermissions(PreApplyEvent $event): void {
$live_dir = $this->getDefaultSiteDirectoryPath($this->pathLocator->getProjectRoot());
$staged_dir = $this->getDefaultSiteDirectoryPath($event->stage->getStageDirectory());
// If the directory doesn't even exist, there's nothing to do here.
if (!is_dir($staged_dir)) {
return;
}
$live_dir = $this->getDefaultSiteDirectoryPath($this->pathLocator->getProjectRoot());
// This is borrowed from \Symfony\Component\Filesystem\Filesystem::copy(),
// to ensure the correct permissions are preserved (chmod() requires
......
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