Art-of-WiFi / UniFi-API-client

A PHP API client class to interact with Ubiquiti's UniFi Controller API
MIT License
1.09k stars 217 forks source link

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

Closed banakito closed 3 years ago

banakito commented 3 years ago

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()

malle-pietje commented 3 years ago

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 :wink:

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

banakito commented 3 years ago

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 commented 3 years ago

FYI; I quickly tested this on 7.2.5.

banakito commented 3 years ago

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 commented 3 years ago

Thanks, NP.

malle-pietje commented 3 years ago

Merged with 1.1.62