Open Radon8472 opened 1 year ago
Thanks for reporting this. I didn't want the spaghetti code in the constructUserAgentString
, but it seems it needs to know about a bunch of things to properly report. This will be fixed in the next patch.
Hi @Radon8472 , I tested my changes that remove this just now by building PHP from source without the cURL extension, but deepl-php
has curl-ext
as part of its requirements at the moment, so it won't install. Do you get this error with the cURL extension installed? You can check this for example with php -i | grep curl
. The output is empty when you don't have the extension installed.
Hi @Radon8472 , I tested my changes that remove this just now by building PHP from source without the cURL extension, but
deepl-php
hascurl-ext
as part of its requirements at the moment, so it won't install. Do you get this error with the cURL extension installed? You can check this for example withphp -i | grep curl
. The output is empty when you don't have the extension installed.
You are right. in My local dev system based on xampp, I dont have this error when I activate curl. But when I push the files to my life system (where I don`t have curl) I get the error.
You are using guzzle, and guzzle can run fine without curl using the native php streams or socket based Handlers, so I would recommend to move the curl dependency from the require
section to suggested
.
Otherwise you would stop everybody without curl extension from using deepl, and I see no reason for this, when you are using guzzle, what is made to be useable with native php too.
I tried to change the http-client like shown in the README section - Custom HTTP client.
What results in Error:
Here is my code to find this error:
So it seems that even when you chance the HttpClient, the Translator Class still tries to use method/functions related to Curl HttpClient for building the user-agend string.
Suggestion to fix:
$libraryInfoStr
to " curl/$curlVer"