Skip to content

Conversation

@phpdreams
Copy link
Contributor

I needed the ability to retrieve just the admins from an Organization as well as get a single member's status within an Organization.

This can be done via:
GitHub::organization()->members()->all($orgName, null, 'all', 'admin')
and
GitHub::organization()->members()->member($orgName)

I also wanted to be able to add/invite a user/member to an Organization. In testing this, I found that caching the PUT request to GitHub resulted in ResponseExceptions as the API would return a 421 response to the request check. The most logical fix was to restrict caching to GET requests only as the other request types all should affect changes at GitHub and therefore render the idea of caching for them moot.

Copy link
Contributor

Choose a reason for hiding this comment

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

Or HEAD too.

Copy link
Contributor

Choose a reason for hiding this comment

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

if (in_array($httpMethod, array('GET', 'HEAD'), true))

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea Graham, I've added this to the request. Thanks!

@gquemener
Copy link
Contributor

Indeed caching should only be performed on safe http request (ie: GET, OPTIONS and HEAD).

Not sure why it wasn't the case before...

@docteurklein
Copy link
Contributor

We should leverage the cache mechanism that guzzle offers now.
The current one was written before guzzle had it. (AFAIR).

@cursedcoder cursedcoder merged commit 67f507f into KnpLabs:master Jun 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants