From 11dc8c730dda2c5bd38cb386f96331c5ce3cac9c Mon Sep 17 00:00:00 2001 From: Daniel Weipert Date: Tue, 20 Apr 2021 12:44:20 +0200 Subject: Adds a bunch of new Modules --- src/Support/HasPermissions.php | 15 +++++++++++++++ src/Support/Permissions.php | 28 ++++++++++++++++++++++++++++ 2 files changed, 43 insertions(+) create mode 100644 src/Support/HasPermissions.php create mode 100644 src/Support/Permissions.php (limited to 'src/Support') diff --git a/src/Support/HasPermissions.php b/src/Support/HasPermissions.php new file mode 100644 index 0000000..c42d71d --- /dev/null +++ b/src/Support/HasPermissions.php @@ -0,0 +1,15 @@ +owner, $this->group, $this->mode); + } +} diff --git a/src/Support/Permissions.php b/src/Support/Permissions.php new file mode 100644 index 0000000..daabf5a --- /dev/null +++ b/src/Support/Permissions.php @@ -0,0 +1,28 @@ +owner) || ! empty($this->group)) { + $permissions[] = "sudo chown -R $this->owner:$this->group $this->path"; + } + + if (! empty($this->mode)) { + $permissions[] = "sudo chmod -R $this->mode $this->path"; + } + + return implode(PHP_EOL, $permissions); + } +} -- cgit v1.2.3