10000 minor #58153 [Filesystem] Add a warning about `chown()` and `chgrp()`… · symfony/symfony@fea8f98 · GitHub
[go: up one dir, main page]

Skip to content

Commit fea8f98

Browse files
minor #58153 [Filesystem] Add a warning about chown() and chgrp() on Windows (alexandre-daubois)
This PR was submitted for the 7.2 branch but it was merged into the 5.4 branch instead. Discussion ---------- [Filesystem] Add a warning about `chown()` and `chgrp()` on Windows | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Issues | - | License | MIT `chmod()` and `chgrp()` are not supported on Windows (see [this](https://github.com/php/php-src/blob/0d616d1b82ca7609a7ece762cb8688d9bed74370/ext/standard/tests/file/chgrp.phpt#L6) and [this](https://github.com/php/php-src/blob/0d616d1b82ca7609a7ece762cb8688d9bed74370/ext/standard/tests/file/chown.phpt#L6)). I propose to skip the logic of these methods when running on Windows. Commits ------- fa3fd9d [Filesystem] Add a warning about `chown()` and `chgrp()` on Windows
2 parents bcb8e70 + fa3fd9d commit fea8f98

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/Symfony/Component/Filesystem/Filesystem.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,9 @@ public function chmod($files, int $mode, int $umask = 0000, bool $recursive = fa
233233
/**
234234
* Change the owner of an array of files or directories.
235235
*
236+
* This method always throws on Windows, as the underlying PHP function is not supported.
237+
* @see https://www.php.net/chown
238+
*
236239
* @param string|iterable $files A filename, an array of files, or a \Traversable instance to change owner
237240
* @param string|int $user A user name or number
238241
* @param bool $recursive Whether change the owner recursively or not
@@ -260,6 +263,9 @@ public function chown($files, $user, bool $recursive = false)
260263
/**
261264
* Change the group of an array of files or directories.
262265
*
266+
* This method always throws on Windows, as the underlying PHP function is not supported.
267+
* @see https://www.php.net/chgrp
268+
*
263269
* @param string|iterable $files A filename, an array of files, or a \Traversable instance to change group
264270
* @param string|int $group A group name or number
265271
* @param bool $recursive Whether change the group recursively or not

0 commit comments

Comments
 (0)
0