Skip to content

Commit

Permalink
Verify the required php extensions are available on activation.
Browse files Browse the repository at this point in the history
Resolves #10.
  • Loading branch information
shesek committed Jan 26, 2018
1 parent f2f8a48 commit ca40a13
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions woocommerce-gateway-lightning.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
exit;
}

register_activation_hook( __FILE__, function(){
if (!extension_loaded('gd') || !extension_loaded('curl')) {
die('The php-curl and php-gd extensions are required.');
}
});

require_once 'vendor/autoload.php';

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

0 comments on commit ca40a13

Please sign in to comment.