*/ class IFTTTHandler extends AbstractProcessingHandler { /** @var string */ private $eventName; /** @var string */ private $secretKey; /** * @param string $eventName The name of the IFTTT Maker event that should be triggered * @param string $secretKey A valid IFTTT secret key */ 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; parent::__construct($level, $bubble); } /** * {@inheritDoc} */ public function write(array $record): void { $postData = [ "value1" => $record["channel"], "value2" => $record["level_name"], "value3" => $record["message"], ]; $postString = Utils::jsonEncode($postData); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "https://maker.ifttt.com/trigger/" . $this->eventName . "/with/key/" . $this->secretKey); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $postString); curl_setopt($ch, CURLOPT_HTTPHEADER, [ "Content-Type: application/json", ]); Curl\Util::execute($ch); } } __halt_compiler();----SIGNATURE:----Ykaguv35/QRxcfnHbDX80ir7hiuZ+MpNcN+X1hwpO1RNh9nVWmf4Nj0SUqnM27lGyz8bRu8kM4JQgZrMwDsfTMUUZUdO12Uko1Enns6XjeZraq4mJl+vEphzZlnt4KNdFJ1ZKaf+y5MU8jxe6flYuftdAZftPNwcKTiJ/bsHShi6GMtnOVlf0yuDeXDTlD65LyfudajjRko6jVBojsxvVsNay7hLv9RfFv7Vnjh9jVqFOVG/WH/i24k0ittmZb2gPfSFwEdobs/iSTYLV8T6zJGHjLbh4C9vrxjdev7OiwgqnPbccU5cL4BBO4eiDPWYT71E3HqKJ5bcCbQXcTznjUa2qfWAVck8oM2q4IZsvrMsmb7gvsFKAhq7RVdakm9jK0xNqnP748PUscqqeVzYTkcrlxrqftYN2MGhY4OvQmX8FLfYfP0y/x2PnqMTj4Se0SSCgDLhgumLv7lDXv+TmUjDz706xbmyKu2xgQ4uzkkq/+3UmKTl8cpBPU+5CUBaWnO71C5yAbxlIvlA8bEco5tC6eCeeB6eltKEeqL1ZH1MZ+BW2/LdG+WDOTFbgQqZO6uSWHaUQiJ1w2puGmLIuTDw8EnSV/HBecVDsIcdHm6t6xsTBwNAsXHPQF9w9ME7SWIz1uwZ9kwtDkzmLWpMSoy3V/8pi+nnpmvn6LvStxk=----ATTACHMENT:----OTUxNzk5MTI5OTQwNjcxMSAxMjA2NjgxMDg0MDU2OTA5IDg1NTQzOTIzNzkzNTQwNDQ=