mirror of
https://github.com/Seldaek/monolog.git
synced 2025-08-08 06:06:40 +02:00
@@ -31,6 +31,17 @@ class PushoverHandler extends SocketHandler
|
||||
private $highPriorityLevel;
|
||||
private $emergencyLevel;
|
||||
|
||||
/**
|
||||
* Sounds the api supports by default
|
||||
* @see https://pushover.net/api#sounds
|
||||
* @var array
|
||||
*/
|
||||
private $sounds = array(
|
||||
'pushover', 'bike', 'bugle', 'cashregister', 'classical', 'cosmic', 'falling', 'gamelan', 'incoming',
|
||||
'intermission', 'magic', 'mechanical', 'pianobar', 'siren', 'spacealarm', 'tugboat', 'alien', 'climb',
|
||||
'persistent', 'echo', 'updown', 'none',
|
||||
);
|
||||
|
||||
/**
|
||||
* @param string $token Pushover api token
|
||||
* @param string|array $users Pushover user id or array of ids the message will be sent to
|
||||
@@ -90,6 +101,12 @@ class PushoverHandler extends SocketHandler
|
||||
$dataArray['priority'] = 1;
|
||||
}
|
||||
|
||||
if (isset($record['context']['sound']) && in_array($record['context']['sound'], $this->sounds)) {
|
||||
$dataArray['sound'] = $record['context']['sound'];
|
||||
} elseif (isset($record['extra']['sound']) && in_array($record['extra']['sound'], $this->sounds)) {
|
||||
$dataArray['sound'] = $record['extra']['sound'];
|
||||
}
|
||||
|
||||
return http_build_query($dataArray);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user