mirror of
https://github.com/Seldaek/monolog.git
synced 2025-07-30 09:50:26 +02:00
Merge pull request #1573 from mimmi20/add-extension-checks
add checks for required curl extension
This commit is contained in:
@@ -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;
|
||||
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user