Skip to content

Update ext/posix parameter names #6275

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

Closed
wants to merge 4 commits into from
Closed

Conversation

nikic
Copy link
Member

@nikic nikic commented Oct 5, 2020

No description provided.

@nikic nikic requested a review from kocsismate October 5, 2020 14:34
@nikic
Copy link
Member Author

nikic commented Oct 5, 2020

I guess for this extension the main open question is whether we should use things like $uid, $gid etc or use $user_id, $group_id etc.

@Girgias
Copy link
Member

Girgias commented Oct 5, 2020

There is already a use of pid, so uid and gid would make more sense I think.

Copy link
Member

@kocsismate kocsismate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using $uid and $gid is ok from my side. There is a $pgid though, which is slightly beyond my limits, but I can live with it. Also, I saw that there are a couple of $fd parameters. Unless I'm missing that it's a very general abbreviation, I'd prefer $file_descriptor.


#ifdef HAVE_INITGROUPS
function posix_initgroups(string $name, int $base_group_id): bool {}
function posix_initgroups(string $username, int $base_group_id): bool {}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does $base_group_id really require the $base prefix? What about just $gid to make it consistent with the rest of the parameters?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Man page says:

   The  initgroups() function initializes the group access list by reading the group database
  /etc/group and using all groups of which user is a member.  The additional group group  is
  also added to the list.

So yeah, I have no idea what the base_ prefix is even supposed to mean, I'll drop it.

@nikic
Copy link
Member Author

nikic commented Oct 5, 2020

Using $uid and $gid is ok from my side. There is a $pgid though, which is slightly beyond my limits, but I can live with it.

Yeah, I also had to look up what pgid means :) Personally I'm leaning towards using the longer names here...

Also, I saw that there are a couple of $fd parameters. Unless I'm missing that it's a very general abbreviation, I'd prefer $file_descriptor.

Maybe we just want to call these $stream? While an integer FD is also accepted, I would expect passing a stream is the typical use-case.

@kocsismate
Copy link
Member

Yeah, I also had to look up what pgid means :) Personally I'm leaning towards using the longer names here...

👍 Overall, I'm happy to hear it!

Maybe we just want to call these $stream? While an integer FD is also accepted, I would expect passing a stream is the typical use-case.

I like $file_descriptor, but I'm not against $stream at all. Maybe $file could be the middle ground again (like in exif_read_data()).

@php-pulls php-pulls closed this in d9dce83 Oct 6, 2020
@nikic
Copy link
Member Author

nikic commented Oct 6, 2020

I like $file_descriptor, but I'm not against $stream at all. Maybe $file could be the middle ground again (like in exif_read_data()).

I went with $file_descriptor in the end. I think $file sounds too much like this would accept a path to a file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants