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

get_curl_resource() check for object instead of resource in PHP 8 #82

Closed
wants to merge 2 commits into from
Closed

Conversation

banakito
Copy link

@banakito banakito commented Dec 7, 2020

in PHP 8.0 curl_init() do not return a resource but a CurlHandle object
As a workaround, check for object instead of resource in get_curl_resource()

in PHP 8.0 curl_init() is not returning a resource as stated in docs.
As a workaround, check for object instead of resource.
@malle-pietje
Copy link
Collaborator

Thanks for your contribution. This change does however break the client class for all PHP versions lower than 8 which isn't a good idea 😉

Instead, I'll change that statement to test for either an object or a resource. Will be included with the next release.

@banakito
Copy link
Author

banakito commented Dec 7, 2020

Thanks for your contribution. This change does however break the client class for all PHP versions lower than 8 which isn't a good idea 😉

Well, it's working for me also in version 7 :)
But, yes, your solution seems safer.

@malle-pietje
Copy link
Collaborator

FYI; I quickly tested this on 7.2.5.

@banakito
Copy link
Author

banakito commented Dec 7, 2020

FYI; I quickly tested this on 7.2.5.

You are correct. I'm in 7.4 but maybe i've mismatched something.

Thank you.

@malle-pietje
Copy link
Collaborator

Thanks, NP.

malle-pietje added a commit that referenced this pull request Dec 10, 2020
- added several monthly stats methods: `stat_monthly_gateway()`, `stat_monthly_site()`, `stat_monthly_aps()`, `stat_monthly_user()`, thanks go to @Roel Janssens for spotting these MongoDB collections
- test for `object` or `resource` in `get_curl_resource()`, closes PR #82 submitted by @banakito
- applied change to comments in `example/modify_smartpower_pdu_outlet.php` based on a suggestion by @thesohoguy
- removed unnecessary variable from `list_apgroups()`, thanks go to Stephen Davies for reporting
- added an optional parameter $ap_group_ids to the `create_wlan()` function/method for UniFi controller versions 6.0.X and higher, thanks go to Stephen Davies for contributing
@malle-pietje
Copy link
Collaborator

Merged with 1.1.62

@banakito banakito deleted the patch-2 branch December 10, 2020 15:47
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.

2 participants