networkteam / sentry_client

TYPO3 Extension for exception logging with sentry, see http://www.getsentry.com
33 stars 35 forks source link

Re-add support for PHP 7.4 in sentry-client 5 #90

Closed bmack closed 10 months ago

bmack commented 1 year ago

Hey @christophlehmann ,

just wanted to set up this extension in v11 project (which is PHP 7.4), in order to track existing issues with PHP before we upgrade to PHP 8 (and then to TYPO3 v12).

Seems like there are some problems with sentry/sdk and the combination with the http client implemented (we have heavy proxy settings going), as torben suggested last week to use sentry/sentry instead.

Error message is as follows:

Fatal error: Uncaught Symfony\Component\OptionsResolver\Exception\InvalidOptionsException: The option "http_proxy" with value array is expected to be of type "null" or "string", but is of type "array". in vendor/symfony/options-resolver/OptionsResolver.php:1060 Stack trace: #0 vendor/symfony/options-resolver/OptionsResolver.php(924): Symfony\Component\OptionsResolver\OptionsResolver->offsetGet('http_proxy') #1 vendor/sentry/sentry/src/Options.php(58): Symfony\Component\OptionsResolver\OptionsResolver->resolve(Array) #2 vendor/sentry/sentry/src/ClientBuilder.php(78): Sentry\Options->__construct(Array) #3 vendor/sentry/sentry/src/functions.php(20): Sentry\ClientBuilder::create(Array) #4  in vendor/symfony/options-resolver/OptionsResolver.php on line 1060

However, in order to get this "fixed", I would need to update to sentry_client 5, which supports TYPO3 v11 and v12, but only with PHP 8. From the dependencies, I do think it's possible to lift the extension v5 to also support PHP 7.4 AND PHP 8. What do you think? Would that be possible?

christophlehmann commented 1 year ago

Hey @bmack, it would be fine for me. Can you check it with 7.4 and provide a PR?

bmack commented 12 months ago

hey @christophlehmann ,

we now have this in production: https://github.com/networkteam/sentry_client/compare/main...b13:sentry_client:dev-php74

We needed to make some changes due to the naming of the Trait (which is only supported in PHP 8.0) and some other bugfixes.

TBH: I don't think we need to incorporate these changes in v5 of your package, and we can live with the fork until we hopefully can upgrade to PHP 8 some time in the next few months. I guess, we do need the changes to the proxy once we switch back to your version but we'll get back to you then.