Skip to content

Commit

Permalink
Merge pull request #84 from openeuropa/permissions-octal
Browse files Browse the repository at this point in the history
Express permission values in octal
  • Loading branch information
pfrenssen authored Oct 9, 2018
2 parents 849593c + 1913bd8 commit f36a890
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/Commands/DrupalCommands.php
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,6 @@ public function settingsSetup(array $options = [
* Setup Drupal permissions.
*
* This command will set the necessary permissions on the default folder.
* Note that the chmod command takes decimal values.
*
* @command drupal:permissions-setup
*
Expand All @@ -374,11 +373,13 @@ public function permissionsSetup(array $options = [

// Define collection of tasks.
$collection = [
$this->taskFilesystemStack()->chmod($subdirPath, '509', 0000, true),
// Note that the chmod() method takes decimal values.
$this->taskFilesystemStack()->chmod($subdirPath, octdec(775), 0000, true),
];

if (file_exists($subdirPath . '/settings.php')) {
$collection[] = $this->taskFilesystemStack()->chmod($subdirPath . '/settings.php', '436');
// Note that the chmod() method takes decimal values.
$collection[] = $this->taskFilesystemStack()->chmod($subdirPath . '/settings.php', octdec(664));
}

return $this->collectionBuilder()->addTaskList($collection);
Expand Down

0 comments on commit f36a890

Please sign in to comment.