1
0
mirror of https://github.com/Seldaek/monolog.git synced 2025-07-31 02:10:22 +02:00

add checks for required curl extension

This commit is contained in:
Thomas Müller
2021-07-27 19:50:08 +02:00
parent 7131256475
commit d76d691acf
4 changed files with 16 additions and 0 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;