Skip to content

Commit 6fc8c01

Browse files
authored
Checks PHP version bebore requiring GMP (#346)
Fixes #316
1 parent 199c83e commit 6fc8c01

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/WebPush.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,12 @@ public function __construct(array $auth = [], array $defaultOptions = [], ?int $
6969
{
7070
$extensions = [
7171
'curl' => '[WebPush] curl extension is not loaded but is required. You can fix this in your php.ini.',
72-
'gmp' => '[WebPush] gmp extension is not loaded but is required for sending push notifications with payload or for VAPID authentication. You can fix this in your php.ini.',
7372
'mbstring' => '[WebPush] mbstring extension is not loaded but is required for sending push notifications with payload or for VAPID authentication. You can fix this in your php.ini.',
7473
'openssl' => '[WebPush] openssl extension is not loaded but is required for sending push notifications with payload or for VAPID authentication. You can fix this in your php.ini.',
7574
];
75+
if (version_compare(phpversion(), '7.3.0', '<')) {
76+
$extensions['gmp'] = '[WebPush] gmp extension is not loaded but is required for sending push notifications with payload or for VAPID authentication. You can fix this in your php.ini.';
77+
}
7678
foreach ($extensions as $extension => $message) {
7779
if (!extension_loaded($extension)) {
7880
trigger_error($message, E_USER_WARNING);

0 commit comments

Comments
 (0)