diff --git a/src/Monolog/Handler/IFTTTHandler.php b/src/Monolog/Handler/IFTTTHandler.php index f43ef267..000ccea4 100644 --- a/src/Monolog/Handler/IFTTTHandler.php +++ b/src/Monolog/Handler/IFTTTHandler.php @@ -38,6 +38,10 @@ class IFTTTHandler extends AbstractProcessingHandler */ public function __construct(string $eventName, string $secretKey, $level = Logger::ERROR, bool $bubble = true) { + if (!extension_loaded('curl')) { + throw new MissingExtensionException('The curl extension is needed to use the IFTTTHandler'); + } + $this->eventName = $eventName; $this->secretKey = $secretKey; diff --git a/src/Monolog/Handler/SendGridHandler.php b/src/Monolog/Handler/SendGridHandler.php index 4ec64290..1280ee70 100644 --- a/src/Monolog/Handler/SendGridHandler.php +++ b/src/Monolog/Handler/SendGridHandler.php @@ -59,6 +59,10 @@ class SendGridHandler extends MailHandler */ public function __construct(string $apiUser, string $apiKey, string $from, $to, string $subject, $level = Logger::ERROR, bool $bubble = true) { + if (!extension_loaded('curl')) { + throw new MissingExtensionException('The curl extension is needed to use the SendGridHandler'); + } + parent::__construct($level, $bubble); $this->apiUser = $apiUser; $this->apiKey = $apiKey; diff --git a/src/Monolog/Handler/SlackWebhookHandler.php b/src/Monolog/Handler/SlackWebhookHandler.php index d6a3733e..8ae3c788 100644 --- a/src/Monolog/Handler/SlackWebhookHandler.php +++ b/src/Monolog/Handler/SlackWebhookHandler.php @@ -58,6 +58,10 @@ class SlackWebhookHandler extends AbstractProcessingHandler bool $bubble = true, array $excludeFields = array() ) { + if (!extension_loaded('curl')) { + throw new MissingExtensionException('The curl extension is needed to use the SlackWebhookHandler'); + } + parent::__construct($level, $bubble); $this->webhookUrl = $webhookUrl; diff --git a/src/Monolog/Handler/TelegramBotHandler.php b/src/Monolog/Handler/TelegramBotHandler.php index 013cfdd8..9ea05737 100644 --- a/src/Monolog/Handler/TelegramBotHandler.php +++ b/src/Monolog/Handler/TelegramBotHandler.php @@ -90,6 +90,10 @@ class TelegramBotHandler extends AbstractProcessingHandler bool $disableWebPagePreview = null, bool $disableNotification = null ) { + if (!extension_loaded('curl')) { + throw new MissingExtensionException('The curl extension is needed to use the TelegramBotHandler'); + } + parent::__construct($level, $bubble); $this->apiKey = $apiKey;