Skip to content
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

Need to be able to pass CURL_OPTION values to client #33

Open
tamw-wnet opened this issue Feb 13, 2018 · 2 comments
Open

Need to be able to pass CURL_OPTION values to client #33

tamw-wnet opened this issue Feb 13, 2018 · 2 comments

Comments

@tamw-wnet
Copy link
Owner

Mark at KUED noted a case where he's using the client via a proxy, but there's not a current means to pass the necessary CURL_OPTION flags to the client to make it work.

I propose to add an overall options array argument to the client constructor, and if that array includes a CURL_OPTIONS array apply those to the 'build_curl_handle()' function.

@augustuswm
Copy link
Collaborator

Was looking at implementing this if no one has yet. Couple thoughts:

  • Should this be a separate method configure_curl or something something? In an effort to keep the constructor arg list small.
  • I assume we are allowing any option to be passed in, without filtering. Presumably if an invalid option is passed in we let it silently fail (I think that is how curl_setopt works, but it has been a while)
  • curl_setopt calls that the we are already using, presumably overwrite what is passed in by the user?

@tamw-wnet
Copy link
Owner Author

I kind of was thinking a single big options array arg -- updating to

new PBS_Media_Manager_Client($client_id = '', $client_secret = '', $base_endpoint = '', $options = array())
since there's bound to be more options we'll want to add in the future. But I don't feel super strongly about that, there may be a case in the future for having more complete control over curl configuration.

As for filtering, I was going to suggest we keep it simple -- if there's an array 'curl_setopt', pass those straight to build_curl_handle, without validation. If they're not valid calls, they'll fail on their own. And if they attempt to overwrite something we've already set, well, everyone can see the source code and can see what they shouldn't have done. Everything we're setting as a curl_setopt now

@acrosman a question I have is, are there any specifics RE the drupal module that we need to watch out for? Since that's the primary usecase now.

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

No branches or pull requests

2 participants