edamov / pushok

PHP client for Apple Push Notification Service (APNs) - Send push notifications to iOS using the new APNs HTTP/2 protocol with token-based (JWT with p8 private key)
MIT License
368 stars 119 forks source link

Error on PHP build with old cURL #98

Closed wyrmling closed 4 years ago

wyrmling commented 4 years ago

Description

Remi's PHP 7.3 is built on old cURL version that missing needed constant.

file: "/vendor/edamov/pushok/src/Client.php"
line: 98
message: "Use of undefined constant CURLMOPT_MAX_HOST_CONNECTIONS - assumed 'CURLMOPT_MAX_HOST_CONNECTIONS' (this will throw an Error in a future version of PHP)"

Solution

add after

            if (!defined('CURLPIPE_MULTIPLEX')) {
                define('CURLPIPE_MULTIPLEX', 2);
            }

this:

            if (!defined('CURLMOPT_MAX_HOST_CONNECTIONS')) {
                define('CURLMOPT_MAX_HOST_CONNECTIONS', 7);
            }
edamov commented 4 years ago

Thank you! Fixed in 0.11.1