web-push-libs / web-push-php

Web Push library for PHP
MIT License
1.69k stars 295 forks source link

Still requires GMP #316

Closed senky closed 2 years ago

senky commented 3 years ago

README says:

gmp (optional but better for performance)

but the code still triggers warning:

https://github.com/web-push-libs/web-push-php/blob/eddd95ca726bc529fbce7aaa90662584ad7ded3e/src/WebPush.php#L73-L81

What's the real status with GMP?

8Ozymandias commented 3 years ago

@senky Hello are you aware if it's possible that when one clicks on a notification if it's possible that it can open up the browser and go to a specific website and or section on that website?

askvortsov1 commented 3 years ago

Would also appreciate some clarity on this: not requiring GMP would be huge for adoption in my use case.

marc1706 commented 3 years ago

Based on my testing, web-push-php does work fine without GMP on PHP 7.3+. This is mostly due to PHP 7.3+ using openssl_pkey_derive instead of the pure PHP implementation (which does not work, see e.g. this test run: https://github.com/marc1706/web-push-php/runs/2156729472).

askvortsov1 commented 3 years ago

Ah great, thanks for the testing! PHP 7.2 is EOL anyways, so this is excellent news.

marc1706 commented 3 years ago

Since I showed you that 7.2 does not work, here actually an example that unit tests start working with PHP 7.3 (only phpstan issues left): https://github.com/marc1706/web-push-php/runs/2607203285?check_suite_focus=true

Azuxul commented 3 years ago

I it is possible to add a check for the php version and only require gmp in case of php<7.3 ?