Skip to content

Commit ca40a13

Browse files
committed
Verify the required php extensions are available on activation.
Resolves #10.
1 parent f2f8a48 commit ca40a13

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

woocommerce-gateway-lightning.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@
1414
exit;
1515
}
1616

17+
register_activation_hook( __FILE__, function(){
18+
if (!extension_loaded('gd') || !extension_loaded('curl')) {
19+
die('The php-curl and php-gd extensions are required.');
20+
}
21+
});
22+
1723
require_once 'vendor/autoload.php';
1824

1925
define('LIGHTNING_HOOK_KEY', hash_hmac('sha256', 'lightning-hook-token', AUTH_KEY));

0 commit comments

Comments
 (0)