-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Filesystem] chown and chgrp should also accept int as owner and group #35356
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Why is this better than providing the integer as a string? I think |
Because it doesn't work:
|
I've push the first commit with only the tests, so you can see them failing the first time: https://travis-ci.org/symfony/symfony/jobs/637855585#L3952 |
OK, thanks! Can you send a PR to 3.4 to update the docblock please? |
Done |
Tests on AppVeyor are failing now. Can you please check how to fix them? |
Honestly I don't get why How can I debug this without a Windows machine? Shrinking |
…wner and group (3.4) (Slamdunk) This PR was merged into the 3.4 branch. Discussion ---------- [Filesystem] chown and chgrp should also accept int as owner and group (3.4) | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | no | New feature? | no | Deprecations? | no | Tickets | | License | MIT | Doc PR | Reference: #35356 (comment) Commits ------- 6b811e6 chown and chgrp should also accept int as owner and group
@@ -669,6 +710,23 @@ public function testChgrpSymlink() | |||
$this->assertSame($group, $this->getFileGroup($link)); | |||
} | |||
|
|||
public function testChgrpSymlinkById() | |||
{ | |||
$this->markAsSkippedIfSymlinkIsMissing(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
symlink is not missing on appveyor, so this doesn't skip Windows.
use if ('\\' === \DIRECTORY_SEPARATOR) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unable to understand the bug as is: I'll create a separate playground PR to debug it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about calling markAsSkippedIfPosixIsMissing()
instead? I think chgrp()
doesn't work otherwise.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, that's what I've done now: https://github.com/symfony/symfony/pull/35356/files#diff-f912c7214d9bb13479ead974deabe7d3R126
Thank you @Slamdunk. |
…er and group (Slamdunk) This PR was squashed before being merged into the 5.0 branch. Discussion ---------- [Filesystem] chown and chgrp should also accept int as owner and group | Q | A | ------------- | --- | Branch? | 5.0 for bug fixes | Bug fix? | yes | New feature? | no <!-- please update src/**/CHANGELOG.md files --> | Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files --> | Tickets | | License | MIT | Doc PR | Both [chown](https://www.php.net/manual/en/function.chown.php) and [chgrp](https://www.php.net/manual/en/function.chgrp.php) accept both `string` for username and `int` for user id. The string typehint was only in the docblock till 4.4, so it was non-blocking. Commits ------- eba5a0c [Filesystem] chown and chgrp should also accept int as owner and group
Both chown and chgrp accept both
string
for username andint
for user id.The string typehint was only in the docblock till 4.4, so it was non-blocking.